API reference

Get job

Returns the current status of a job and, once succeeded, its result. Poll until status is succeeded or failed.

Request

GET/api/v1/jobs/{job_id}

Requires Authorization: Bearer sk_live_.... Jobs are only visible to the account that created them. Another account's job_id returns 404.

GET /api/v1/jobs/{job_id}
curl https://www.sleepytale.com/api/v1/jobs/$JOB_ID \
  -H "Authorization: Bearer $SLEEPYTALE_API_KEY"

Path parameters

ParameterTypeDescription
job_idrequiredstringThe job_id returned by a generation request.

Responses

200 returns the job in one of four states: queued, processing, succeeded, or failed.

200 OK: job states
{
  "job_id": "1936f2b0a1c-7e1c2a3b-…",
  "status": "processing",
  "result": null,
  "error": null
}

Poll gently

A few seconds between polls is plenty. Generations take minutes, not milliseconds. Failed jobs never consume credits, so you can safely resubmit.

The result object

Present only when status is succeeded:

ParameterTypeDescription
audio_urlrequiredstring (uri)Public URL of the generated MP3.
lyricsrequiredstringThe sung lyrics (lullaby) or full narrated text (musical).
titlerequiredstringA generated title for the piece.
cover_urloptionalstring (uri) | nullCover image URL when include_image was true, otherwise null.