Invoke Alibaba Cloud Bailian applications via the OpenAI-compatible Responses API
The Responses API provides an OpenAI-compatible interface for invoking Alibaba Cloud Bailian applications (including agent and workflow applications). You can reuse existing OpenAI codebases or rapidly integrate tools from the OpenAI ecosystem.
The Responses API supports two invocation modes:
Invocation Methods
The Responses API supports two invocation modes:
| Mode | Use Case | Description |
|---|---|---|
| Synchronous Invocation | Real-time interaction requiring immediate results | Wait for the full response to return after sending the request |
| Asynchronous Invocation | Long-running tasks (e.g., report generation, multi-step tool calls) | Submit the request and receive a task ID; retrieve results later via polling or callbacks |
Endpoint URLs
- SDK
base_url:https://dashscope.aliyuncs.com/api/v2/apps/agent/{APP_ID}/compatible-mode/v1/ - HTTP Endpoint:
POST https://dashscope.aliyuncs.com/api/v2/apps/agent/{APP_ID}/compatible-mode/v1/responses
Replace
{APP_ID} with your actual application ID.Prerequisites
- Obtain an API Key and configure it in your environment variables
- Create an Alibaba Cloud Bailian application and obtain its application ID
- If using the SDK, install the OpenAI Python SDK