AI Music API
API Documentation
Explore our powerful API to generate music with AI
Get and store an API key
Authentication belongs on your application server. Never place a production key in browser code, a mobile bundle, logs, or a public repository.
- 1Create an account and open the API key area in the dashboard.
- 2Copy the key once, then store it in your server's secret manager or encrypted environment.
- 3Send it in the Authorization header as a Bearer token and rotate it immediately if exposed.
The examples read the key from the server environment variable UDIOAPI_KEY
Quick Start
Create an asynchronous music task, save the returned workId, and poll the feed endpoint for completion. The request below is ready to run after setting your server key.
/api/v2/generateexport UDIOAPI_KEY='replace-with-your-server-key'
curl --request POST \
--url 'https://udioapi.pro/api/v2/generate' \
--header "Authorization: Bearer $UDIOAPI_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "chirp-v5-5",
"gpt_description_prompt": "Warm indie pop with acoustic guitar",
"make_instrumental": true
}'
# Save workId from the response, then poll:
curl 'https://udioapi.pro/api/v2/feed?workId=YOUR_WORK_ID'A successful create response starts work; it does not contain final audio. Poll every 5 to 10 seconds, stop on completed output or a failure field, and cap the total wait time.
The tracked source files use UDIOAPI_KEY, bounded polling, structured errors, and no third-party dependencies. Remove all secrets before publishing a fork on GitHub.
API Endpoints
Use /v2/generate as the default Music Generate endpoint. MiniMax is an integrated provider available through /v2/minimax/generate, not the default music generation model.
Music Generate API
Generate Music
Generate AI music using inspiration mode (text description) or custom mode (lyrics, style, title).
/v2/generateExtend Music
Extend existing music tracks by adding new content. Choose between inheriting original parameters or using custom settings.
/v2/extendMusic Cover Image
Generate AI cover images for your music tracks. 1 credit per generation.
/v2/cover/generateTimestamped Lyrics
Request word-level lyric timings, waveform data, and alignment confidence for a generated audio asset.
/v2/timestamped-lyricsUpload & Cover Audio
Upload your audio file and generate an AI cover version with custom vocals, style, and lyrics.
/v2/upload-cover/generateWAV Conversion
Convert a generated audio result to WAV and track it with your Udio API task ID.
/v2/wav/generateFetch Task Status
Fetch the status and results of a generation task.
/v2/feedQuery Credits
Check your account balance and credit usage in real-time.
/v2/creditsCallback Endpoint
Callback endpoint for receiving generation results.
/generateError handling
Treat the HTTP status and structured response body as part of the integration contract. Log the workId and your own request ID, but never the API key.
400The request is invalid or a required field is missing. Fix the payload; retrying the same body will not help.
401The API key is missing, malformed, expired, or revoked. Verify the Bearer header and rotate exposed credentials.
402The account does not have enough credits. Pause new jobs and direct the account owner to billing.
429The request rate is too high. Respect Retry-After when present and retry with exponential backoff and jitter.
5xxThe service or an upstream dependency failed. Retry only idempotent status reads automatically; use a bounded policy for task creation.
Do not retry moderation failures or other terminal task failures. Surface the returned fail_message or error_message so the user can change the input.
Changelog summary
Compatibility-relevant API changes are summarized in this documentation entry and linked to the affected endpoint.
chirp-v5-5 custom duration support
POST /v2/generate accepts the documented duration range for chirp-v5-5. Existing requests remain compatible when duration is omitted.
Review the generate endpointCredit Consumption by Model
Each AI music model draws a different amount of credits. Use this guide to budget your Music Generate integrations before you make a request.
Music Generate API
chirp-v3-55 creditschirp-v48 creditschirp-v4-510 creditschirp-v4-5-plus10 creditschirp-v512 creditschirp-v5-512 creditsProvider Credit Consumption
minimax-music-2.530 credits