logoby DIP
  • Products
  • Pricing
  • About Us
  • Resources
  • Solution
    By language
    By document
    By use case
    By technology
    language
    ArabicArabicEnglishEnglishFrenchFrenchGermanGermanHindiHindiIndonesianIndonesianItalianItalianJapaneseJapaneseJavaneseJavaneseKoreanKoreanMarathiMarathiPortuguesePortuguesePunjabiPunjabiRussianRussianSpanishSpanishTamilTamilTeluguTeluguTurkishTurkishUrduUrduVietnameseVietnameseChinese (Simplified)Chinese (Simplified)Chinese (Traditional)Chinese (Traditional)BanglaBangla
  • Solution

    arrows
    By Language
    arrows
    By Document
    arrows
    By Use Case
    arrows
    By Technology
    arrows
  • Support
    View Plans
logoby DIP
menu
blogblogBack to blog
blog

Unlock Powerful Integrations: API Integration Guide

January 14, 2026

Overview

This document describes all interfaces of the Translation Platform Open API. The Open API allows third-party systems to integrate translation services, including file translation, term library management, and memory library management.

Basic Information

  • Base URL: /api/v1/open
  • Request Format: application/json (except for file uploads)
  • Response Format: application/json

Authentication

All APIs require an API Key in the request header:

http
X-API-Key: your_api_key_here

Unified Response Format

json
{
    "code": 0,
    "message": "success",
    "data": {}
}
FieldTypeDescription
codeintStatus code, 0 indicates success
messagestringStatus message
dataobjectResponse data

Rate Limiting (QPS)

To ensure service stability, all APIs have rate limits:

API TypeQPS LimitDescription
File Upload5/sMaximum 5 requests per second per API Key
Submit Translation10/sMaximum 10 requests per second per API Key
Query Status10/sMaximum 10 requests per second per API Key
Get Download URL10/sMaximum 10 requests per second per API Key
Other APIs20/sMaximum 20 requests per second per API Key

When rate limit is exceeded, the API returns error code 91006 (Rate limit exceeded). Please reduce request frequency and retry.


General APIs

Get Supported Languages

Get all supported language codes and names.

Request

http
GET /api/v1/open/languages

Request Parameters

None

Response Data

FieldTypeDescription
languagesarrayLanguage list
languages[].codestringLanguage code
languages[].namestringLanguage name in English
totalintTotal number of languages

Response Example

json
{
    "code": 0,
    "message": "success",
    "data": {
        "languages": [
            {"code": "zh-CN", "name": "Chinese Simplified"},
            {"code": "en-US", "name": "English"},
            {"code": "ja", "name": "Japanese"}
        ],
        "total": 50
    }
}

File Translation APIs

Upload File

Upload a file for translation.

Request

http
POST /api/v1/open/files/upload
Content-Type: multipart/form-data

Request Parameters

ParameterTypeRequiredDescription
filefileYesFile to upload. Supported formats: docx, doc, pdf, pptx, ppt, xlsx, xls, txt
is_can_editbooleanNoWhether PDF file is editable, default is true

Response Data

FieldTypeDescription
file_idstringFile ID

Response Example

json
{
    "code": 0,
    "message": "success",
    "data": {
        "file_id": "12345678901234567"
    }
}

Submit Translation Task

Submit a file for translation.

Status Restriction: Only files with status 1 (Pending Translation) can be submitted for translation. Calling this API on files with other statuses will return error code 91104.

Request

http
POST /api/v1/open/translate/submit
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
file_idintYesFile ID (integer type)
source_languagestringYesSource language code (LanguageEnum value, e.g., zh-CN)
target_languagestringYesTarget language code (LanguageEnum value, e.g., en-US)
trans_modestringYesTranslation mode: deep (Deep Translation) or master (Master Translation)
term_lib_idsint[]NoList of term library IDs
memory_libsobject[]NoMemory library configuration list
memory_libs[].memory_lib_idintYesMemory library ID
memory_libs[].thresholdfloatNoMatch threshold, range 0-1, default 0.8

Request Example

json
{
    "file_id": 12345678901234567,
    "source_language": "zh-CN",
    "target_language": "en-US",
    "trans_mode": "deep",
    "term_lib_ids": [1, 2],
    "memory_libs": [
        {"memory_lib_id": 1, "threshold": 0.8}
    ]
}

Response Data

FieldTypeDescription
estimated_coststringEstimated cost

Response Example

json
{
    "code": 0,
    "message": "success",
    "data": {
        "estimated_cost": "10.50"
    }
}

Query File Status

Batch query file translation status.

Request

http
POST /api/v1/open/files/status
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
file_idsstring[]YesList of file IDs (string type), maximum 20

Request Example

json
{
    "file_ids": ["12345678901234567", "12345678901234568"]
}

Response Data

FieldTypeDescription
filesarrayFile status list
files[].file_idstringFile ID
files[].statusintFile status code (see table below)
files[].filenamestringFilename (null if not exists)
files[].word_countintWord count (null if not exists)
files[].source_languagestringSource language code (null if not exists)

