Skip to content

OmnAPI Quickstart

This page walks you from zero to a finished song. The create endpoints follow the same contract: send a JSON body, receive a task descriptor, then poll GET /api/v1/tasks/{taskId} until status is terminal.

Sign in to the OmnAPI dashboard, go to Settings → API Keys, and create one. Store it as OMNAPI_KEY in your environment or secret manager; do not hard-code API keys in source files.

Terminal window
export OMNAPI_KEY="sk_live_..."

See Authentication for rotation and security details.


The simplest POST in the catalog — one required field.

Terminal window
curl -X POST https://api.omnapi.com/api/v1/producer/generate/image \
-H "x-api-key: $OMNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "synthwave album cover, neon palms, retro grid horizon"
}'

Response — note the taskId and the required credit count:

{
"taskId": "task_01H...",
"status": "PENDING",
"creditsRequired": 8,
"createdAt": "2026-05-23T10:00:00Z"
}

Terminal window
curl -X POST https://api.omnapi.com/api/v1/producer/generate/lyrics \
-H "x-api-key: $OMNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Bittersweet pop song about leaving a coastal town at dawn. English."
}'

The prompt field accepts up to 3000 characters. The task returns lyrics with structure tags ([Verse], [Chorus], [Bridge]) that can be passed into music compose.


The only required field is soundPrompt — the sonic description. Everything else is optional but useful. When instrumental is omitted or false and you do not provide lyrics, OmnAPI can generate lyrics first so the final song includes a vocal-ready lyric plan.

Terminal window
curl -X POST https://api.omnapi.com/api/v1/producer/generate/music/compose \
-H "x-api-key: $OMNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"soundPrompt": "lofi jazz, rainy night, soft piano"
}'

Field cheat sheet (full reference: Producer API):

FieldRequiredLimitNotes
soundPrompt≤ 500 charsThe sonic description
lyrics≤ 3000 charsUse structure tags from the lyrics endpoint
instrumentalboolDefault false
bpm1–300Tempo hint
length1–600 secTarget duration
title≤ 200 charsCosmetic
seed≥ 0Reproducibility

The same task polling endpoint works for image, lyrics, and music tasks — they all share one task model.

Terminal window
curl https://api.omnapi.com/api/v1/tasks/$TASK_ID \
-H "x-api-key: $OMNAPI_KEY"

Status progresses PENDING → PROCESSING → COMPLETED (or FAILED / CANCELLED). Poll with exponential backoff — see The Task Model for the exact schedule, why aggressive polling is discouraged, and how to read the result.

When status: "COMPLETED", you’ll get:

{
"taskId": "task_01H...",
"status": "COMPLETED",
"creditsRequired": 28,
"creditsCharged": 28,
"resources": [
{ "type": "audio", "url": "https://cdn.omnapi.com/..." }
],
"outputResults": { /* endpoint-specific details */ }
}

creditsCharged may be lower than creditsRequired for partial-billing scenarios (see Credits & Billing). On most FAILED tasks, eligible credits are refunded automatically; partial-output cases may keep a smaller final charge.

  • The Task Model — the shared contract: lifecycle, config, polling, sync/async
  • Producer API — every field of every endpoint explained
  • Errors — error code reference + retry guidance