Document Directory

Translation Task API

Restart translation task

POST/v1/translation/start

Used for restarting terminated tasks or paying credits for full-text translation

Complete Address
https://deploy-demo.otranslator.com/api/v1/translation/start
Authentication
API Key needs to be passed in the Authorization request header
Content-Type
application/json
Error Format
{ "error": "Invalid API key." }

Notes

This endpoint can be used to restart Terminated tasks, or to pay with credits via payWithCredits and start full-text translation after a preview task is completed.

Paid tasks will not be charged repeatedly. When passing in model, it is only used to recalculate fees when payWithCredits is true and the task has not been paid.

Example

1curl -X POST 'https://deploy-demo.otranslator.com/api/v1/translation/start' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5  "taskId": "[string]"
6}'

Request Parameters

ParametersTypeDefaultDescriptionExample
Required: taskIdString-

Translation Task ID

-
payWithCreditsBoolean-

Whether to pay for translation task, only effective when document is unpaid; paid documents will not be charged repeatedly

-
modelString-
  • When payWithCredits is true, specifies the model used for full document translation
  • Supported models: Query
-

Response

ParametersTypeDefaultDescriptionExample
successBoolean-

Startup successful

-

Common Errors

401 Missing API key.

The Authorization request header is required.

401 Invalid API key.

The API key does not exist, has been deleted, or is no longer valid.

400 Missing required parameter: taskId.

Provide the taskId returned by the create translation task API.

402 Insufficient credits balance.

The account does not have enough credits to start the full translation.

404 Task not found.

The task does not exist or does not belong to the current API account.

Translation Task API
Revise translation
Translation Task API
Translation text