Skip to main content

RunQuickWriting

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.
OperationAccess levelResource typeCondition keyDependent operation
aimiaobi:RunQuickWritingcreate
*All Resources
*
    None
None

Request parameters

NameTypeRequiredDescriptionExample value
WorkspaceIdstringYesxxxx
TaskIdstringNo

Task ID. For multi-turn conversations, the same task ID can be reused.

3f7045e099474ba28ceca1b4eb6d6e21
Articlesarray<object>No

Referenced articles

Collection
objectNo

Article object

TitlestringNo

Article title

Article title
ContentstringNo

Article content

Article content
UrlstringNo

Article URL

https://www.example.com/aaa.docx
PromptstringYes

Other writing parameters (choose either prompt or writingParams)

Please output in English
SearchSourcesarray<object>No

Use the specified search source list

objectNo

Search source object

CodestringNo

SystemSearch: system-built-in search, CustomSemanticSearch: custom semantic index search, ThirdSearch: third-party API search

SystemSearch
DatasetNamestringNo

Unique identifier of the data source

QuarkCommonNews

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
SessionIdstring

Session ID

3f7045e099474ba28ceca1b4eb6d6e21
StatusCodeinteger

HTTP response code

400
TaskIdstring

Task ID

3f7045e099474ba28ceca1b4eb6d6e21
TraceIdstring

Trace ID

Full-link trace ID
Payloadobject

Response body

Outputobject

Output

Textstring

Text generation result

Text generation result
Usageobject

Token usage information

InputTokenslong

Number of input tokens

78
OutputTokenslong

Number of output tokens

34
TotalTokenslong

Total number of tokens

38
RequestIdstring

Request ID

3f7045e099474ba28ceca1b4eb6d6e21
Endboolean

Whether the response package has ended

false

Examples

Normal response example JSON format
{
  "Header": {
    "ErrorCode": "错误码",
    "ErrorMessage": "错误信息",
    "Event": "task-started",
    "SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "StatusCode": 400,
    "TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "TraceId": "全链路ID"
  },
  "Payload": {
    "Output": {
      "Text": "文本生成结果"
    },
    "Usage": {
      "InputTokens": 78,
      "OutputTokens": 34,
      "TotalTokens": 38
    }
  },
  "RequestId": "3f7045e099474ba28ceca1b4eb6d6e21",
  "End": false
}

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-04New OpenAPIView change details