Docs menuVideos

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.

  • Scopepostory:drafts
  • Limit classMEDIA
  • Success200

Request body

FieldTypeDescription
confirmation_tokenrequiredstring

The quote's single-use token, after the user's yes.

Up to 128 characters

Example

Request
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>"
  }'
Response 200
{
  "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

401

No API key, or an invalid or revoked one

402

Not enough credits; see buy_url

403

The key lacks the scope, or access is paused

404

Not found, or not this user's

409

The state does not allow it now (already scheduled, changed, needs a choice…); branch on code

422

A request parameter is not valid

429

Rate limit spent; see Retry-After

GET /api/v1/videos/{generation_id}

One AI video's result: status, credits_charged, destination and, on success, video.

  • Scopepostory:read
  • Limit classREAD
  • Success200

Parameters

NameInTypeDescription
generation_idrequiredpathstringUp to 36 characters
wait_squeryinteger

Seconds to wait while it is pending, 0-20 (default 15).

From 0 to 20

Example

Request
curl "https://postory.io/api/v1/videos/<generation_id>" \
  -H "Authorization: Bearer $POSTORY_API_KEY"
Response 200
{
  "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

401

No API key, or an invalid or revoked one

403

The key lacks the scope, or access is paused

404

Not found, or not this user's

422

A request parameter is not valid

429

Rate 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.

  • Scopepostory:drafts
  • Limit classMEDIA
  • Success200

Request body

FieldTypeDescription
aspect_ratio"9:16" | "1:1" | "16:9"

Default 9:16 (Veo: 9:16 or 16:9).

durationinteger

Seconds; any length the model takes (models[].durations). Default the template's, else the model's.

From 1 to 30
end_imagestring

The last frame, as start_image; only on models with frames 2.

Up to 36 characters
folderstring

A media library folder (id or name), without post_id. Omitted: no folder.

Up to 100 characters
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 models lists each with its options and price.

partinteger

The draft's 1-based thread part, with post_id.

From 1 to 25
post_idstring

Put the clip on this draft (part, default 1). Omitted: the media library.

Up to 36 characters
promptstring

What happens in the clip. Optional with a template or start_image; with template talk-to-camera, what the person says.

Up to 2000 characters
prompt_as_isboolean

Send prompt to the model verbatim: no rewrite, no skills applied (a skill is still recorded). Needs a prompt.

reference_audiostring[]

Audio the clip's sound and motion follow (a beat, a voice, a song): MP3 or WAV library asset_ids or draft media_ids; only on models with takes_reference_audio (else reference_audio_not_supported with models), at most max_reference_audios, each 2 s or longer and together at most max_reference_audio_seconds, and, on a model without audio_alone_ok, only beside reference_images or reference_videos (reference_audio_alone). Same price.

Up to 3 items
reference_imagesstring[]

Photos of what must appear in the clip (a logo, a product, a character), sent whole: library asset_ids or draft media_ids; only on models with takes_reference_photos (else reference_photo_not_supported with models), at most max_reference_photos. Same price.

Up to 9 items
reference_videosstring[]

Videos the clip follows (motion, style, camera): library asset_ids or draft media_ids; only on models with takes_reference_video, at most max_reference_videos, together at most max_reference_seconds. Their length is priced. A $slug Brand kit item's videos join them.

Up to 3 items
resolution"480p" | "720p" | "1080p"

Default the model's own.

skillstring

A general or video skill's id or slug (GET /skills): the clip follows its instructions. Same price.

Up to 65 characters
soundboolean

Default on; false makes a silent clip (cheaper on Veo).

start_imagestring

The first frame: a library file's asset_id (GET /media-library) or a draft's media_id. The model gets its centre crop to aspect_ratio. Not with reference_videos, reference_images or reference_audio (frame_with_references: the model would drop them); a $slug item's videos are left out beside it (reference_videos_left_out).

Up to 36 characters
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 templates lists each (photo: whether it needs a start_image; models: the models that make it, another refused template_not_supported).

Example

Request
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"
  }'
Response 200
{
  "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

401

No API key, or an invalid or revoked one

402

Not enough credits; see buy_url

403

The key lacks the scope, or access is paused

404

Not found, or not this user's

409

The state does not allow it now (already scheduled, changed, needs a choice…); branch on code

422

A request parameter is not valid

429

Rate limit spent; see Retry-After