Skip to main content

RunDocTranslation

An API for document translation between English and Chinese.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.
  • API: The API that you can call to perform the action.
  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.
    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.
  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

aimiaobi:RunDocTranslation

get

*All Resource

*

NoneNone

Request syntax

POST /miaodu/stream/runDocTranslation HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

Alibaba Cloud Model Studio workspace unique identifier. For more information, see Get the Workspace ID.

llm-xxx

SessionId

string

Yes

Session ID

2e6b3987-f743-4d4c-8326-d9c41a6af3ee

DocId

string

No

Document ID

12345

TransType

string

No

Translation type

toChinese toEnglish toJapenese toRussian toFrench toGerman toItalian toKorean toSpanish toPortuguese

RecommendContent

string

No

Content to be translated

Content to be translated

CleanCache

boolean

No

Clear the current cache?

true

ModelName

string

No

User-defined model name

quanmiao-max, quanmiao-plus

Response elements

Element

Type

Description

Example

object

Response schema

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

Outputs

Content

string

Translated content

Translated content

Usage

object

Token usage

InputTokens

integer

Number of tokens used for input

100

OutputTokens

integer

Number of tokens used for output

100

TotalTokens

integer

Total number of tokens used for this call

200

RequestId

string

Request ID

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

Examples

Success response 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 code

Error code

Error message

Description

403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment
See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.
Token Plan
Model Playground
  • 3D model generation
  • Audio generation
Fine-tuning
Model Compression
Statistics and Monitoring
Support