Capabilities
Create a lullaby
Generate a fully sung lullaby as an MP3, from prompt to download in four steps.
1. Get an API key
Create a key from your Dashboard. The Free plan includes credits to try the API. Keys look like sk_live_... and are sent as a bearer token on every request.
2. Submit the job
POST /api/v1/lullaby with a prompt describing what the lullaby should be about. A successful submission costs 1 credit (2 with a cover image) and returns 202 Accepted with a job_id:
POST /api/v1/lullaby
curl -X POST https://www.sleepytale.com/api/v1/lullaby \
-H "Authorization: Bearer $SLEEPYTALE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a sleepy little fox curling up under the stars"}'202 Accepted
{
"job_id": "1936f2b0a1c-7e1c2a3b-…",
"status": "queued"
}3. Poll for the result
Poll GET /api/v1/jobs/{job_id} every few seconds until status is succeeded or failed.
GET /api/v1/jobs/{job_id}
curl https://www.sleepytale.com/api/v1/jobs/$JOB_ID \
-H "Authorization: Bearer $SLEEPYTALE_API_KEY"Job states
{
"job_id": "1936f2b0a1c-7e1c2a3b-…",
"status": "processing",
"result": null,
"error": null
}4. Download the audio
Once the job succeeds, result.audio_url is a public URL of the finished MP3, result.lyrics holds the sung lyrics, and result.title is a generated title. Here's the kind of audio you'll get:
Lullaby sample
Options
- Cover art. Set
include_image: trueto also generate AI cover art (+1 credit).result.cover_urlis then a public image URL instead ofnull. Add an optionalstylestring (e.g."watercolor") to steer the art style. It only affects the image, never the audio. - Idempotency. Send an
Idempotency-Keyheader to make retries safe: replaying the same key returns the same job instead of creating (and charging for) a new one.
Charged on success only
If a job fails, no credits are consumed, so resubmit freely.
Prompt tips
- Name a character and a setting: “a sleepy little fox curling up under the stars” beats “a nice song”.
- Set the mood you want (calm, dreamy, cozy) and the lullaby will follow it.
- Keep prompts under 2,000 characters; a sentence or two is usually plenty.
- Prompts are content-checked for child-appropriateness. Rejected prompts return
400(content_rejected) and cost nothing.