Translation API
Expand your reach by translating your subtitles into over 100 languages using state-of-the-art AI.
POST
/api/v1/translateQuick Implementation
curl -X POST https://api.srtgen.com/api/v1/translate \ -H "x-api-key: <YOUR_API_KEY>" \ -F "projectId=proj_8k2n9m1b" \ -F "targetLanguageCode=es" \ -F "modelId=pro"
POSThttps://api.srtgen.com/api/v1/translate
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
projectId | String | Yes | The unique identifier of the project to translate. |
targetLanguageCode | String | Yes | ISO 639-1 code (e.g., 'es', 'fr', 'zh-CN'). |
modelId | String | No | 'pro' (High Quality, 1 credit/min) or 'basic' (Fast, 1 credit/2 mins). Default is 'basic'. |
Advanced: Basic Model (Cost-Optimized)
curl -X POST https://api.srtgen.com/api/v1/translate \ -H "x-api-key: <YOUR_API_KEY>" \ -F "projectId=proj_8k2n9m1b" \ -F "targetLanguageCode=zh-CN" \ -F "modelId=basic"
POSThttps://api.srtgen.com/api/v1/translate
Success Response
A successful request returns a 200 OK status. The translated subtitles are immediately synchronized and available for export or further modification in the workspace.
{ "success": true, "projectId": "proj_8k2n9m1b", "targetLanguageCode": "es", "modelId": "pro" }
Error Codes
| Status | Error Code | Description |
|---|---|---|
| 400 | missing_parameter | Project ID or Target Language is missing. |
| 401 | unauthorized | API Key is missing or invalid. |
| 404 | not_found | Project ID does not exist. |
| 403 | insufficient_balance | Insufficient credits for the operation. |
| 500 | translation_failed | AI engine failed to process the request. |
| 500 | server_error | Unexpected internal server error occurred. |
Error Response Structure
{ "success": false, "error": "not_found", "message": "The project with ID 'proj_unknown' could not be found." }
Was this page helpful?