📤 Upload File
This API uploads a document for translation. Depending on the engine parameter, the request will be routed to either the LLM (Large Language Model) engine.
📋 Basic Information
- Method:
POST - Path:
https://api.bluente.com/api/20250924/blu_translate/upload - Authentication: Required —
Authorization: Bearer $BLUENTE_API_KEY
📝 Request Parameters
Query String
| Field | Type | Required | Description |
|---|---|---|---|
glossary | string | No | Glossary option, "0" by default |
engine | int | Yes | Translation engine: 3 = LLM, 4 = LLM Pro |
Engine notes:
- LLM: Transformer-based, provides more natural and contextual translations (currently supports word-level translation only).
- LLM Pro: LLM with a larger model size, providing more accurate and context-aware translations.
Request Body (Form Data)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload |
💡 Example
curl -X POST "https://api.bluente.com/api/20250924/blu_translate/upload?glossary=0&engine=3" \
-H "Authorization: Bearer $BLUENTE_API_KEY" \
-F "file=@/path/to/document.pdf"or
const formData = new FormData();
formData.append("file", fileInput.files[0]);
fetch("https://api.bluente.com/api/20250924/blu_translate/upload?glossary=0&engine=3", {
method: "POST",
headers: {
"Authorization": "Bearer $BLUENTE_API_KEY"
},
body: formData
})✅ Success Response Example
{
"message": "success",
"code": 0,
"data": {
"id": 1,
"language": "en"
}
}📊 Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Response message, usually "success" |
code | int | Status code, 0 means success |
data | object | Main payload |
└─ id | int | Task ID — used to query the translation task status |
└─ language | string | Detected language of the uploaded document (may be empty if detection fails) |
❌ Error Response Example
{
"message": "file upload failed",
"code": 400
}📌 Notes
- The returned
idshould be used in the Query Translation Status API. - File type must be supported by the Get Supported File Types API.
- Large files may take longer to process; ensure the request is sent as
multipart/form-data. - Choose
engine=3for LLM-based translations.