Create long-form scripts.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Debug
RAM authorization
The following table describes the authorization information for this API. You can use the Action element in a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. Details:
- 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 support authorization for the action. Details:
- Required resource types are marked with a leading asterisk (*).
- For actions that do not support resource-level authorization,
All resourcesis 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 also have the permissions of the dependent actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| quanmiaolightapp:RunScriptChat | none | *All resources * |
| None |
Request syntax
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | Unique identifier of the Alibaba Cloud Model Studio workspace. To get this ID, see Workspace ID. | llm-rz8db8d00rcn2p0xc |
| prompt | string | Yes | Script instruction entered by the user. | Create character: Lin Xiaoxiao |
| taskId | string | No | Unique identifier of the task. Note | a3d1c2ac-f086-4a21-9069-f5631542f5a2 |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| end | boolean | Whether the output is complete. true indicates that the output is complete. | true |
| header | object | Header for streaming output, which contains general response information. | |
| errorCode | string | Error code for exceptions. | 403 |
| errorMessage | string | Error message for exceptions. | Pop sign mismatch, please check log. |
| event | string | Event type. | result-generated |
| eventInfo | string | Event description. | Model generation event description |
| requestId | string | Request ID. | F8A35034-EDCF-5C50-95A5-1044316F36E3 |
| sessionId | string | Session ID. | 147648697127_914847410985_1730600302167 |
| taskId | string | Generation task ID. | d3be9981-ca2d-4e17-bf31-1c0a628e9f99 |
| traceId | string | Trace ID. | 2150432017236011824686132ecdbc |
| payload | object | Payload of the response, in JSON structure. | |
| output | object | Output content object. | |
| text | string | Output content. | The following is character information |
| usage | object | LLM token usage information. | |
| inputTokens | long | Number of input tokens. | 100 |
| outputTokens | long | Number of output tokens. | 100 |
| totalTokens | long | Total number of tokens. | 200 |
Examples
Success response
JSON format
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action , Please check the assignment of the workspaceId. | Check the assignment of the workspaceId. |