API Reference

Create videos and images from URLs programmatically with the REST API.

Authentication
All API requests are authenticated with an API key.

Create a key under Account → API Keys. The full key (starting with zk_live_) is shown once at creation. Pass it on every request in either header:

Authorization: Bearer zk_live_your_key_here
# or
X-API-Key: zk_live_your_key_here

Invalid or revoked keys receive 401 Invalid API key. Keep keys out of client-side code and version control; revoke and rotate them immediately if leaked.

Videos
Rendering is asynchronous: create a job, then poll until it is done.
POST/api/v1/videos

Only url is required. Optional fields: preset (ken_burns default, slide_up, parallax), format (story default = 1080×1920, post = 1080×1080), template_id (one of your custom templates), and image_count (1–3).

curl -X POST https://api.titlereel.com/api/v1/videos \
  -H "Authorization: Bearer zk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/article",
    "preset": "ken_burns",
    "format": "story"
  }'

The response includes an id and status: "queued". Poll the job:

GET/api/v1/videos/{id}
curl https://api.titlereel.com/api/v1/videos/VIDEO_ID \
  -H "Authorization: Bearer zk_live_your_key_here"

Status transitions queued → processing → done (or failed, with error_text; the credit is refunded). When done, the response contains mp4_url, webm_url and thumb_url — signed download links valid for 7 days (re-fetch the job for fresh links). Poll every few seconds; renders typically take under a minute.

GET/api/v1/videos?page=1&page_size=20

Lists your videos, newest first.

Images
Static preview images, same async job model.
POST/api/v1/images

Only url is required. Optional: preset, format, template_id, width/height, title (override), and image_index (0–2, which extracted image to use).

curl -X POST https://api.titlereel.com/api/v1/images \
  -H "Authorization: Bearer zk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/article", "format": "post"}'
GET/api/v1/images/{id}

When done, the response contains download_url and view_url.

GET/api/v1/images?page=1&page_size=20
Templates
Discover presets and your custom templates.
GET/api/v1/templates
curl https://api.titlereel.com/api/v1/templates \
  -H "Authorization: Bearer zk_live_your_key_here"

Returns built-in presets (type: "preset" — use the id as preset) and your custom templates (type: "custom" — use the id as template_id).

Credits & errors
API usage shares your account's credit pool.

Each video or image creation costs 1 credit (failed renders are refunded automatically). There are no separate API rate limits — usage is bounded by your credits. When you run out, creation endpoints return 402:

{
  "detail": {
    "error": "insufficient_credits",
    "message": "You are out of credits. Purchase credits to continue using the API.",
    "purchase_url": "https://your-app/app/billing"
  }
}

400 — invalid input or content extraction failed

401 — missing, invalid, or revoked API key

404 — resource not found or not owned by you

429 — too many invalid key attempts from your IP

Security

Keys are stored as cryptographic hashes — we cannot recover a lost key.

API keys can only create and read media and templates. They cannot access billing, account settings, integrations, or manage other API keys.

Revoking a key under Account → API Keys takes effect immediately.