Cloud Burn API
Submit projects to our high-performance rendering cluster for hardcoded video generation with professional styling.
/api/v1/burncurl -X POST https://api.srtgen.com/api/v1/burn \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_8k2n9m1b",
"resolution": "1080p"
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Core Parameters | |||
projectId | String | Yes | The unique identifier of the project containing video and subtitles. |
resolution | String | No | Desired output video resolution. Options: original, 1080p, 720p, 480p | Default: original |
fileName | String | No | Custom name for the generated MP4 file. |
language | String | No | Target language for the burned subtitles. Default: Project Active Language |
| Multi-Language Support (Dual Subtitles) | |||
languages | Array | No | Configurations for multiple subtitle tracks in one video. Limit: Max 3 Languages |
- language | String | Yes* | The code for this language slot (e.g., 'zh' or 'original'). |
- lineBreakRules | Object | No | Per-language segmentation overrides. |
- styleSettings | Object | No | Per-language styling (Crucial for dual subtitle positioning). |
| Line Break Rules (lineBreakRules) | |||
lineBreakRules | Object | No | Nested object for subtitle segmentation logic. |
- maxChars | Number | No | Maximum characters allowed per line. Range: 5 - 100 | Default: 45 |
- maxWords | Number | No | Maximum words allowed per subtitle line. Range: 1 - 20 | Default: 10 |
- balanceLines | Boolean | No | Evens out line lengths in multi-line subtitles. Default: true |
- sentenceSplit | Boolean | No | Prefer breaking lines at the end of sentences. Default: true |
- gapThreshold | Number | No | Max gap (seconds) between words on a line. Range: 0.1 - 2.0 | Default: 0.4 |
| Style Basics (styleSettings) | |||
uppercase | Boolean | No | Force all transcription text to uppercase. |
styleSettings | Object | No | Nested object for visual styling overrides. |
- preset | String | No | Apply a built-in style preset as a base. Options: standard-stream, classic-apple, etc. |
- fontSize | Number | No | Font size as a ratio of video height. Default: 0.045 |
- fontFamily | String | No | Standard font name used for rendering. Default: Arial |
- bold | Boolean | No | Apply bold weight to text. Default: false |
- italic | Boolean | No | Apply italic style to text. Default: false |
| Colors & Borders | |||
- primaryColor | Hex | No | Main text color hex code. Default: #FFFFFF |
- secondaryColor | Hex | No | Secondary color (used for karaoke effects). Default: #00FFFF |
- outlineColor | Hex | No | Color of the text outline. Default: #000000 |
- outline | Number | No | Outline thickness (Ratio of height). Default: 0.002 |
- shadow | Number | No | Shadow depth (Ratio of height). Default: 0.001 |
| Positioning (Ratios 0-1) | |||
- alignment | Number | No | ASS alignment code (1-9). Bottom-Center is 2. Range: 1 - 9 | Default: 2 |
- posX | Number | No | Horizontal position (0 = Left, 1 = Right). Default: 0.5 |
- posY | Number | No | Vertical position ratio (0 = Top, 1 = Bottom). Default: 0.88. |
- marginV | Number | No | Vertical margin ratio from bottom/top. Default: 0.056. |
| Animation & Effects | |||
- fadeIn | Number | No | Fade in duration in milliseconds. |
- fadeOut | Number | No | Fade out duration in milliseconds. |
- karaoke | String | No | Karaoke tag type (k, kf, ko, ks). |
curl -X POST https://api.srtgen.com/api/v1/burn \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_8k2n9m1b",
"resolution": "1080p",
"styleSettings": {
"preset": "standard-stream",
"fontSize": 0.055,
"bold": true
}
}'curl -X POST https://api.srtgen.com/api/v1/burn \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"projectId": "proj_8k2n9m1b",
"languages": [
{
"language": "original",
"styleSettings": {
"preset": "classic-apple",
"posY": 0.85
}
},
{
"language": "es",
"styleSettings": {
"preset": "classic-apple",
"posY": 0.75,
"primaryColor": "#FFFF00"
}
}
]
}'Status & Response
1. Async Initialization
Cloud burn jobs are asynchronous. The API will respond immediately with a burnId once the task is accepted by the rendering cluster.
Use the Export Status Endpoint to poll for progress and the final video URL.
{ "success": true, "burnId": "brnc_abc123", "status": "running" }
2. Tracking & Retrieval
To get the final result, poll the project status using the burnId received during initialization:
curl -X POST https://api.srtgen.com/api/v1/export/proj_xxx \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"output": "mp4",
"burnId": "brnc_abc123"
}'When finished, the status will change to completed and a resultUrl (the downloadable video) will be provided.
{ "status": "completed", "resultUrl": "https://cdn.b2.com/video.mp4" }
Error Codes
| Status | Error Code | Description |
|---|---|---|
| 400 | missing_parameter | projectId is required. |
| 400 | missing_video | Project has no source video attached. |
| 401 | unauthorized | API Key is missing or invalid. |
| 403 | insufficient_balance | Insufficient credits for the video duration. |
| 404 | not_found | Project ID does not exist. |
| 500 | burn_submission_failed | Render cluster is at capacity or unreachable. |
| 500 | export_error | An error occurred during subtitle processing. |
| 500 | server_error | Unexpected internal server error. |