Register as a Developer and Get an API Key
Provides RESTful APIs for document translation, supporting automated translation task management, glossary-based terminology consistency, and queries for supported formats, languages, and models, making it easy to build seamless translation workflows and manage user accounts.
Getting started
To get started, you need to apply to become a developer.Apply as a developer
Once approved, you can create multiple API keys and include the appropriate API key in each API request as required.
Quick Access
Base URL
https://deploy-demo.otranslator.com/api
Authentication Method
Authorization: [yourSecretKey]
JSON Request
Except for file upload interfaces, interfaces use POST JSON requests by default, with Content-Type set to application/json.
File Upload
Create a document translation task using multipart/form-data, passing the file to be translated in the file field.
Generic Error Response
When a request fails, the API returns JSON with the error field containing a fixed English error message. It is recommended to handle errors primarily by branching on HTTP status code, with the error field used for display or logging purposes.
{
"error": "Invalid API key."
}Error Status Code Rules
All v1 API error responses maintain the same structure, please handle according to the following HTTP status code rules.
- 400 Bad Request
- Missing required parameters, invalid parameter formats or enum values, missing file upload, upload save failure, or task processing failure.
- 401 Unauthorized
- Missing API key or invalid API key.
- 402 Payment Required
- Insufficient credits balance for preview, full translation, or text translation.
- 404 Not Found
- The task or glossary does not exist, has been deleted, does not belong to the current API account, or was not created through the API.
- 409 Conflict
- The current task status does not allow the requested operation.
- 500 Internal Server Error
- Unexpected server exception. The response error is fixed as "Internal server error.".
Recommended Integration Process
1. Create task
Upload files and create translation tasks, return taskId.
2. Query progress
Poll the task status until Completed, Terminated, or Cancelled.
3. Get results
Download the translation file, or read the source and translation JSON.
4. Manage tasks
Pay as you go for full text translation, restarting tasks, revising text, or deleting tasks.