docs / resources / api-reference

API reference

The whole surface at a glance. Base URL https://api.songapi.dev; every /v1 route takes Authorization: Bearer sk_live_… or sk_test_… (see authentication). Submissions return 202 with a generation object; results arrive by polling or webhook.

## Endpoints

ENDPOINTCREDITSWHAT IT DOES
POST /v1/generate11Full song from a prompt or custom lyrics
POST /v1/extend11Lengthen an existing track from a timestamp
POST /v1/cover11Restyle an existing track into a new genre
POST /v1/add-vocals11Add sung vocals to an instrumental
POST /v1/lyrics1Generate lyrics, no audio
GET /v1/generations/:idFetch one generation (polling)
GET /v1/generationsList generations (limit, offset, status)

Credits are charged on submission and refunded automatically if the job fails. Sandbox keys are never charged. One credit is $0.005 at the base rate — packs from $5.

## Models

Every music endpoint accepts an optional model: v3.5, v4, v4.5, v4.5-plus, v4.5-all, v5 (default), v5.5. Newer models generally produce higher-fidelity audio; all cost the same 11 credits.

## The generation object

FIELDTYPEDESCRIPTION
idstringGeneration id, prefixed gen_.
objectstringAlways "generation".
envstring"live" or "sandbox".
typestring"generate", "extend", "cover", "add_vocals", or "lyrics".
statusstring"queued" → "processing" → "complete" | "failed".
promptstringThe prompt (or lyrics/style) the job was submitted with.
modelstring | nullModel used, e.g. "v5". null for lyrics jobs.
creditsnumberCredits charged (refunded if the job fails).
clipsClip[] | nullOutput variations — two for music jobs, one for lyrics. null until complete.
errorstring | nullFailure reason when status is "failed".
duration_secsnumber | nullDuration of the first clip, in seconds.
audio_urlstring | nullAudio URL of the first clip.
created_atstringISO 8601 submission time.
completed_atstring | nullISO 8601 completion time.

## The clip object

Each entry of clips is one output variation:

FIELDTYPEDESCRIPTION
idstringClip id, prefixed clip_.
audio_urlstring | nullRendered audio for this variation.
image_urlstring | nullCover art, when available.
duration_secsnumber | nullClip length in seconds.
lyricsstring | nullLyrics sung in this clip (or generated lyrics).
tagsstring | nullStyle tags the model applied.
titlestring | nullGenerated track title.

## Errors & limits

Error responses are { "error": "code", "message": "…" } — codes and validation details in errors. Rate limit: 300 requests/minute per key; generation concurrency: 2 in-flight by default (30 / 60 on higher tiers) with overflow queued, never rejected — see rate limits.