API Reference
Generate AI videos programmatically. Submit a prompt, poll for completion, and receive a direct video URL — all via REST.
Base URL: https://yoh.appCode examples will use the placeholder sk_live_YOUR_API_KEY until you sign in.
Quick Start
Create your first video in three API calls: generate → poll → download.
curl -X POST https://yoh.app/api/v1/stories/generate \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "prompt": "A dragon teaches a young knight how to fly", "aspectRatio": "16:9" }'{
"jobId": "cmnk8wu2q0001q3vpmqv93nmy",
"status": "queued",
"pollUrl": "/api/v1/stories/jobs/cmnk8wu2q0001q3vpmqv93nmy"
}curl https://yoh.app/api/v1/stories/jobs/cmnk8wu2q0001q3vpmqv93nmy \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"{
"status": "completed", "progress": 100,
"storyId": "cmnk8xxnx000004lbd7siief7",
"videoUrl": "https://cdn.example.com/video/clip.mp4",
"error": null
}That's it. The videoUrl is a publicly accessible URL you can download, stream, or share immediately.
Authentication
All API requests must include your API key in the Authorization header using the Bearer scheme.
Authorization: Bearer sk_live_YOUR_API_KEYAPI keys begin with sk_live_. You can create and manage keys from the API Keys page. /api-keys
Keep your API keys secret. Do not expose them in client-side code or public repositories. If a key is compromised, revoke it immediately from the API Keys page.
Scopes & Credits
Each API key is granted one or more scopes that control which endpoints it can access. Story text generation costs 55 credits per job; scopes that also produce clip videos or a final render (including the default scope, full) charge for those up front on top. Credits are refunded if the job fails after all retries.
| Scope | Grants access to |
|---|---|
| stories:generate | POST /api/v1/stories/generate, POST /stories/:id/assets, POST /stories/:id/storyboard, POST /stories/:id/videos, POST /stories/:id/render, POST /stories/:id/clips/:clipId/image, POST /stories/:id/clips/:clipId/video — the clip edits: POST/PATCH /stories/:id/clips, PATCH/DELETE /stories/:id/clips/:clipId — and the story-asset edits: PATCH /stories/:id/characters|scenes|items/:assetId. Also implies assets:write and series:write, so keys issued before those scopes existed keep working. |
| stories:read | GET /api/v1/stories, GET /api/v1/stories/:id, GET /api/v1/stories/jobs/:id, GET /api/v1/credits, POST /api/v1/stories/estimate, POST /api/v1/stories/analyze-prompt. Implies series:read and assets:read. |
| assets:read | GET .../characters, .../scenes, .../items, .../clips, GET /api/v1/series/:id/assets |
| assets:write | POST /api/v1/series/:id/assets, PATCH/DELETE /api/v1/series/:id/assets/:assetId, POST /api/v1/uploads |
| series:read | GET /api/v1/series, GET /api/v1/series/:id |
| series:write | POST /api/v1/series, PATCH /api/v1/series/:id |
| social:publish | POST /api/v1/social/publish, GET /api/v1/social/publish/:postId |
| accounts:manage | GET/POST /api/v1/accounts, GET/POST /api/v1/accounts/:accountId/credits. For platforms that serve many customers: provision an account per customer and fund it from your own balance. Implied by nothing — an existing key never gains it. |
Generate a Video
Enqueue a video generation job
/api/v1/stories/generatescope: stories:generateSubmits a prompt and returns a jobId immediately. The video is generated asynchronously. Poll GET /api/v1/stories/jobs/:jobId to track progress.
Request body
| Field | Type | Status | Description |
|---|---|---|---|
prompt | string | required | Story description, max 5000 characters. |
aspectRatio | string | optional | One of 16:9, 9:16, 1:1, 21:9. Default: 16:9. |
renderVideo | boolean | optional | false — returns the first AI clip (fast, ~10 min). true — renders all clips into one composed MP4 via Remotion (~12–15 min). |
scope | string | optional | story (text only, recommended), assets (+ character/scene/item images), storyboard (+ per-clip images), videos (+ clip videos), render (+ final MP4), or full (all phases). Default: full — which charges video + render credits up front. An unrecognized value falls back to full. |
title | string | optional | Display name for the story. |
contentType | string | optional | Story format category. One of cinematic_story, news_analysis, persona_channel, ad_spot. Default: cinematic_story. |
locale | string | optional | Language code, e.g. en, zh-TW. Default: en. |
seriesId | string | optional | Attach to an existing series for consistent character visuals. |
assets | array | optional | The cast and props for this story — reference assets already in your series library, or attach one-off assets inline. See the table below. |
continuityMode | string | optional | With a seriesId: how much of the previous episodes this one carries. episodic_continuous (default) picks up open threads, finale resolves them, one_off_episode keeps series plot out entirely. |
isFinale | boolean | optional | Implied by continuityMode: "finale"; you rarely need both. |
allowMultiStory | boolean | optional | Let one request split into several episodes when the prompt clearly carries more than one. Default false — N episodes means N charges, so it is opt-in. |
seriesContinuityContext | object | optional | Escape hatch. Supplying it replaces the continuity we assemble from your series (open threads plus the last three episode recaps), so an incomplete object produces a weaker episode than sending nothing. Prefer continuityMode. |
assets[] optional
This array ATTACHES assets to one generation — it is not where an asset is defined. It carries only what is read inline; the full asset shape (character type and role, voice, scene lighting and mood, item material and condition) lives in the series library, which accepts all of it and which the pipeline reads directly. Reference the library by id rather than restating an asset here. Each entry either references an asset in your series library by seriesAssetId (upload it once via POST /api/v1/series/:seriesId/assets and reuse it forever), or defines a one-off asset inline with type + name. The two forms mix freely in one array. Whatever you attach is described to the writer, and its image is reused instead of a new one being generated — so a character keeps their face and a product keeps its packaging.
| Field | Type | Description |
|---|---|---|
seriesAssetId | string | Reference an existing library asset. Everything else is optional when this is set. |
type | string | character · scene · item · reference. Required for an inline asset. |
name | string | Required for an inline asset. Also how the writer refers to it — name it in your prompt for it to appear. |
description | string | Overrides the library description for this story only. |
imageUrl | string | Image for an inline asset. Re-hosted on our storage. |
itemType | string | Items only: prop · product · logo. A logo is composited flat, never given 3D depth. |
isHeroProduct | boolean | ad_spot: the advertised product — appears in every clip. Fills heroItemId for you. |
isPrimaryBackground | boolean | news_analysis / persona_channel: the set reused across every shot. Fills primaryBackgroundAssetId for you. |
useAsReferenceFrame | boolean | Use this image as the first frame / reference for image-to-video on clips featuring the asset. |
gender | string | Characters only: surfaced to the writer. |
age | string | Characters only: surfaced to the writer. |
personalityTraits | string[] | Characters only: surfaced to the writer. |
timeOfDay | string | Scenes only, e.g. dusk. |
weather | string | Scenes only, e.g. rain. |
persist | boolean | Accrue an inline asset into the series library so later stories can reference it by id. Default false. |
Characters, scenes and items only enter the story when the prompt names them — attaching a whole series library does not drag its entire cast into every episode. The two pin flags are the exception: a pinned hero product or primary background is guaranteed regardless of whether the script says its name.
globalConfig optional
Optional nested object controlling duration, output format, and model selection. Every field has a default; pass only what you want to override. The model fields (videoModel, imageModel, modelStrategy) may also be passed at the top level as a convenience. Unknown model ids degrade to auto rather than failing the request.
This is a superset of the studio's own controls, not a mirror of them. resolution, qualityTier, modelStrategy and seed are API-only — the studio expresses the same choices through its quality picker. Two fields are advisory: they are shown to the writer as context but nothing enforces them, and they are marked below.
| Field | Type | Values | Default |
|---|---|---|---|
durationSec | number | 15–300 (total seconds) | 60 |
aspectRatio | string | 16:9 · 9:16 · 1:1 · 21:9 | 16:9 |
resolution | string | 480p · 720p · 1080p | 720p |
pace | string | slow · normal · fast | normal |
structure | string | auto · 3_act · 4_act · montage | auto |
qualityTier | string | draft · balanced · premium (premium selects the advanced model lane) | balanced |
stylePreset | string | preset slug, or auto | auto |
platformTarget | string | ADVISORY — shown to the writer as context; nothing enforces it. youtube · tiktok · instagram · x | youtube |
safetyMode | string | ADVISORY — shown to the writer as context; not a content filter. standard · strict | standard |
seed | string | any string — shared across clips for continuity (API-only) | — |
videoModel | string | a model id, or auto | auto |
imageModel | string | a model id, or auto | auto |
modelStrategy | string | auto · fixed · cost_optimized · quality_first · hero_premium | auto |
generationMode | string | DEPRECATED — ignored. Every clip uses unified reference mode. | auto |
locale | string | en · zh-TW · ja · ko · th · id (also accepted top-level) | en |
contentTypeConfig optional
Optional per-contentType creative controls. Fields are validated against the selected content type; omitted fields fall back to sensible defaults. Pass the object matching your contentType. The two pin ids below are usually easier to set as isHeroProduct / isPrimaryBackground on an assets[] entry — an id you write here wins if you send both.
| contentType | Fields |
|---|---|
| cinematic_story | (no per-type fields — format craft is built in) |
| news_analysis | primaryBackgroundAssetId, primaryBackgroundName (pin a studio scene across anchor shots) |
| persona_channel | primaryBackgroundAssetId, primaryBackgroundName (pin the persona's set) |
| ad_spot | heroItemId, heroProductName, heroTagline, heroKeyBenefit (the advertised product) |
Other optional fields
| Field | Type | Description |
|---|---|---|
storyQualityConfig | object | { enableStyleAdaptedCharacters?: boolean, directClipImageGeneration?: boolean } — quality-rollout toggles. Omit to use pipeline defaults. |
style | object | Style-consistency overrides: cinematicStyle, era, colorPalette, lightingStyle, filmGrain, lensCharacter, materialEmphasis, styleCategory, negativeHints, stylePreset. |
seriesContinuityContext | object | Series continuity context for episodic generation. Used together with seriesId. |
Fields that aren't part of the selected contentType's schema are silently ignored — cinematic_story takes no per-type fields at all, so pass contentTypeConfig only for ad_spot, news_analysis, or persona_channel.
curl -X POST $BASE/api/v1/stories/generate \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A 30s spot for a titanium water bottle that keeps ice for 24h",
"contentType": "ad_spot",
"scope": "full",
"renderVideo": true,
"globalConfig": {
"durationSec": 30,
"resolution": "1080p",
"modelStrategy": "hero_premium"
},
"contentTypeConfig": {
"heroProductName": "Northpeak Flask",
"heroTagline": "Ice, 24 hours later.",
"heroKeyBenefit": "Vacuum-sealed titanium keeps ice frozen for a full day"
}
}'Response 202 Accepted
{ "jobId": "cmnk8wu2q0001q3vpmqv93nmy", "status": "queued", "pollUrl": "/api/v1/stories/jobs/..." }Step-by-Step Endpoints
After generating a story with scope: "story", use these endpoints to generate storyboard images, clip videos, and the final rendered MP4 as separate steps.
/api/v1/stories/:storyId/assetsGenerate the cast and world: character portraits + 2×2 character sheets, plus scene and item images. Run this before /storyboard for the best face consistency. Skips assets that already have images.
/api/v1/stories/:storyId/storyboardGenerate storyboard grid images for all clips. Skips clips that already have images.
/api/v1/stories/:storyId/videosGenerate video for each clip. Skips clips that already have a video URL.
/api/v1/stories/:storyId/renderStitch all clip videos + music + captions into a final MP4.
One Clip at a Time
The batch endpoints above only fill in what's missing — /storyboard skips clips that already have an image and /videos skips clips that already have a video. To re-roll a shot you don't like, target it directly. These are the same operations as the editor's per-clip regenerate buttons, and they overwrite whatever that clip already has.
/api/v1/stories/:storyId/clips/:clipId/image(Re)generate the storyboard image for ONE clip. Optional body: prompt (art direction for this shot) and imageModel.
/api/v1/stories/:storyId/clips/:clipId/video(Re)generate the video for ONE clip. Optional body: videoModel. There is no mode to pick — every clip is produced in the single unified reference mode, where a multi-reference model receives one categorized bundle: the storyboard sketch and clip image, character sheets, item, background and style images, the previous clip's tail as a video reference, and the character's voice sample as an audio reference.
estimatedCredits) | Scope: stories:generate# Regenerate clip 3's image, then its video — the rest of the story is untouched
curl -X POST $BASE/api/v1/stories/STORY_ID/clips/CLIP_ID/image \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"
# Poll jobId until completed
curl -X POST $BASE/api/v1/stories/STORY_ID/clips/CLIP_ID/video \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"videoModel":"bytedance/seedance-2.0"}'
# Poll jobId until completed → the clip's videoUrl is replacedEditing the Story
Direct the story instead of only re-rolling it: rewrite a shot, retime it, add a beat, reorder, or cut one. These are immediate (no job to poll) and cost no credits. A clip's description is the prompt the generation pipelines read — edit it, then call that clip's /image or /video to re-shoot it with the new direction.
/api/v1/stories/:storyId/clips/:clipIdEdit a clip. Send only what you want to change: title, description, duration, generationDuration, resolution, transitionStyle, sceneId, characterIds, itemIds, dialogue, audioFx.
Media columns (imageUrl, videoUrl, generation history) are deliberately not writable — those belong to the pipelines. Use the clip's /image and /video endpoints to change them.
/api/v1/stories/:storyId/clipsInsert a clip. title and description required; place it with afterClipId or beforeClipId (omit both to append). Following clips shift down automatically. The new clip has no image or video yet.
/api/v1/stories/:storyId/clipsReorder. Body: { "clips": [{ "id": "...", "order": 0 }, …] } — send every clip with a contiguous 0-based order.
/api/v1/stories/:storyId/clips/:clipIdCut a clip; the remaining orders close up. A story must keep at least one clip.
# 1. Rewrite the direction + retime the shot (immediate, free)
curl -X PATCH $BASE/api/v1/stories/STORY_ID/clips/CLIP_ID \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "The keeper climbs the stairs as the lamp flickers behind him.",
"duration": 7
}'
# 2. Re-shoot it with the new direction
curl -X POST $BASE/api/v1/stories/STORY_ID/clips/CLIP_ID/image \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"
curl -X POST $BASE/api/v1/stories/STORY_ID/clips/CLIP_ID/video \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"# Step 1: Generate story text (~1-2 min)
curl -X POST $BASE/api/v1/stories/generate \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"A samurai cat guards a cherry blossom tree","contentType":"cinematic_story","scope":"story"}'
# Poll jobId until completed → get storyId
# Step 2: Generate storyboard images (~3-5 min)
curl -X POST $BASE/api/v1/stories/STORY_ID/storyboard \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"
# Poll until completed
# Step 3: Generate clip videos (~1-3 min per clip)
curl -X POST $BASE/api/v1/stories/STORY_ID/videos \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"
# Poll until completed
# Step 4: Render final MP4 (~1-2 min)
curl -X POST $BASE/api/v1/stories/STORY_ID/render \
-H "Authorization: Bearer sk_live_YOUR_API_KEY"
# Poll until completed → videoUrlPoll Job Status
Get job status
/api/v1/stories/jobs/:jobIdscope: stories:readPoll this endpoint after calling POST /api/v1/stories/generate. The job typically takes 8–15 minutes depending on story length and whether renderVideo is enabled. Recommend polling every 15–30 seconds.
Job status lifecycle
queuedgenerating_storygenerating_assetsgenerating_videosrendering_videocompletedorfailedWhich statuses you see depends on the scope you requested — a story job goes straight from generating_story to completed. A transient failure sends the job back to queued with error set to a retry message; that is not terminal, so treat only completed and failed as final states.
Response fields
| Field | Type | Description |
|---|---|---|
jobId | string | Unique job identifier. |
status | string | Current status. See lifecycle above. |
progress | number | 0–100 integer indicating completion percentage. |
storyId | string|null | Set once story generation completes. Use to fetch assets. |
renderVideo | boolean | Whether a composed final MP4 was requested. |
videoUrl | string|null | Absolute video URL when status is completed. Either a composed MP4 (renderVideo: true) or the first clip's AI video (renderVideo: false). |
error | string|null | Human-readable error message. Set on failure — and also while a job is being retried, where status returns to queued. Always null on success. |
createdAt / startedAt / completedAt | string (ISO) | Timestamps. |
Stories
List stories
/api/v1/storiesscope: stories:readReturns a paginated list of your stories.
Query parameters
| Param | Default | Description |
|---|---|---|
page | 1 | Page number (≥ 1). |
limit | 20 | Results per page (1–100). Capped at 100. |
status | — | Filter by story status. |
This is the only endpoint that returns a pagination envelope alongside data:
{
"data": [ { "id": "cmnk9cibl0004q3vpijkqfwl4", "title": "...", "status": "completed" } ],
"pagination": { "page": 1, "limit": 20, "total": 137 }
}Get a story
/api/v1/stories/:storyIdscope: stories:readReturns full metadata for a single story including counts of its characters, scenes, items, and clips.
{
"id": "cmnk9cibl0004q3vpijkqfwl4",
"title": "A robot chef cooks in a futuristic kitchen",
"status": "completed", "aspectRatio": "9:16", "locale": "en",
"counts": { "characters": 3, "scenes": 4, "items": 6, "clips": 6 },
"createdAt": "2026-04-04T11:37:04.662Z"
}Assets overview
After a job completes you can fetch all assets generated for the story using the storyId returned by the job. All asset endpoints require the assets:read scope.
GET /api/v1/stories/:id/charactersCharacters — name, description, role, imageUrl, voice info
GET /api/v1/stories/:id/scenesScenes — description, timeOfDay, weather, lighting, imageUrl
GET /api/v1/stories/:id/itemsProps / items — description, significance, imageUrl
GET /api/v1/stories/:id/clipsClips — narration, duration, videoUrl, imageUrl, audioUrl
Characters
List characters
/api/v1/stories/:storyId/charactersscope: assets:read{
"data": [{
"id": "char_abc123", "name": "Chef Axon", "role": "protagonist",
"description": "A robot chef with a warm personality",
"imageUrl": "https://cdn.example.com/characters/chef-axon.jpg",
"voiceName": "Neutral-EN", "order": 0
}]
}Clips & Videos
List clips
/api/v1/stories/:storyId/clipsscope: assets:readEach clip is a scene segment with its own AI-generated video, still image, and audio. All URL fields are absolute and publicly accessible.
{
"data": [{
"id": "clip_001", "order": 0, "narration": "In the year 2157...",
"duration": 8,
"videoUrl": "https://cdn.example.com/generated/video/clip1.mp4",
"imageUrl": "https://cdn.example.com/generated/image/clip1.jpg",
"audioUrl": null, "status": "completed"
}]
}When renderVideo is false, the job's videoUrl points to the first clip's video. Use this endpoint to get the video URL for every individual clip.
Series Asset Library
Upload an asset once, reference it forever
/api/v1/series/:seriesId/assetsscope: assets:writeThe same library the studio asset panel writes to. Upload a character, background, item or style reference, keep the returned id, and reference it at generation time by passing that id as seriesAssetId in the assets array — no need to mint a fresh image link per video. Images you pass are re-hosted on our storage, so the id keeps working after your own upload URL expires.
| Field | Type | Description |
|---|---|---|
type | string | character, scene, item, or reference. |
name | string | Display name. Also the key that later generations match against. |
imageUrl | string | Public URL of the image. Alternatively send imageBase64. |
itemType | string | Items only: prop, product, or logo. A logo is composited flat, never given 3D depth. |
isHeroProduct | boolean | Items only: the product this ad is about. It appears in every clip. |
isPrimaryBackground | boolean | Scenes only: the studio/set reused across every anchor shot. |
- Send one asset, or an "assets" array to upsert up to 100 at once.
- By default assets merge on an exact name match, so re-uploading the same catalog is idempotent. Pass ?mergeStrategy=fuzzy for rename-tolerant matching, or insert to always create a new asset.
- Set isHeroProduct on an item (ad_spot) or isPrimaryBackground on a scene (news_analysis / persona_channel) to pin it. At generation time the pin resolves automatically — you never write heroItemId by hand.
| Scope | Grants access to |
|---|---|
GET | /api/v1/series |
POST | /api/v1/series |
GET | /api/v1/series/:seriesId |
PATCH | /api/v1/series/:seriesId |
GET | /api/v1/series/:seriesId/assets?type=character |
POST | /api/v1/series/:seriesId/assets |
PATCH | /api/v1/series/:seriesId/assets/:assetId |
DELETE | /api/v1/series/:seriesId/assets/:assetId |
POST | /api/v1/uploads |
PATCH | /api/v1/stories/:storyId/characters/:assetId |
PATCH | /api/v1/stories/:storyId/scenes/:assetId |
PATCH | /api/v1/stories/:storyId/items/:assetId |
POST | /api/v1/stories/estimate |
GET | /api/v1/credits |
End to end — put a brand's logo in an ad, and keep the id for every ad after it:
curl -X POST https://yoh.app/api/v1/series \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Acme brand films","styleGuide":{"cinematicStyle":"clean product cinematography"}}'
# → { "series": { "id": "series_abc", ... } }curl -X POST https://yoh.app/api/v1/series/series_abc/assets \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "item",
"name": "Acme Logo",
"itemType": "logo",
"description": "Wordmark, orange on white",
"imageUrl": "https://your-admin.example.com/tmp/logo.png"
}'
# → { "asset": { "id": "series-item-...", "imageUrl": "https://...blob..." } }
# That imageUrl is ours now — your temporary link can expire.curl -X POST https://yoh.app/api/v1/stories/generate \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A 30-second spot for the Acme cordless drill",
"contentType": "ad_spot",
"seriesId": "series_abc",
"assets": [
{ "seriesAssetId": "series-item-...", "isHeroProduct": true }
]
}'
# → { "jobId": "...", "pollUrl": "/api/v1/stories/jobs/..." }Step 2 happens once per asset, not once per video. Step 3 repeats forever with the same id — and because the asset is pinned, the logo is guaranteed in every clip even if the script never says its name. To check the cost before committing, POST the same body to /api/v1/stories/estimate.
Series Assets
Register a character image for a series
/api/v1/series-assets/ensure-character-imagescope: assets:writePOST /api/v1/series-assets/ensure-character-image still works and is unchanged, but it only handles characters. Prefer this endpoint.
Uploads and persists a character reference image for a series so the AI uses a consistent face/look across all stories in that series. This operation is idempotent — calling it multiple times with the same character name is safe.
| Field | Type | Description |
|---|---|---|
seriesId | string | ID of the series to attach the character to. |
characterName | string | The character's name (used as a unique key within the series). |
imageUrl | string | Publicly accessible URL of the character reference image. |
Managed Accounts
For platforms that serve many customers. Instead of one key and one credit pool for everybody — where one busy customer drains the balance for the rest and nobody can tell who spent what — provision an account per customer and fund each from your own balance. Your customers never sign up here or pay us; the commercial relationship stays yours.
Provision an account
/api/v1/accountsscope: accounts:manageexternalId is your own id for the customer. Calling twice with the same one returns the existing account instead of creating a second, so a retried request is safe. The API key comes back once, on first creation — we store a hash and cannot show it again, so persist it when you receive it. A new account starts at a zero balance.
| Field | Type | Description |
|---|---|---|
externalId | string | Required. Your id for this customer — a tenant id, say. Unique per platform. |
name | string | Optional label, for your own reporting. |
Fund an account
/api/v1/accounts/:accountId/creditsscope: accounts:manageMoves credits from your balance into the account's — a transfer, not a grant, so you can only hand out what you actually bought. Returns 402 when your own balance cannot cover it.:accountId accepts either our account id or your externalId.
| Field | Type | Description |
|---|---|---|
amount | integer | Required. Credits to move. Must be positive. |
idempotencyKey | string | Pass your invoice or subscription-period id. A retried or redelivered call then returns the original transfer instead of funding the account twice. |
description | string | Optional note, shown on both sides of the transfer in the credit history. |
GET /api/v1/accounts lists your accounts with each balance and lifetime spend; GET /api/v1/accounts/:accountId/credits reads one. A managed account's own key carries generation scopes only — it can never provision or fund accounts itself.
Manage API Keys
API key management endpoints use session authentication (logged-in user cookie), not an API key. Use the API Keys page for a browser-based workflow, or call these endpoints programmatically from your backend with a valid session. /api-keys
List API keys
/api/v1/api-keysscope: session{
"data": [{
"id": "key_abc123", "name": "Production",
"keyPrefix": "sk_live_7WH3",
"scopes": ["stories:generate", "stories:read", "assets:read"],
"revokedAt": null, "createdAt": "2026-04-03T10:00:00.000Z"
}]
}Create an API key
/api/v1/api-keysscope: session// Response — full key shown once
{
"id": "key_abc123",
"key": "sk_live_...",
"name": "My integration",
"keyPrefix": "sk_live_7WH3",
"scopes": ["stories:generate", "stories:read", "assets:read"]
}Revoke an API key
/api/v1/api-keys/:idscope: session{ "id": "key_abc123", "revoked": true }Errors
All errors return a consistent JSON shape with an error object containing a machine-readable code.
{ "error": { "code": "insufficient_credits", "message": "...", "status": 402 } }| HTTP | code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key. |
| 403 | forbidden | API key does not have the required scope. |
| 404 | not_found | The requested resource does not exist. |
| 400 | bad_request | Invalid request body or parameters. |
| 402 | insufficient_credits | Not enough credits to perform the operation. |
| 429 | rate_limited | Too many requests. Check the Retry-After header. |
| 500 | internal_error | Unexpected server error. |
Rate limits: Generation endpoints allow 5 requests per minute per API key. Reads and clip edits (which spend no credits) allow 60. When you hit a limit, the response includes a Retry-After header with the number of seconds to wait. Failed jobs (after all retries) automatically refund the credits that were deducted.
Publish to Social
Push a finished video straight to a connected account, so an automation can drive generate → render → publish with one credential. Connect the accounts in the app first; this endpoint publishes to them.
Publish a video
/api/v1/social/publishscope: social:publishReturns
202with{ postId, status: "publishing" }and uploads in the background — poll the status endpoint below. Passwait: trueto block until the upload finishes instead (can take minutes).socialAccountIdstringstoryIdstringvideoUrlstringplatformstringcaptionstringyoutubeobjectdurationSecnumberaspectRatiostringfileSizeBytesnumberwaitbooleanPoll publish status
/api/v1/social/publish/:postIdscope: social:publishLifecycle:
publishing→published|failed.