Sleeper Hit Studio

Sleeper Hit Studio Story API

Agent and developer documentation for turning sources into narrated table reads and story artifacts.

Sleeper Hit Studio — B2B Story API: Agent Documentation

The Story API is the authenticated surface that lets agents and enterprise systems build stories programmatically. Submit sources, get back a source-grounded narrative plan, approve it, run a job, and receive shareable deliverables — starting with live audio table reads, with pitch decks, storyboards, trailers, and production videos coming next.

This directory is the canonical reference for agent and developer integrations.


Mental model

Every integration follows the same loop:

Sources  -->  Plan  -->  Approve  -->  Job  -->  Artifact  -->  (Refine ⟳)  -->  Finalize
(URL/PDF/text)  (async gen)  (human or auto)  (async gen)  (manifest URLs)  (in-place revision)  (durable MP3/MP4)

Every stage is individually pollable, idempotent on re-submission with the same Idempotency-Key, and inspectable after failure. The artifact id and share URLs are stable across refines — embed once, revise as many times as needed.

Key principle: Always fetch GET /api/v1/capabilities at the start of any new run. The manifest lists which artifact types are live (available) versus planned, which source types are accepted, and where the other doc surfaces live. Cache for at most one minute.


What is live today

  • Identity, auth, credits, discovery — fully production-stable.
  • Source ingestion — inline text and markdown (synchronous); URL and PDF (async, polled via pg-boss workers).
  • Source digest — structured LLM digest of each source (summary, thesis, claims, evidence, gaps, rights notes).
  • StoryPlan generation — async plan from sources, with structured Zod-validated output and a deterministic Studio Credit quote. autoApprove skips the human-in-the-loop hold.
  • Story jobs — credit-reserving artifact generation queue against an approved plan.
  • Table read artifact — the first live artifact adapter. Returns three ready-to-open player URLs, plus refine, recast, coverage, adaptive music, sound effects, and finalize capabilities.
  • Refine — POST a free-form instruction to revise the screenplay/cast or re-ground the plan against sources, producing a new revision of the same artifact without changing its id or share URLs. See api-reference.md#post-artifactsartifactidrefine.
  • Recast voice — change one character voice in place without changing the artifact revision or share URLs. See api-reference.md#post-artifactsartifactidvoice.
  • Coverage, music, and sound effects — generate script coverage, add or tune adaptive music, and manage timed SFX cues against the same live table read. See api-reference.md#post-artifactsartifactidsfx.
  • Finalize — Durably render an MP3 from a completed Pipecat/Daily recording (6 credits) or an MP4 (Remotion export, 12 credits) tied to the existing share. See api-reference.md#post-artifactsartifactidfinalize.

What is coming soon

  • Live scrubber on share players — a timeline scrubber on the theater and audio-only players. Currently players start live reads from the beginning.
  • Webhooks — signed delivery of job and artifact lifecycle events. The webhook:write scope exists on keys today; the delivery endpoint is not yet wired.
  • Additional artifact adapters — pitch deck (video + PDF), storyboard image packs, trailers, and production videos.

Pages in this directory

PageWhat it covers
quickstart.mdEnd-to-end walkthrough: API key to playable table read URL, with curl and Node snippets
concepts.mdProjects, sources, plans, jobs, artifacts, credits, share tokens, modes, digest
api-reference.mdEvery endpoint: method, path, scope, request body, response shape, errors
recipes.mdTask-oriented patterns: RSS to podcast, PDF to documentary read, embed the fullscreen theater, refine a read, add music/SFX, trigger the MP4 render
CLI docshttps://docs.sleeperhit.studio/cli and /docs/cli-commands.json
MCP docshttps://docs.sleeperhit.studio/mcp and /docs/mcp-tools.json

Machine-readable discovery surfaces

These are served by the API itself and should be fetched fresh, not copied:

SurfaceURLPurpose
Human docs sitehttps://docs.sleeperhit.studio/Crawlable docs for agents and developers
Agent docs indexhttps://docs.sleeperhit.studio/agent-index.jsonPage, section, operation, CLI, and MCP map
Docs search indexhttps://docs.sleeperhit.studio/docs/search-index.jsonLightweight searchable corpus
CLI command maphttps://docs.sleeperhit.studio/docs/cli-commands.jsonStructured CLI command list
MCP tool maphttps://docs.sleeperhit.studio/docs/mcp-tools.jsonStructured MCP tool/resource list
Capability manifestGET /api/v1/capabilitiesLive feature availability — read this first
OpenAPI 3.1 specGET /api/v1/openapi.jsonFull machine-readable contract, stable operation IDs
Example recipesGET /api/v1/examplescurl + Node snippets for every live flow
Short agent map/llms.txtOne-page map for agents that read llms.txt
Long agent guide/llms-full.txtFull prose integration guide for agents

Authentication quick reference

Keys live at https://sleeperhit.studio/dashboard/api. Every request must carry:

Authorization: Bearer sh_<18-hex-prefix>_<64-hex-secret>

Tokens are shown once at creation and never displayed again. Store in your secret manager.

Default scopes on a new key: story:read, credits:read. To drive the full create-plan-job-artifact loop you need story:write, source:write, and artifact:read added by the account owner. To refine, recast, finalize, render MP4s, music, or sound-effect cues, you also need artifact:publish.

For the full scope table see api-reference.md#authentication-and-scopes.


Pricing note

Studio Credits are the single shared meter. Every plan carries a deterministic quote (line items + total) before any credits are spent. Credits are reserved when a job is created (POST /story-jobs) and settled when artifacts become shareable. If the reservation fails you get 402 insufficient_credits with details.required and details.available so you can surface the shortfall before retrying.

Check balance at any time:

curl -s https://sleeperhit.studio/api/v1/credits \ -H "Authorization: Bearer $SLEEPERHIT_API_KEY"