RunTextPolishing
Polishes the specified text.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the call succeeds, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
The following table describes the authorization information for this 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:
-
Operation: the specific permission point.
-
Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization for the operation. Details:
- Required resource types are marked with a preceding asterisk (*).
- For operations that do not support resource-level authorization,
All Resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Related action: other permissions required to successfully perform the operation. The caller must also have the permissions of the related actions for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Related action |
|---|---|---|---|---|
| aimiaobi:RunTextPolishing | create | *All Resources * |
| None |
Request syntax
POST /quanmiao/aimiaobi/runTextPolishing HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The unique identifier of the Alibaba Cloud Model Studio workspace. Obtain the Workspace ID | xxxx |
| Content | string | Yes | Text content | Text content |
| Prompt | string | No | Custom polishing requirements | Custom polishing requirements |
| OriginContent | string | No | Original article | Original article content |
| TaskId | string | No | Task ID. (The same task ID shares a session. The task timeout is 12 hours.) | taskld-xxxxx |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| object | BaseLlmResponse | ||
| Header | object | Response header | |
| ErrorCode | string | Error code | Error code |
| ErrorMessage | string | Error message | Error message |
| Event | string | SSE event. task-started: started, task-finished: finished, task-failed: failed | task-started |
| OriginSessionId | string | Parent session ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| SessionId | string | Session ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| TaskId | string | Task ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| TraceId | string | End-to-end trace ID | Trace ID |
| Payload | object | Response body | |
| Output | object | Output | |
| Text | string | Text generation result | Text generation result |
| Usage | object | Token consumption | |
| InputTokens | long | Number of tokens used for input | 1 |
| OutputTokens | long | Number of tokens used for output | 1 |
| TotalTokens | long | Total number of tokens used for this call | 2 |
| RequestId | string | Unique request identifier | 3f7045e099474ba28ceca1b4eb6d6e21 |
Examples
Success response
JSON format
{
"Header": {
"ErrorCode": "错误码",
"ErrorMessage": "错误信息",
"Event": "task-started",
"OriginSessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
"SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
"TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
"TraceId": "全链路ID"
},
"Payload": {
"Output": {
"Text": "文本生成结果"
},
"Usage": {
"InputTokens": 1,
"OutputTokens": 1,
"TotalTokens": 2
}
},
"RequestId": "3f7045e099474ba28ceca1b4eb6d6e21"
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Please check the workspaceId assignment |
Visit the Error Center to view more error codes.
Change history
| Change time | Change summary | Operation |
|---|---|---|
| 2025-12-29 | OpenAPI error codes changed, OpenAPI request parameters changed | View change details |
| 2025-12-25 | OpenAPI error codes changed, OpenAPI request parameters changed | View change details |