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.

Base URLhttps://aisubtitletranslator.com
Auth headerAuthorization: Bearer ast_YOUR_API_KEY

Quick 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 true

Replace 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.

HTTP Header
Authorization: Bearer ast_YOUR_API_KEY

Use 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

MethodPathPurpose
GET/api/v1/capabilitiesLanguages, tiers, limits
GET/api/v1/creditsCredit balance
POST/api/v1/translations/estimatePreview cost
POST/api/v1/translationsCreate a task
GET/api/v1/translations/{taskId}Status and progress
GET/api/v1/translations/{taskId}/resultDownload SRT

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

FieldTypeRequirementConstraints & default
subtitlestringRequiredUTF-8 SRT, ≤ 1 MiB, ≤ 5,000 cues
targetLanguagestringRequiredLanguage code from GET /api/v1/capabilities
modelTier"basic" | "plus"RequiredRequired; no default value
fileNamestringOptionalDefault "subtitles.srt", 1–200 chars, *.srt
glossary{ source, target }[]OptionalDefault [], max 200 items, ≤ 200 chars each
charactersCharacter[]OptionalDefault [], max 100 items, gender, ≤ 20 aliases
{
  "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

POST/api/v1/translations/estimate200 OK

First POST to /api/v1/translations/estimate. It returns creditCost, availableCredits, sufficientCredits, and subtitle counts. This previews cost without creating a task or reserving credits.

Response · 200 OK
{
  "data": {
    "modelTier": "plus",
    "targetLanguage": "zh",
    "creditCost": "1.00",
    "availableCredits": "10.00",
    "sufficientCredits": true,
    "subtitleCount": 1,
    "characterCount": 6
  }
}

Create a task

POST/api/v1/translations202 Accepted
curl "$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.json

Save 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.

Response · 202 Accepted
{
  "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

GET/api/v1/translations/{taskId}200 OK

Poll 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"
Response · 200 OK
{
  "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

GET/api/v1/translations/{taskId}/result200 · application/x-subrip
Query parametersTypeConstraints & default
includeOriginalbooleanDefault false; set true for bilingual SRT

When 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.srt

The 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

GET/api/v1/credits200 OK

API 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).

GET /api/v1/credits · 200 OK
{
  "data": {
    "availableCredits": "9.00",
    "reservedCredits": "1.00",
    "totalCredits": "10.00"
  }
}

Limits & quotas

Read requestsBalance checks, progress polling, result downloads, and capability queries have no per-minute request cap.
Write requestsAll keys on an account share 10 requests per 60 seconds for estimates and submissions combined. Retries count.
Concurrent tasks3 pending or processing API tasks at once.
Payload & cues1 MiB UTF-8 subtitle text; 2 MiB total JSON; 5,000 cues.
Single cue lengthCue text length follows the website setting (default 500 characters).
Context entries200 glossary entries; 100 characters with up to 20 aliases each. Terms and names are limited to 200 characters.
SRTOne file and one target language per task.

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 response format
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Your account does not have enough available credits."
  },
  "requestId": "c1f8a2b4-7d3e-4e9b-9a10-8e3f45c67d89"
}
HTTP statusError codesDescriptionRetry policy
400
INVALID_REQUESTINVALID_SUBTITLEINVALID_IDEMPOTENCY_KEY
invalid inputDo not retry
401
INVALID_API_KEY
invalid or revoked keyDo not retry
402
INSUFFICIENT_CREDITS
insufficient creditsDo not retry
404
NOT_FOUND
missing/inaccessible taskDo not retry
409
IDEMPOTENCY_CONFLICTTRANSLATION_NOT_READYTRANSLATION_FAILED
conflicting key, unfinished or failed translationRetry if not ready
410
TRANSLATION_EXPIRED
replayed task expiredDo not retry
413
REQUEST_TOO_LARGESUBTITLE_TOO_LARGE
input too largeDo not retry
415
UNSUPPORTED_MEDIA_TYPE
expected JSONDo not retry
422
SUBTITLE_REJECTED
subtitle rejectedDo not retry
429
RATE_LIMITEDACTIVE_TASK_LIMIT
request or active-task limitWait Retry-After
502
INVALID_TRANSLATION_RESULT
incomplete resultDo not retry
503
SERVICE_UNAVAILABLEQUEUE_UNAVAILABLE
service, model, or queue unavailableWait Retry-After

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

  1. Select or export an SRT file.
  2. Estimate the cost and submit it with the selected target language.
  3. Show task progress, then save the translated SRT.
  4. 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.