Integrate OmnAPI Suno song generation with server-side keys, idempotent requests, early playback, terminal task handling, and MP3/WAV export.
Request examples, task handling, and integration notes for developers using OmnAPI.
OmnAPI exposes Suno-compatible song creation at POST /api/v1/suno/songs. Use the Generation view to decide when a clip can play and the Task view for execution and billing. These views answer different questions: one candidate may be playable while the overall task is still processing.
This is an integration guide for OmnAPI's public service, not a claim of an official relationship with Suno. The fields below were checked against the Suno API guide on September 18, 2026.
Create a key in your OmnAPI account and store it on your application server. Use your frontend only to submit an authorized request to that server. Before the first paid call, read the current catalog.
export REQUEST_ID="$(uuidgen)"
curl --fail-with-body https://api.omnapi.com/api/v1/suno/songs \
-H "x-api-key: $OMNAPI_KEY" \
-H "Idempotency-Key: $REQUEST_ID" \
-H "Content-Type: application/json" \
-d '{
"mode":"simple",
"prompt":"upbeat city pop, bright guitars, summer night drive",
"model":"chirp-hawk"
}'
Persist the request ID and exact body together. On an uncertain network response, reuse that pair; do not create a new idempotency key merely because your HTTP client timed out. Save taskId and generationId from the receipt. Prefer: respond-async is available when your client should not wait for the brief initial acknowledgement.
The standard price for chirp-hawk is 28 credits at review time. chirp-goose is 25. Your account pricing and the receipt's creditsRequired determine the charge. A generation request is the billing unit; avoid advertising a fixed price per finished, approved song without accounting for retries and selection.
The integration examples provide downloadable server-side Python and TypeScript programs. Each accepts a persisted request ID, records the receipt, resumes polling from a task ID, and stops on COMPLETED, FAILED, or CANCELLED.
Use a durable job record in a deployed application. A command-line output file illustrates recovery but does not replace a database, user authorization, or concurrent job coordination. If polling reaches its deadline, retain the task ID and resume it. The server-side generation may still be running.
Query GET /api/v1/suno/generations/{generationId} on your server. Select the desired clip from clips[] and require both playable: true and a non-null playback.url.
| Field or state | What it means |
|---|---|
playback.state: "live" |
Audio is still being generated; playback is non-seekable |
playback.state: "final" |
Completed audio supports seeking |
audioUrl: null |
Does not by itself mean the clip cannot play |
Task COMPLETED |
Execution has completed; inspect its output and charge separately |
Resolve a relative playback URL against https://api.omnapi.com. The media request does not need your API key. Pass the temporary URL only to the authorized player, not into analytics or public logs. Refresh the Generation after expiresAt or a playback error; avoid resetting an actively playing audio source on every poll.
No SSE subscription or separate playback-session request is needed for this flow. Respect playback.retryAfterMs, request limits, and user-initiated browser playback requirements. A generated audio candidate still needs listening and content review before publishing.
The export endpoint is POST /api/v1/suno/clips/{clipId}/export. Send format: "mp3", "m4a", or "wav"; it returns a separate task receipt. Reuse the same idempotency key only when retrying that exact export request.
At review time, standard export prices are 2 credits for MP3, 1 for M4A, and 3 for WAV. Exports, stem separation, and other operations are separate from song creation. Read the catalog before you construct a budget. Do not infer permanent file availability from a delivery URL; copy approved outputs to storage you control.
A 401 calls for checking the server key. A validation error calls for correcting the payload. A 429 calls for waiting according to Retry-After. An ambiguous timeout calls for recovering the original operation with its existing idempotency key. A terminal failed task calls for reviewing the public error and settlement before authorizing another creation.
Keep clip IDs, task IDs, Generation IDs, and your own user IDs distinct in storage. Authorize every lookup against your application user. Webhooks must be verified using the documented raw-body signature and processed idempotently.
Continue with the Suno Songs product page, full quickstart, operation guide, or credit pricing.
Build a recoverable music workflow with OmnAPI Producer: choose endpoints, separate lyrics from style, poll tasks, handle credits, and deliver audio to MV.
通过 Producer 产品端点生成封面、歌词和歌曲,理解积分扣费、幂等重试、任务状态以及如何将音频交给 MV。
Understand OmnAPI MV Fast and Studio costs, source validation, subtitles, quote expiry, maxCredits, and final MP4 delivery before creating a paid video.
Build a recoverable music workflow with OmnAPI Producer: choose endpoints, separate lyrics from style, poll tasks, handle credits, and deliver audio to MV.
通过 Producer 产品端点生成封面、歌词和歌曲,理解积分扣费、幂等重试、任务状态以及如何将音频交给 MV。
Understand OmnAPI MV Fast and Studio costs, source validation, subtitles, quote expiry, maxCredits, and final MP4 delivery before creating a paid video.
Generate editable lyrics from themes, moods, and genres with a lightweight API that fits writing, ideation, and song prototyping flows.
Create full songs from prompts with support for lyrics or instrumental workflows, making it easier to ship music generation inside your product.