tencent cloud

APIs

ImageTranslateLLM

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-08-06 18:48:02

1. API Description

Domain name for API request: tmt.intl.tencentcloudapi.com.

This API is used to provide translation service for images in 18 languages. It can automatically recognize text content in images and translate it into the target language. The recognized text is translated line by line, and a version that supports paragraph translation will be offered subsequently.

-Input image format: png, jpg, jpeg and other common image formats. gif animation is not supported.
-Output image format: jpg.

Notification: For general developers, we recommend prioritizing SDK integration to simplify development. For SDK usage introduction, directly view the 5. Developer Resources part.

A maximum of 1 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ImageTranslateLLM.
Version Yes String Common Params. The value used for this API: 2018-03-21.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Data Yes String

Base64 string of the image data, no more than 9M after Base64 encoding. A resolution of 600*800 or higher is recommended. PNG, JPG, and JPEG formats are supported.

Target Yes String

Target language, supported languages:

  • Chinese: zh
  • Traditional (Taiwan): zh-TW
  • Traditional (Hong Kong (China)): zh-HK
  • English: en
  • Japanese: ja
  • Korean: ko
  • Thai: th
  • Vietnamese: vi
  • Russian: ru
  • German: de
  • French: fr
  • Arabic: ar
  • Spanish: es
  • Italian: it
  • Indonesian: id
  • Malay language: ms
  • Portuguese: pt
  • Turkish: tr
    -
Url No String

Enter image Url. When using a Url, the Data parameter requires the input of "". Image restrictions: less than 10MB, resolution recommendation 600*800 or higher, format support jpg, jpeg, png.

Mode No Integer

Invocation method.

Enumeration value:

  • 0: End-to-end image translation large model pro version
  • 1: End-to-end image translation large model lite version

Default value: 0

3. Output Parameters

Parameter Name Type Description
Data String

Base64 string of the image data. The output format is JPG.

Source String

Primary source language.

Target String

Target translation language.

SourceText String

All original text in the image.

TargetText String

All translations in the image.

Angle Float

Image angle counterclockwise, value range 0-359

TransDetails Array of TransDetail

Translation detailed information

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Calling the API

Input Example

POST / HTTP/1.1
Host: tmt.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ImageTranslateLLM
<Common request parameters>

{
    "Data": "/9j/4AAQSkZJRg...rF530LvvALAD5Mkgv0ULqKbuJJbW5en/9k=",
    "Target": "en",
    "Url": null
}

Output Example

{
    "Response": {
        "Angle": 270,
        "Data": "/9j/4AAQSkZJRg...rF530LvvALAD5Mkgv0ULqKbuJJbW5en/9k=",
        "RequestId": "defb956d-xxxx-xxxx-xxxx-2595b7bc2c28",
        "Source": "en",
        "SourceText": "hello.",
        "Target": "zh",
Hello.
        "TransDetails": [
            {
                "BoundingBox": {
                    "Height": 90,
                    "Width": 518,
                    "X": 348,
                    "Y": 147
                },
                "LineHeight": 0,
                "LinesCount": 0,
                "RotateParagraphRect": {
                    "Coord": [
                        {
                            "X": 348,
                            "Y": 147
                        },
                        {
                            "X": 866,
                            "Y": 147
                        },
                        {
                            "X": 866,
                            "Y": 238
                        },
                        {
                            "X": 348,
                            "Y": 238
                        }
                    ],
                    "TiltAngle": 0,
                    "Valid": false
                },
                "SourceLineText": "hello.",
                "SpamCode": 0,
Hello.
            }
        ]
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.DecodeErr Image decoding failed
FailedOperation.DownloadErr Image download error
FailedOperation.ErrorUserArea User region differs from requested service area.
FailedOperation.NoFreeAmount The free quota for this month is used up. To continue to use the service, you need to upgrade to a paid account in the TMT console.
FailedOperation.ServiceIsolate The service is suspended due to overdue payments. Top up your account first.
FailedOperation.StopUsing Services for the account has been stopped.
FailedOperation.UserNotRegistered The service is not activated. Activate it in the TMT console first.
InternalError Internal error.
InternalError.BackendTimeout Backend service timeout. Please try again later.
InternalError.ErrorUnknown Unknown error.
InternalError.RequestFailed Request failed.
InvalidParameter Invalid parameter.
InvalidParameter.MissingParameter Invalid parameter.
LimitExceeded The quota limit is reached.
MissingParameter Missing parameter.
UnauthorizedOperation.ActionNotFound Incorrect name entered in the Action field.
UnsupportedOperation Unsupported operation.
UnsupportedOperation.UnSupportedTargetLanguage Unsupported target language. Please refer to the supported language list.
UnsupportedOperation.UnsupportedLanguage Unsupported language. Please refer to the supported language list.
UnsupportedOperation.UnsupportedSourceLanguage Unsupported source language. Please refer to the supported language list.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백