An API for document translation between English and Chinese.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the API runs successfully, OpenAPI Explorer can automatically generate SDK code examples.
Debug
Authorization information
The following table describes the authorization information of the API. You can use it in the Action element of a RAM permission policy statement to grant a RAM user or RAM role the permission to call this API. Details are as follows:
- Action: the specific permission point.
- Access level: the access level of each action. Valid values: Write, Read, or List.
-
Resource type: the resource types that the action supports for authorization. Details:
- Required resource types are marked with a preceding asterisk (*).
- For actions that do not support resource-level authorization, All Resources is used.
- Condition key: the condition keys defined by the cloud service itself.
- Dependent action: other permissions required to successfully perform the action. The caller must have the permissions of all dependent actions for the action to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| aimiaobi:RunDocTranslation | get | *All Resources * |
| None |
Request syntax
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | Alibaba Cloud Model Studio workspace unique identifier: Get the workspace ID (Workspace ID) | llm-xxx |
| SessionId | string | Yes | Conversation ID | 2e6b3987-f743-4d4c-8326-d9c41a6af3ee |
| DocId | string | No | Document ID | 12345 |
| TransType | string | No | Translation method | toChinese toEnglish toJapenese toRussian toFrench toGerman toItalian toKorean toSpanish toPortuguese |
| RecommendContent | string | No | Content to translate | Content to translate |
| CleanCache | boolean | No | Whether to clear the current cache | true |
| ModelName | string | No | User-defined model name | quanmiao-max, quanmiao-plus |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| Header | object | Response header | |
| ErrorCode | string | Error code | success |
| ErrorMessage | string | Error code message | success |
| Event | string | Event type | task-started |
| EventInfo | string | Event description | Model generation event |
| SessionId | string | Session ID | 411c4dfa-2168-4379-a902-675d67f453f8 |
| TaskId | string | Task ID | 50a1cc8e-717e-4a2b-a76b-dc9734a8564b |
| TraceId | string | Trace ID | ebd19b12-0cae-488f-9e41-5a1c825f545b |
| Payload | object | Response body | |
| Output | object | Output | |
| Content | string | Translated content | Translated content |
| Usage | object | Token usage | |
| InputTokens | long | Number of tokens used for input | 100 |
| OutputTokens | long | Number of tokens used for output | 100 |
| TotalTokens | long | Total number of tokens used in this call | 200 |
| RequestId | string | Request ID | 1813ceee-7fe5-41b4-87e5-982a4d18cca5 |
Examples
Success response example
JSON format
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Check the workspaceId assignment |