文档目录

翻译任务 API

重启翻译任务

POST/v1/translation/start

用于Terminated任务的重启,或者支付积分进行全文翻译

完整地址
https://otranslator.com/api/v1/translation/start
认证
需要在 Authorization 请求头中传入 API Key
Content-Type
application/json
错误格式
{ "error": "Invalid API key." }

注意事项

该接口可用于重启 Terminated 任务,也可在预览任务完成后通过 payWithCredits 支付并启动全文翻译。

已支付任务不会重复扣费。传入 model 时,仅在 payWithCredits 为 true 且任务未支付时用于重新计算费用。

示例

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

请求参数

参数类型默认描述示例
*taskIdString-

翻译任务ID

-
payWithCreditsBoolean-

是否支付翻译任务,只有文档未支付时有效,已支付的文档不会重复扣费

-
modelString-
  • 当 payWithCredits 为 true 时,指定全文翻译使用的 model
  • 支持模型:查询
-

响应

参数类型默认描述示例
successBoolean-

是否启动成功

-

常见错误

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.

翻译任务 API
修订译文
翻译任务 API
翻译文本