Videos
POST /api/v1/videos
Start the quoted video with its confirmation_token; waits up to ~20 s. A clip takes 1-5 minutes: pending, follow it with GET /videos/{generation_id}. Charged only for a clip that was stored, never more than the quote.
- Scope
postory:drafts - Limit class
MEDIA - Success
200
Request body
| Field | Type | Description |
|---|---|---|
confirmation_tokenrequired | string | The quote's single-use token, after the user's yes. Up to 128 characters |
Example
curl https://postory.io/api/v1/videos \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"confirmation_token": "<confirmation_token from POST /videos/quote>"
}'{
"generation_id": "<generation_id>",
"model": "x-ai/grok-imagine-video-1.5-lite",
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "480p",
"sound": true,
"price_credits": 17,
"destination": {
"type": "library",
"folder": null,
"url": "https://postory.io/media-library"
},
"status": "pending",
"credits_charged": 0,
"next": "GET /api/v1/videos/<generation_id>",
"acting_as": {
"postory": "[email protected]",
"x": "yourhandle",
"label": "@yourhandle · X",
"plan": "free"
}
}Other responses
401No API key, or an invalid or revoked one
402Not enough credits; see
buy_url403The key lacks the scope, or access is paused
404Not found, or not this user's
409The state does not allow it now (already scheduled, changed, needs a choice…); branch on
code422A request parameter is not valid
429Rate limit spent; see Retry-After
GET /api/v1/videos/{generation_id}
One AI video's result: status, credits_charged, destination and, on success, video.
- Scope
postory:read - Limit class
READ - Success
200
Parameters
| Name | In | Type | Description |
|---|---|---|---|
generation_idrequired | path | string | Up to 36 characters |
wait_s | query | integer | Seconds to wait while it is pending, 0-20 (default 15). From 0 to 20 |
Example
curl "https://postory.io/api/v1/videos/<generation_id>" \
-H "Authorization: Bearer $POSTORY_API_KEY"{
"generation_id": "<generation_id>",
"model": "x-ai/grok-imagine-video-1.5-lite",
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "480p",
"sound": true,
"price_credits": 17,
"destination": {
"type": "library",
"folder": null,
"url": "https://postory.io/media-library"
},
"status": "succeeded",
"credits_charged": 16,
"video": {
"url": "https://media.example.com/clip.mp4",
"width": 848,
"height": 480,
"duration_seconds": 5.042,
"file_size": 2884950,
"asset_id": "<asset_id>"
},
"next": "POST /api/v1/drafts/{post_id}/media/from-library",
"acting_as": {
"postory": "[email protected]",
"x": "yourhandle",
"label": "@yourhandle · X",
"plan": "free"
}
}Other responses
401No API key, or an invalid or revoked one
403The key lacks the scope, or access is paused
404Not found, or not this user's
422A request parameter is not valid
429Rate limit spent; see Retry-After
POST /api/v1/videos/quote
Price an AI video and check it can start; the answer's single-use confirmation_token is for POST /videos after the user's yes. Nothing is made or charged. credit_limit (402) carries buy_url.
- Scope
postory:drafts - Limit class
MEDIA - Success
200
Request body
| Field | Type | Description |
|---|---|---|
aspect_ratio | "9:16" | "1:1" | "16:9" | Default 9:16 (Veo: 9:16 or 16:9). |
duration | integer | Seconds; any length the model takes ( |
end_image | string | The last frame, as |
folder | string | A media library folder (id or name), without |
model | "bytedance/seedance-2.0-fast" | "bytedance/seedance-2.5-flash" | "bytedance/seedance-2.5" | "google/veo-3.1-lite" | "x-ai/grok-imagine-video-1.5-lite" | The video model (default Grok Imagine Lite, or the template's); the quote's |
part | integer | The draft's 1-based thread part, with |
post_id | string | Put the clip on this draft ( |
prompt | string | What happens in the clip. Optional with a |
prompt_as_is | boolean | Send |
reference_audio | string[] | Audio the clip's sound and motion follow (a beat, a voice, a song): MP3 or WAV library |
reference_images | string[] | Photos of what must appear in the clip (a logo, a product, a character), sent whole: library |
reference_videos | string[] | Videos the clip follows (motion, style, camera): library |
resolution | "480p" | "720p" | "1080p" | Default the model's own. |
skill | string | A general or video skill's id or slug ( |
sound | boolean | Default on; false makes a silent clip (cheaper on Veo). |
start_image | string | The first frame: a library file's |
template | "bring-to-life" | "slow-push-in" | "orbit-360" | "product-reveal" | "floating-product" | "unboxing" | "parallax-3d" | "drone-flyover" | "food-closeup" | "holiday-sparkle" | "talk-to-camera" | "claymation" | A motion preset; the quote's |
Example
curl https://postory.io/api/v1/videos/quote \
-H "Authorization: Bearer $POSTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Steam rises from a coffee cup on a sunny desk, slow push-in",
"model": "x-ai/grok-imagine-video-1.5-lite",
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "480p"
}'{
"status": "quote",
"price_credits": 17,
"balance_credits": 46,
"model": {
"id": "x-ai/grok-imagine-video-1.5-lite",
"label": "Grok Imagine Lite"
},
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "480p",
"sound": true,
"destination": {
"type": "library",
"folder": null,
"url": "https://postory.io/media-library"
},
"takes": "1-5 minutes",
"models": [
{
"id": "x-ai/grok-imagine-video-1.5-lite",
"label": "Grok Imagine Lite",
"summary": "Fastest and cheapest: drafts, simple motion",
"aspects": ["9:16", "1:1", "16:9"],
"durations": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
"resolutions": ["480p", "720p", "1080p"],
"sound": "always",
"frames": 1,
"price_credits": 17
}
],
"templates": [
{
"id": "bring-to-life",
"label": "Bring to life",
"description": "The photo starts to move, naturally",
"photo": "required"
}
],
"confirmation_token": "<confirmation_token>",
"expires_in": 600,
"approval_status": "needs_chat_yes",
"note": "Show the user the price and that the video takes 1-5 minutes; call POST /api/v1/videos with only this confirmation_token after their explicit yes.",
"hint_id": "video_quote",
"acting_as": {
"postory": "[email protected]",
"x": "yourhandle",
"label": "@yourhandle · X",
"plan": "free"
}
}Other responses
401No API key, or an invalid or revoked one
402Not enough credits; see
buy_url403The key lacks the scope, or access is paused
404Not found, or not this user's
409The state does not allow it now (already scheduled, changed, needs a choice…); branch on
code422A request parameter is not valid
429Rate limit spent; see Retry-After