RunTextPolishing

Updated at:

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.

Debug

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 Resources is 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.

OperationAccess levelResource typeCondition keyRelated action
aimiaobi:RunTextPolishingcreate
*All Resources
*
    None
None

Request syntax

POST /quanmiao/aimiaobi/runTextPolishing HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
WorkspaceIdstringYes

The unique identifier of the Alibaba Cloud Model Studio workspace. Obtain the Workspace ID

xxxx
ContentstringYes

Text content

Text content
PromptstringNo

Custom polishing requirements

Custom polishing requirements
OriginContentstringNo

Original article

Original article content
TaskIdstringNo

Task ID. (The same task ID shares a session. The task timeout is 12 hours.)

taskld-xxxxx

Response parameters

NameTypeDescriptionExample value
object

BaseLlmResponse

Headerobject

Response header

ErrorCodestring

Error code

Error code
ErrorMessagestring

Error message

Error message
Eventstring

SSE event. task-started: started, task-finished: finished, task-failed: failed

task-started
OriginSessionIdstring

Parent session ID

3f7045e099474ba28ceca1b4eb6d6e21
SessionIdstring

Session ID

3f7045e099474ba28ceca1b4eb6d6e21
TaskIdstring

Task ID

3f7045e099474ba28ceca1b4eb6d6e21
TraceIdstring

End-to-end trace ID

Trace ID
Payloadobject

Response body

Outputobject

Output

Textstring

Text generation result

Text generation result
Usageobject

Token consumption

InputTokenslong

Number of tokens used for input

1
OutputTokenslong

Number of tokens used for output

1
TotalTokenslong

Total number of tokens used for this call

2
RequestIdstring

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 codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment

Visit the Error Center to view more error codes.

Change history

Change timeChange summaryOperation
2025-12-29OpenAPI error codes changed, OpenAPI request parameters changedView change details
2025-12-25OpenAPI error codes changed, OpenAPI request parameters changedView change details