Skip to main content

RunDocTranslation

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.
ActionAccess levelResource typeCondition keyDependent action
aimiaobi:RunDocTranslationget
*All Resources
*
    None
None

Request syntax

POST /miaodu/stream/runDocTranslation HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
WorkspaceIdstringYes

Alibaba Cloud Model Studio workspace unique identifier: Get the workspace ID (Workspace ID)

llm-xxx
SessionIdstringYes

Conversation ID

2e6b3987-f743-4d4c-8326-d9c41a6af3ee
DocIdstringNo

Document ID

12345
TransTypestringNo

Translation method

toChinese toEnglish toJapenese toRussian toFrench toGerman toItalian toKorean toSpanish toPortuguese
RecommendContentstringNo

Content to translate

Content to translate
CleanCachebooleanNo

Whether to clear the current cache

true
ModelNamestringNo

User-defined model name

quanmiao-max, quanmiao-plus

Response parameters

NameTypeDescriptionExample value
object

Schema of Response

Headerobject

Response header

ErrorCodestring

Error code

success
ErrorMessagestring

Error code message

success
Eventstring

Event type

task-started
EventInfostring

Event description

Model generation event
SessionIdstring

Session ID

411c4dfa-2168-4379-a902-675d67f453f8
TaskIdstring

Task ID

50a1cc8e-717e-4a2b-a76b-dc9734a8564b
TraceIdstring

Trace ID

ebd19b12-0cae-488f-9e41-5a1c825f545b
Payloadobject

Response body

Outputobject

Output

Contentstring

Translated content

Translated content
Usageobject

Token usage

InputTokenslong

Number of tokens used for input

100
OutputTokenslong

Number of tokens used for output

100
TotalTokenslong

Total number of tokens used in this call

200
RequestIdstring

Request ID

1813ceee-7fe5-41b4-87e5-982a4d18cca5

Examples

Success response example JSON format
{
  "Header": {
    "ErrorCode": "success",
    "ErrorMessage": "success",
    "Event": "task-started",
    "EventInfo": "模型生成事件",
    "SessionId": "411c4dfa-2168-4379-a902-675d67f453f8",
    "TaskId": "50a1cc8e-717e-4a2b-a76b-dc9734a8564b",
    "TraceId": "ebd19b12-0cae-488f-9e41-5a1c825f545b"
  },
  "Payload": {
    "Output": {
      "Content": "翻译内容"
    },
    "Usage": {
      "InputTokens": 100,
      "OutputTokens": 100,
      "TotalTokens": 200
    }
  },
  "RequestId": "1813ceee-7fe5-41b4-87e5-982a4d18cca5"
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action.Check the workspaceId assignment
Visit the Error Center for more error codes.