StoryKids AI API
Turn a child's drawings into a personalised picture book. Photograph one to five drawings, confirm the characters the app finds, approve the outline, and get a book written from what you confirmed: checked in code, laid out with the child's own art, with a printable PDF and a read-only share link. No score, grade or ranking, and never a reading of the child. Machine-readable spec: /api/openapi.json.
Authenticate
Create keys on the dashboard under Settings. X-API-Key works too. Starting a story is free; one unit is billed once, after the written book is delivered.
Start a story
curl -H "Authorization: Bearer $STORYKIDS_KEY" -H "Idempotency-Key: $(uuidgen)" \ -F [email protected] -F [email protected] -F consent=true \ -F child_id={reader_id} -F language=en -F theme=friendship -F length=6 \ -F narration="a purple dragon and a blue bicycle" \ https://storykids.sensifai.com/api/v1/stories # 202 {"story_id":"...","job_id":"...","poll":"/api/v1/jobs/..."} curl -H "Authorization: Bearer $STORYKIDS_KEY" https://storykids.sensifai.com/api/v1/jobs/{job_id}
Job states: queued, running, needs_input (no character was found: add one by hand, free), completed, failed, cancelled. A refused photo set and any failure are never charged.
Confirm, outline, write
Characters start as proposed. Confirm, rename, add or reject them with PATCH /stories/{id}/characters (at most four are confirmed), build the outline with POST /stories/{id}/outline and approve it with /outline/approve. POST /stories/{id}/write then writes the pages and is the one billed call; poll the job it returns. Edit a page with PATCH /stories/{id}/pages/{n}, write one again with /regenerate (3 per page, 12 per story), then POST /stories/{id}/approve. Exports and share links use the approved revision only.
Checks
Every revision carries 28 independent checks (checks_passed of checks_total): safety word lists, character ids, page count, readability for the age band (English), the child's words unchanged. A failing hard check blocks approval and is listed in blockers; unsafe model text is replaced by a reviewed template page.
Errors
Problems are RFC 7807 JSON with a stable code: INVALID_INPUT, NEEDS_CONSENT, UNSUPPORTED, QUOTA_EXCEEDED, PROVIDER_UNAVAILABLE, plus NOT_FOUND, NOT_CONFIRMED and CONFLICT. 402 means the prepaid wallet is empty (top_up_url), 403 that there is no active subscription (subscribe_url) or consent.