文檔目錄

翻譯任務 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
翻譯文本