Operation

Generate Subtitles

Burn styled subtitles into a hosted video through Cannon Studio's subtitle renderer.

Operation: subtitles.generate
Submit via POST /api/v1/requests
Credits: dynamic

Request fields

video_urldurationfile_namecontent_typesubtitle_settings

Example request

{
  "operation": "subtitles.generate",
  "input": {
    "video_url": "https://example.com/source.mp4",
    "duration": 42,
    "file_name": "dialogue-scene.mp4",
    "content_type": "video/mp4",
    "subtitle_settings": {
      "font": "Inter",
      "fontSize": 56,
      "color": "#FFFFFF",
      "strokeColor": "#000000",
      "strokeWidth": 2
    }
  }
}
curl -X POST https://www.cannonstudio.app/api/v1/requests \
  -H "Content-Type: application/json" \
  -H "x-api-key: $CANNON_API_KEY" \
  -H "x-idempotency-key: subtitles-generate-001" \
  -d @- <<'JSON'
{
  "operation": "subtitles.generate",
  "input": {
    "video_url": "https://example.com/source.mp4",
    "duration": 42,
    "file_name": "dialogue-scene.mp4",
    "content_type": "video/mp4",
    "subtitle_settings": {
      "font": "Inter",
      "fontSize": 56,
      "color": "#FFFFFF",
      "strokeColor": "#000000",
      "strokeWidth": 2
    }
  }
}
JSON

Notes

  • Renders styled subtitles into a hosted source video.
  • Uses the same subtitle generation flow and feature-gate pricing as the app.
  • The request object resolves when the subtitled video is ready.

Success output

{
  "task_id": "sub_123",
  "asset_type": "video",
  "status": "succeeded",
  "video_url": "https://storage.googleapis.com/.../subtitled.mp4",
  "model": "subtitles"
}