Translate

AI Smart Translation

0calls
4 credits / call

This is a high-quality intelligent translation service that supports multiple translation styles and professional scenarios, suitable for business scenarios with higher requirements for translation quality.

POST
uapis.cn
/api/v1/ai/translate
Query parameters
1
target_lang
string
required
Target language code. Please select a language code from the .
Body
text
string
required

Text content to be translated. Max length 10,000 characters.

source_lang
string

Source language code, optional. If not specified, the system will automatically detect the source language.

style
string

Translation style, optional. Supports casual (casual conversational), professional (professional business, default), academic (academic formal), literary (literary artistic).

context
string

Translation context scenario, optional. Supports general (general, default), business (business), technical (technical), medical (medical), legal (legal), marketing (marketing), entertainment (entertainment), education (education), news (news).

preserve_format
boolean

Whether to preserve the original text format, including line breaks, indentation, etc.

Overview

  • Single Text Translation: Focuses on processing single text translations, suitable for business scenarios requiring high-quality translations.
  • Multi-style Adaptation: Provides four translation styles: casual conversational, professional business, academic formal, and literary artistic, able to adjust language style and expression according to different scenario needs.
  • Context Awareness: Supports context-aware translation in nine professional fields: general, business, technical, medical, legal, marketing, entertainment, education, and news, ensuring terminology accuracy and authentic expression.
  • Format Preservation: Intelligently recognizes and preserves the format structure of the original text, including line breaks, indentation, special symbols, etc., ensuring good readability of the translated text.

Supported Languages

We support mutual translation between over 100 languages, see parameter list below for details.

Query parameters

target_lang
stringrequired
Target language code. Please select a language code from the .

Request body

text
stringrequired

Text content to be translated. Max length 10,000 characters.

source_lang
stringoptional

Source language code, optional. If not specified, the system will automatically detect the source language.

style
stringoptional

Translation style, optional. Supports casual (casual conversational), professional (professional business, default), academic (academic formal), literary (literary artistic).

context
stringoptional

Translation context scenario, optional. Supports general (general, default), business (business), technical (technical), medical (medical), legal (legal), marketing (marketing), entertainment (entertainment), education (education), news (news).

preserve_format
booleanoptional

Whether to preserve the original text format, including line breaks, indentation, etc.

Response

200 / OK

Translation successful! Returns translation results and performance statistics.

JSON
{
  "message": "Translation completed successfully",
  // Detailed information about the translation result.
  "data": {
    "translated_text": "Hello, how are you today?"
  },
  "performance": {
    "processing_time_ms": 850
  },
  // Whether this is a batch translation request.
  "is_batch": false
}

400 / Bad Request

Request parameter error. Please check if required parameters and parameter formats are correct.

JSON
{
  "code": 400,
  "message": "Invalid request parameters",
  "error": "'text' must be provided"
}

401 / Unauthorized

Authentication failed. Please check if the API key is valid.

JSON
{
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing API token"
}

429 / Too Many Requests

Request rate too high. Please try again later.

JSON
{
  "code": 429,
  "message": "Rate limit exceeded",
  "error": "Too many requests, please try again later"
}

500 / Internal Server Error

Translation service internal error. Please try again later or contact technical support.

JSON
{
  "code": 500,
  "message": "Translation service error",
  "error": "Translation request failed"
}