Document Directory

Register as a developer and get your API key

Provides RESTful API for document translation, supporting automated translation task management, glossary-based terminology consistency, and queries for supported formats, languages, and models to facilitate seamless translation workflows and user account management.

Getting Started Guide

To begin using our services, you need to apply for developer status.Apply to become a developer

Once approved, you can create multiple API keys and include the corresponding API key in each API request as needed.

Quick Access

Base URL

https://shangyiai.com/api

Authentication Method

Authorization: [yourSecretKey]

JSON Request

Except for the file upload interface, interfaces default to POST JSON requests with Content-Type as application/json.

File Upload

Creating a document translation task uses multipart/form-data, with the file field passing in the file to be translated.

Generic Error Response

When a request fails, the interface will return JSON, and the error field contains a fixed English error message. It is recommended to prioritize handling errors by HTTP status code branching, with the error field used for display or logging.

{
  "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 parameter, invalid parameter format or enumeration value, missing file upload, upload save failed, or task processing failed.
401 Unauthorized
Missing API key or invalid API key.
402 Payment Required
Insufficient credits, unable to preview, perform full translation or text translation.
404 Not Found
This 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. Response error is fixed to "Internal Server Error".

Recommended integration process

Resources

Introduction
Developer Platform
Translation Task API
Create Translation Task