Input and output parameters when invoking Alibaba Cloud Bailian workflow applications via the DashScope API
This document describes the input and output parameters for invoking Alibaba Cloud Bailian workflow applications through the DashScope API.
Before you begin, ensure you have completed the following steps:
The default QPM (queries per minute) limit per application is 15,000.
If the API call fails and returns an error, refer to the Error Code Documentation for troubleshooting.
Prerequisites
Before you begin, ensure you have completed the following steps:
- Create an application: Go to Application Management to create a Bailian workflow application and obtain your
app_id. - Obtain an API Key: Retrieve your API Key from API Key Management and configure it as an environment variable.
- Install the SDK (optional): If using an SDK, install the corresponding DashScope SDK for your programming language.
Invocation Methods
-
HTTP API Call
Endpoint:
POST https://dashscope.aliyuncs.com/api/v1/apps/{APP_ID}/completionReplace
{APP_ID}with your actual application ID. - SDK Call The Python and Java SDKs are preconfigured with the correct endpoint.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| app_id | string | Yes | Application identifier. Found on the application card in Application Management. |
| prompt | string | Yes | User’s input instruction. For HTTP calls, include this inside the input object. |
| session_id | string | No | Session identifier for conversation history. When provided, the request automatically includes previously stored conversation history from the cloud. |
| workspace | string | No | Business workspace identifier. Required only when invoking applications deployed under a sub-workspace. |
| stream | boolean | No | Whether to return responses in streaming mode. Default: false. |
| incremental_output | boolean | No | Whether to enable incremental output in streaming mode. Default: false. |
| biz_params | object | No | Custom parameters passed to the workflow application. |
Code Examples
Response Object
| Parameter | Type | Description |
|---|---|---|
| status_code | integer | HTTP status code. 200 indicates success. |
| request_id | string | Unique identifier for this API call. |
| code | string | Error code; empty on success. |
| message | string | Detailed error message; ignored on success. |
| output | object | Result of the invocation. |
| usage | object | Token usage and model information for this request. |
output Properties
| Parameter | Type | Description |
|---|---|---|
| text | string | Model-generated response content. |
| finish_reason | string | Reason for completion. stop indicates natural termination. |
| session_id | string | Unique identifier for the current conversation session. |
usage Properties
| Parameter | Type | Description |
|---|---|---|
| models | array | Information about models used in this request. |
| models[].model_id | string | Model ID. |
| models[].input_tokens | integer | Number of input tokens consumed. |
| models[].output_tokens | integer | Number of output tokens generated. |