Get a job

GEThttps://api.mozartai.com/v1/jobs/{job_id}

Gets the current state of one job at once, without waiting: status, outputs, credits charged and any error.

Cost
Free
Rate limit
Read
CLI (coming soon)
mozart jobs get

When to use: You have a job id and want its state right now. If status is queued or running, call again after poll_after_seconds.

When not to use: To wait for a job to finish, or to check several jobs in one call, use POST /v1/jobs/wait.

Side effects: None. Reads only; safe to repeat as often as you need.

Authentication

Send your API key as Authorization: Bearer <key>. The key needs these scopes:

  • library:read

Path parameters

  • job_idstringRequired

Response 200

Success.

  • idstringRequired
  • objectconstantRequired
  • kindenumRequired
    Show 9 values
    • song
    • cover
    • inpaint
    • stem
    • stems
    • midi
    • master
    • cover_art
    • persona
  • statusenumRequired
    Allowed values
    • queued
    • running
    • succeeded
    • failed
    • cancelled
  • playablebooleanRequired
  • project_idstringor nullRequired
  • song_idslist of stringRequired
  • outputslist of objectRequired
    Show 8 properties
    • typeenumRequired
      Allowed values
      • audio
      • stem
      • midi
      • image
      • persona
    • song_idstringor nullRequired
    • persona_idstringor nullRequired
    • labelstringor nullRequired
    • urlstringor nullRequired
    • url_expires_atstringor nullRequired
    • content_typestringor nullRequired
    • duration_secondsnumberor nullRequired
  • credits_chargednumberor nullRequired

    null while the job is pending; the settled ledger debit once it finishes; 0 for free operations, test keys and released or refunded holds

  • credits_refundedbooleanRequired
  • errorobjector nullRequired
    Show 3 properties
    • codestringRequired
    • messagestringRequired
    • next_stepstringor nullRequired
  • poll_after_secondsnumberor nullRequired
  • created_atstringRequired
  • completed_atstringor nullRequired

Response headers

  • x-request-idThe id of this request; quote it when asking for help.
  • x-mozart-api-versionThe API version that answered.
  • x-ratelimit-limitRequests allowed in the current window for this caller.
  • x-ratelimit-remainingRequests left in the current window.
  • x-ratelimit-resetWhen the window resets, in Unix seconds.
  • idempotent-replayedtrue when this answer is the stored answer to an earlier call with the same idempotency key; the work was not done again.

Errors

What to do: PUBLIC_API_RESOURCE_NOT_FOUND: the id is wrong or not yours; list to find it. PUBLIC_API_RATE_LIMITED: wait retry_after_seconds, then call again.

StatusTypeMeaning
400invalid_requestThe request is malformed or an input is invalid.
401authenticationThe key or token is missing, invalid or revoked.
402insufficient_creditsThe account has too few credits for this call. A REST key also needs an API plan (Starter, Build, Scale or Growth) or API credits; with neither, every call is refused with PUBLIC_API_CREDITS_REQUIRED. payment_required: The account's plan does not include this; it needs an upgrade.
403permissionThe caller may not do this: a missing scope, a Mozart CLI sign-in whose account is below Pro, or access not enabled.
404not_foundThe resource or route does not exist for this caller.
409conflictThe request conflicts with the current state, or an idempotency key was reused with a different body.
422content_refusedThe input was refused by content screening.
429rate_limitedToo many requests; retry after Retry-After seconds. limit_reached: A daily, concurrent or total limit was reached.
500internalMozart failed to answer; retry later.
503provider_unavailableA generation provider is unavailable; retry later. service_unavailable: A Mozart check the request needs, such as content screening, is temporarily unavailable; retry after retry_after_seconds.