File Status Codes

Status CodeDescription
-1File not found
14Parsing
15Parse failed
1Pending translation
5Analyzing
6Analysis failed
7Analyzed
2Translating
3Translation failed
4Translated
16Extracting
17Extraction failed
18Extraction completed

Response Example

json
{
    "code": 0,
    "message": "success",
    "data": {
        "files": [
            {
                "file_id": "12345678901234567",
                "status": 4,
                "filename": "document.docx",
                "word_count": 1500,
                "source_language": "zh-CN"
            },
            {
                "file_id": "99999999999999999",
                "status": -1,
                "filename": null,
                "word_count": null,
                "source_language": null
            }
        ]
    }
}

Get Download URL

Get the download URL for a translated file.

Status Restriction: Only files with status 4 (Translated) can get download URL. Calling this API on files that are not yet translated will return error code 91108.

Request

http
POST /api/v1/open/translate/download
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
file_idstringYesFile ID (string type)

Request Example

json
{
    "file_id": "12345678901234567"
}

Response Data

FieldTypeDescription
file_idstringFile ID
statusstringStatus: compositing - composing, completed - completed
download_urlstringDownload URL (null when compositing)
filenamestringFilename (null when compositing)
expires_inintURL expiration time in seconds (null when compositing)

Response Example (Compositing)

json
{
    "code": 0,
    "message": "success",
    "data": {
        "file_id": "12345678901234567",
        "status": "compositing",
        "download_url": null,
        "filename": null,
        "expires_in": null
    }
}

Response Example (Completed)

json
{
    "code": 0,
    "message": "success",
    "data": {
        "file_id": "12345678901234567",
        "status": "completed",
        "download_url": "https://storage.example.com/file.docx?token=xxx",
        "filename": "document_translated.docx",
        "expires_in": 300
    }
}

Delete File

Delete an uploaded file.

Request

http
POST /api/v1/open/files/delete
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
file_idstringYesFile ID (string type)

Request Example

json
{
    "file_id": "12345678901234567"
}

Response Data

FieldTypeDescription
file_idstringFile ID
deletedbooleanWhether deletion was successful

Response Example

json
{
    "code": 0,
    "message": "success",
    "data": {
        "file_id": "12345678901234567",
        "deleted": true
    }
}

Error Codes

Authentication Related (910xx)

Error CodeDescription
91000API Key is required
91001Invalid API Key
91002API Key has expired
91003API Key is disabled
91004API Key is not yet effective
91005Customer not found
91006Rate limit exceeded

File Translation Related (911xx)

Error CodeDescription
91100File size exceeds the limit
91101File type not supported
91102File upload failed
91103File not found
91104File status does not allow this operation
91105Insufficient account balance
91106Refund failed, balance record not found
91107Task not found
91108Task not completed, cannot download
91109Translated file not found
91110Failed to get download URL
91111File is being translated, cannot operate

Language Code Reference

The following are common language codes (for the complete list, call the /api/v1/open/languages API):

CodeLanguage
zh-CNChinese (Simplified)
zh-TWChinese (Traditional)
en-USEnglish
jaJapanese
koKorean
deGerman
frFrench
esSpanish
ptPortuguese
ruRussian
arArabic
thThai
viVietnamese
idIndonesian
msMalay

Usage Examples

Python Example

python
import requests

BASE_URL = "https://api.example.com/api/v1/open"
API_KEY = "your_api_key"

headers = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json"
}

# 1. Upload file
with open("document.docx", "rb") as f:
    files = {"file": f}
    data = {"is_can_edit": "true"}
    response = requests.post(
        f"{BASE_URL}/files/upload",
        files=files,
        data=data,
        headers={"X-API-Key": API_KEY}
    )
    file_id = response.json()["data"]["file_id"]

# 2. Submit translation
response = requests.post(
    f"{BASE_URL}/translate/submit",
    json={
        "file_id": int(file_id),
        "source_language": "zh-CN",
        "target_language": "en-US",
        "trans_mode": "deep"
    },
    headers=headers
)

# 3. Query status
response = requests.post(
    f"{BASE_URL}/files/status",
    json={"file_ids": [file_id]},
    headers=headers
)
status = response.json()["data"]["files"][0]["status"]

# 4. Get download URL (after translation is complete)
response = requests.post(
    f"{BASE_URL}/translate/download",
    json={"file_id": file_id},
    headers=headers
)
download_url = response.json()["data"]["download_url"]

cURL Example

bash
# Get supported languages
curl -X GET "https://api.example.com/api/v1/open/languages" \
  -H "X-API-Key: your_api_key"

# Upload file
curl -X POST "https://api.example.com/api/v1/open/files/upload" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.docx" \
  -F "is_can_edit=true"

# Submit translation
curl -X POST "https://api.example.com/api/v1/open/translate/submit" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"file_id": 12345678901234567, "source_language": "zh-CN", "target_language": "en-US", "trans_mode": "deep"}'

# Query status
curl -X POST "https://api.example.com/api/v1/open/files/status" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"file_ids": ["12345678901234567"]}'