Music

Cancel a music generation

Requests cancellation and returns the job. A job still pending (waiting to start, or to retry) moves to cancelled shortly after and its reserved credits are returned. The provider renders a song in one call that cannot be interrupted and is billed once it starts, so a running job cannot be cancelled: the request is refused with a 409 (not_cancellable), and the job runs to its end, charged if the song is produced. A finished job is returned unchanged.

post/api/v1/music-generations/{id}/cancel

Request

  • Base URL: https://your-deployment.example.com
  • URL: https://your-deployment.example.com/api/v1/music-generations/{id}/cancel
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Path parameters

idstring required

Response

The job after the cancel request.

idstring required
object'music_generation' required
state'pending' | 'running' | 'storing' | 'succeeded' | 'failed' | 'blocked' | 'cancelled' required
modelstring required
promptstring required
lyricsstring nullable required

The lyrics you sent, or null.

instrumentalboolean required
duration_secondsnumber required

The length requested (the model default when omitted).

source'api' | 'studio' | 'agent' required
created_atstring required
updated_atstring required

Example response

{
  "id": "664f1c2b9a1e4d0012ab34cd",
  "object": "music_generation",
  "state": "pending",
  "model": "lyria-3.5",
  "prompt": "An upbeat synth-pop song about a road trip at sunrise",
  "lyrics": null,
  "instrumental": false,
  "duration_seconds": 120,
  "source": "api",
  "error": null,
  "output": null,
  "credits": {
    "reserved": 160,
    "settled": null
  },
  "created_at": "2026-10-14T00:00:00.000Z",
  "updated_at": "2026-10-14T00:00:00.000Z"
}

Changes

No recorded changes to this operation across all 3 revisions of this API.