Developer API · v1
Subtitle translation
in your workflow.
Connect Premiere Pro plugins and custom tools to the same Basic and Plus translation service you use on the website.
https://aisubtitletranslator.comAuthorization: Bearer ast_YOUR_API_KEYQuick start
Create a key, then download the Node.js example. It estimates the cost, submits a task, polls its status and saves the translated SRT. It requires Node.js 20 or newer and no additional packages.
export AST_BASE_URL='https://aisubtitletranslator.com'
export AST_API_KEY='ast_YOUR_API_KEY'
node translate-subtitle.mjs input.srt zh plus translated.srt my-job-001
# Add true as the final argument for bilingual subtitles:
node translate-subtitle.mjs input.srt zh plus bilingual.srt my-job-001 trueReplace the base URL with this website's origin and place the downloaded script beside your SRT file. Choose basic or plus explicitly. Reuse the same job key, input and options after a network failure. A repeated download with the same job key reuses the existing translation; choose an output filename that does not already exist.
Authentication
Open Dashboard → API keys. Give the key a name to create it. You can view and copy the full key again at any time, revoke it, and then delete the revoked key from the list.
Authorization: Bearer ast_YOUR_API_KEYUse this website's origin as your base URL. All 6 endpoints require a valid key. Each account can have 5 active keys. API keys access API-created translations and your credit balance.
Security notice
Use your own account key. Keep it private and never bundle a shared key into a distributed plugin. Cookies and query-string keys are not accepted.
Six endpoints
JSON success responses wrap the result in { "data": ... }. Successful result downloads always return SRT.
Estimate & submit
Both POST endpoints accept the same JSON body. Send Content-Type: application/json.
Request body
{
"fileName": "interview.srt",
"subtitle": "1\n00:00:01,000 --> 00:00:03,000\nHello!\n",
"targetLanguage": "zh",
"modelTier": "plus"
}subtitle, targetLanguage, and modelTier are required. Explicitly choose basic or plus; omitting modelTier returns 400 INVALID_REQUEST. Source language is detected automatically. Get target language codes from /api/v1/capabilities.
Optional glossary entries contain source and target. Optional characters entries use those fields plus gender (male or female) and aliases (a list of names). See the OpenAPI schema for exact shapes. Unknown fields are rejected.
Preview cost
/api/v1/translations/estimate200 OKFirst POST to /api/v1/translations/estimate. It returns creditCost, availableCredits, sufficientCredits, and subtitle counts. This previews cost without creating a task or reserving credits.
{
"data": {
"modelTier": "plus",
"targetLanguage": "zh",
"creditCost": "1.00",
"availableCredits": "10.00",
"sufficientCredits": true,
"subtitleCount": 1,
"characterCount": 6
}
}Create a task
/api/v1/translations202 Acceptedcurl "$AST_BASE_URL/api/v1/translations" \
-H "Authorization: Bearer $AST_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: premiere-sequence-123-zh-v1' \
--data-binary @request.jsonSave the JSON body as request.json. Set the two environment variables to your website origin and API key.
A new task returns 202 Accepted with data.id, data.creditCost, data.statusUrl, and data.resultUrl. The Location header points to its status endpoint.
{
"data": {
"id": "6f476119-c02f-49a9-b61f-2b3327bd318c",
"status": "pending",
"fileName": "interview.srt",
"modelTier": "plus",
"targetLanguage": "zh",
"creditCost": "1.00",
"statusUrl": "/api/v1/translations/6f476119-c02f-49a9-b61f-2b3327bd318c",
"resultUrl": "/api/v1/translations/6f476119-c02f-49a9-b61f-2b3327bd318c/result"
}
}Idempotency & retries
Generate one Idempotency-Key per intended translation and keep it when retrying. Identical requests return the same task with HTTP 200. A different body with the same key returns 409. Keys are scoped to your account and survive API key rotation.
The header accepts 1–128 letters, numbers, dots, underscores, colons, or hyphens. A replay whose task has expired or been deleted returns 410. Use a new key only when you intend to create another billable task.
Progress & results
Poll task status
/api/v1/translations/{taskId}200 OKPoll the status URL every 5 seconds. Status is pending, processing, completed, or failed. progress is a percentage or null when unavailable; errorCode describes a failed task.
curl --fail "$AST_BASE_URL/api/v1/translations/$TASK_ID" \
-H "Authorization: Bearer $AST_API_KEY"{
"data": {
"id": "6f476119-c02f-49a9-b61f-2b3327bd318c",
"status": "processing",
"fileName": "interview.srt",
"modelTier": "plus",
"targetLanguage": "zh",
"sourceLanguage": "English",
"creditCost": "1.00",
"progress": 64,
"errorCode": null,
"statusUrl": "/api/v1/translations/6f476119-c02f-49a9-b61f-2b3327bd318c",
"resultUrl": "/api/v1/translations/6f476119-c02f-49a9-b61f-2b3327bd318c/result"
}
}Set TASK_ID to data.id from submission. Progress responses include the task fields above plus progress and errorCode; both can be null. Stop polling on failed and display the error. Use a new job key only for an intentional new translation attempt.
Download result
/api/v1/translations/{taskId}/result200 · application/x-subripWhen complete, GET the result URL and save the response text as an SRT file. The response type is application/x-subrip; charset=utf-8. Omit includeOriginal or set it to false for translation only. Add ?includeOriginal=true for bilingual captions, with the source followed by its translation.
curl --fail "$AST_BASE_URL/api/v1/translations/$TASK_ID/result?includeOriginal=true" \
-H "Authorization: Bearer $AST_API_KEY" \
--output translated-bilingual.srtThe format parameter is not supported and returns 400 INVALID_REQUEST. Errors are returned as JSON. A result requested too early returns 409 TRANSLATION_NOT_READY with Retry-After: 5. Failed translations return 409 TRANSLATION_FAILED.
Download completed results promptly. The website's deletion and retention rules also apply to API tasks. Missing or inaccessible tasks return 404. API tasks appear in your subtitle history.
Credits & limits
/api/v1/credits200 OKAPI translations use your account balance and the website’s tier pricing and minimum charge. Each estimate applies to one file. The accepted task’s creditCost is the amount charged at submission.
Failure or cancellation refunds the original credit sources once, with their original expiry dates. The balance endpoint returns decimal strings for availableCredits, reservedCredits (older pending tasks), and totalCredits (available plus reserved).
{
"data": {
"availableCredits": "9.00",
"reservedCredits": "1.00",
"totalCredits": "10.00"
}
}Limits & quotas
Rate-limit headers
Read live limits from /api/v1/capabilities. Authenticated estimate and submission responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix seconds). Honor Retry-After on 429 responses. Translation completion time depends on the queue and input.
Errors & retries
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Your account does not have enough available credits."
},
"requestId": "c1f8a2b4-7d3e-4e9b-9a10-8e3f45c67d89"
}Retry network errors and temporary server failures with the same Idempotency-Key and body. Wait for the Retry-After duration when present. After a terminal translation failure, a deliberate retry requires a new key. Include X-Request-Id and the task ID when contacting support.
Premiere Pro workflow
- Select or export an SRT file.
- Estimate the cost and submit it with the selected target language.
- Show task progress, then save the translated SRT.
- Import it into Premiere and place it on a caption track.
UXP permissions & CORS
Declare this origin in the UXP manifest's network permissions and request file access for SRT input/output. Public endpoints support CORS for Bearer authorization without cookies.
SRT formatting & cleanup
Use numbered SRT cues with HH:MM:SS,mmm timestamps, non-empty text, and blank lines between cues. Existing subtitle cleanup applies: formatting tags are removed, cues are renumbered, and overlapping secondary overlay text may be filtered. Retained timestamps are preserved. Premiere styling is not carried by SRT.
Caption tracks & audio
Automatic access to an existing caption track must be verified against your Premiere version. The API accepts subtitle text; transcribe audio to subtitles before submitting.