Skip to main content
POST
/
v1
/
videos
/
captions
Add Captions to a Video
curl --request POST \
  --url https://api.mirage.app/v1/videos/captions \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'caption_template_id=<string>' \
  --form 'video=<string>' \
  --form 'video_id=<string>' \
  --form video.0='@example-file'
{
  "id": "<string>",
  "status": "PROCESSING",
  "created_at": 123,
  "video_id": "<string>",
  "object": "video",
  "completed_at": 1730822520,
  "progress": 100,
  "error": null,
  "model": "mirage-video-1-latest",
  "source_video_id": "video_abc123def456",
  "caption_template_id": "ctpl_123456789abcdefg"
}

Authorizations

x-api-key
string
header
required

API key for authentication.

Body

multipart/form-data
caption_template_id
string
required

Caption style template ID

Example:

"ctpl_yvE0ZnYzEj6ClCD2ee1f"

video
file | null

Video file to caption (MP4, MOV). Must be 9:16 aspect ratio. Max 50mb. Either video or video_id must be provided.

video_id
string | null

Existing video ID to add captions to. Either video or video_id must be provided.

Response

200 - application/json

Returns a Video object representing the captioning job

Represents a video object.

A video can be created via generation (image+audio) or captioning (adding captions to an existing video).

id
string
required

Video generation job ID

Example:

"video_abc123def456"

status
enum<string>
required

Current state of the video

Available options:
PROCESSING,
COMPLETE,
FAILED,
CANCELLED
Example:

"COMPLETE"

created_at
integer
required

When the video was created (unix timestamp)

Example:

1730822400

video_id
string
required
deprecated

[Deprecated] Use "id" instead.

object
string
default:video
Allowed value: "video"
completed_at
integer | null

When processing completed (unix timestamp)

Example:

1730822520

progress
integer | null

Progress percentage (0-100)

Example:

100

error
MAVideoError · object

Error details if status is FAILED

Example:

null

model
string | null

Model used for generation (only for source='generation')

Allowed value: "mirage-video-1-latest"
Example:

"mirage-video-1-latest"

source_video_id
string | null

The input video that was captioned (only for source='caption')

Example:

"video_abc123def456"

caption_template_id
string | null

Caption style template used (only for source='caption')

Example:

"ctpl_123456789abcdefg"