Enter writing instructions to quickly generate content.
Operation description
Access Instructions:
- The OpenAPI portal is currently incompatible with the SSE inference protocol (you cannot debug it directly). For examples of calling this operation by using the SDK, see the Miaobi best practices documentation.
- To obtain the latest version of the Java asynchronous SDK: click the link.
Debugging
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, which can be used in the Action element of a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:
- 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 are as follows:
- Required resource types are marked with a preceding *.
- For operations that do not support resource-level authorization,
全部资源is used.
- Condition key: the condition keys defined by the cloud service itself.
- Dependent operation: other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
| Operation | Access level | Resource type | Condition key | Dependent operation |
|---|---|---|---|---|
| aimiaobi:RunQuickWriting | create | *All Resources * |
| None |
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | xxxx | |
| TaskId | string | No | Task ID. For multi-turn conversations, the same task ID can be reused. | 3f7045e099474ba28ceca1b4eb6d6e21 |
| Articles | array<object> | No | Referenced articles | Collection |
| object | No | Article object | ||
| Title | string | No | Article title | Article title |
| Content | string | No | Article content | Article content |
| Url | string | No | Article URL | https://www.example.com/aaa.docx |
| Prompt | string | Yes | Other writing parameters (choose either prompt or writingParams) | Please output in English |
| SearchSources | array<object> | No | Use the specified search source list | |
| object | No | Search source object | ||
| Code | string | No | SystemSearch: system-built-in search, CustomSemanticSearch: custom semantic index search, ThirdSearch: third-party API search | SystemSearch |
| DatasetName | string | No | Unique identifier of the data source | QuarkCommonNews |
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 |
| SessionId | string | Session ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| StatusCode | integer | HTTP response code | 400 |
| TaskId | string | Task ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| TraceId | string | Trace ID | Full-link trace ID |
| Payload | object | Response body | |
| Output | object | Output | |
| Text | string | Text generation result | Text generation result |
| Usage | object | Token usage information | |
| InputTokens | long | Number of input tokens | 78 |
| OutputTokens | long | Number of output tokens | 34 |
| TotalTokens | long | Total number of tokens | 38 |
| RequestId | string | Request ID | 3f7045e099474ba28ceca1b4eb6d6e21 |
| End | boolean | Whether the response package has ended | false |
Examples
Normal response example
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 workspaceId assignment |
Change history
| Change time | Change summary | Operation |
|---|---|---|
| 2025-12-04 | New OpenAPI | View change details |