/api/v2/apps/protocols/compatible-mode/v1/responses is no longer maintained and its functionality is no longer guaranteed. Migrate to the new path /compatible-mode/v1/responses as soon as possible.Compatibility and limitations
This API is OpenAI-compatible, but key differences exist in parameters, features, and behaviors.
Requests process only the parameters listed in this document. Any OpenAI parameters not mentioned are ignored.
Key differences:
-
Unsupported parameters: Some parameters are not supported, such as
background(synchronous only). -
Reasoning effort control: Use the
reasoning.effortparameter to control the model's reasoning effort. For usage details, see the parameter description below. -
Additional parameters: Supports extra parameters beyond OpenAI's spec, such as
enable_thinking(deprecated, usereasoning.effortinstead). - Effortless context caching: Enable automatic server-side caching for multi-turn conversations with a single request header. See Session Cache.
- Context limit: To reserve space for built-in tool calls and reasoning generation, the maximum input context of the Responses API is approximately 80% of the model's context window (leaving a buffer of about 20%). Any excess is automatically truncated without raising an error or interrupting the request.
Authorizations
DashScope API key.
Header Parameters
Controls session cache for multi-turn conversations using previous_response_id. When enabled, the server automatically caches conversation context to reduce latency and cost.
enable: Enables session cache. Cache creation tokens are billed at 125% of the standard input price; cache hits at 10%. Cache is valid for 5 minutes (resets on hit). Minimum 1024 tokens for cache creation.disable(default): Disables session cache. Falls back to implicit cache if supported by the model.
Caching behavior:
- Session cache enabled:
- Model supports explicit cache: Uses explicit cache. For billing and constraints, see Explicit cache.
- Model does not support explicit cache but supports implicit cache: Uses implicit cache. For billing and constraints, see Implicit cache.
- Session cache not enabled: Same as normal API calls. Implicit cache is still automatically enabled for models that support it, but without the session cache benefits.
Pass via SDK: default_headers (Python) or defaultHeaders (Node.js).
To confirm whether the cache was hit, check usage.input_tokens_details.cached_tokens in the response. A value greater than 0 indicates a cache hit.
Body
application/jsonThe model name. Supported models include qwen3.8-max, qwen3.8-max-0902, qwen3.8-flash, qwen3.7-max, qwen3.7-max-2026-06-08, qwen3.7-max-2026-05-20, qwen3.7-max-2026-05-17, qwen3.7-max-preview, qwen3.7-plus, qwen3.7-plus-2026-05-26, qwen3.6-plus, qwen3.6-plus-2026-04-02, qwen3.8-2.4t-a95b, qwen3.8-27b, qwen3.8-omni-flash, qwen3.6-35b-a3b, qwen3.5-plus, qwen3.5-plus-2026-04-20, qwen3.5-plus-2026-02-15, qwen3.7-flash, qwen3.7-flash-2026-07-15, qwen3.6-flash, qwen3.6-flash-2026-04-16, qwen3.5-flash, qwen3.5-flash-2026-02-23, qwen3.5-397b-a17b, qwen3.5-122b-a10b, qwen3.5-27b, qwen3.5-35b-a3b, deepseek-v4.1-flash, deepseek-v4.1-flash-1017, deepseek-v4-pro-0813, deepseek-v4-pro, deepseek-v4-flash-0731, glm-5.3, glm-5.2, kimi-k3.1-pro, and kimi-k3.
Model availability varies by region; see Regions and endpoints before selecting a model and endpoint.
Other QwenCloud text generation models not listed above only support basic compatibility. Agent capabilities (such as built-in tools) are limited.
The input content for the model. Supports a plain text string or an array of messages in conversation order.
A system instruction inserted at the beginning of the context. When previous_response_id is used, the instructions specified in the previous turn are not carried over to the current context.
The unique ID of the previous response. The current response id is valid for 7 days. You can use this parameter to create a multi-turn conversation. The server automatically retrieves and combines the input and output of that turn as context. If both an input message array and previous_response_id are provided, the new messages in input are appended to the historical context. Cannot be used together with conversation. For usage examples, see the Multi-turn conversations guide.
The conversation to which the current response belongs. Historical items in the conversation are automatically passed as context to the current request. The input and output of the current request are also automatically added to the conversation after the response completes. Cannot be used together with previous_response_id.
Specifies whether to enable streaming output. If this parameter is set to true, the model response data is streamed back to the client in real time.
Specifies whether to store the model response generated for this session.
true: The response is stored. The current model response can be referenced byprevious_response_idand subsequent API calls.false: The response is not stored and cannot be referenced in subsequent calls viaprevious_response_id.
A list of tools the model can use. Supported tool types: web_search, code_interpreter, web_extractor, web_search_image, image_search, file_search, mcp, function.
kimi-k3.1-pro (deployed on QwenCloud) supports the built-in web_search, web_extractor, and code_interpreter tools in all regions: Singapore, China North 2 (Beijing), Germany (Frankfurt), China (Hong Kong), Japan (Tokyo), and US (Virginia).
deepseek-v4.1-flash-1017 supports the three built-in tools web_search, web_extractor, and code_interpreter.
For qwen3.8-omni-flash, the only supported built-in tool is web_search. Custom function tools are also supported.
Built-in tools use {"type": "<tool_name>"} format. For example: {"type": "web_search"}.
MCP tools use the following format:
Function tools use the following format:
Controls how the model selects and calls tools. Supports string format and object format.
String format:
auto: The model automatically decides whether to call a tool.none: Prevents the model from calling any tool.required: Forces the model to call a tool. Available only when there is a single tool in the tools list.
Object format: Specifies the range of available tools for the model. The model can select and call tools only from the predefined list.
Specifies whether to enable parallel tool calling.
kimi-k3 does not support using this parameter to control whether tool calls are parallel. Setting it to false does not guarantee sequential tool calls; the model may still return multiple function_call items in one response. Process the returned tool calls as provided.
The sampling temperature that controls the diversity of the generated text. A higher temperature results in more diverse text. A lower temperature results in more deterministic text. Value range: [0, 2). Both temperature and top_p control the diversity of the generated text. We recommend that you set only one of them.
The probability threshold for nucleus sampling that controls the diversity of the generated text. A higher top_p value results in more diverse text. A lower top_p value results in more deterministic text. Value range: (0, 1.0]. Both temperature and top_p control the diversity of the generated text. We recommend that you set only one of them.
Specifies whether to enable thinking mode. If set to true, the model thinks before replying. The thinking content is returned through an output item of the reasoning type. Reasoning tokens are counted in output_tokens_details.reasoning_tokens and are billed as reasoning tokens. When thinking mode is enabled, we recommend enabling the built-in tools to achieve the best model performance on complex tasks.
This is not a standard OpenAI parameter. The Python SDK passes it using extra_body={"enable_thinking": True}. The Node.js SDK and curl use enable_thinking: true directly as a top-level parameter. We recommend using reasoning.effort instead, as enable_thinking will be deprecated.
Controls the model's reasoning effort. The model performs a reasoning step before replying, and the reasoning process is returned through an output item of type reasoning. reasoning.effort takes precedence over enable_thinking. We recommend using reasoning.effort, as enable_thinking will be deprecated.
OCR built-in task parameters. Only applicable to the qwen3.5-ocr model, which is available only in China North 2 (Beijing); use the cn-beijing endpoint. Use this parameter to call built-in OCR tasks (such as information extraction and text localization). Built-in task results are returned in the ocr_result field of the response.
When parsing PDF files, the value of task determines the supported page count: up to 50 pages when task is set to document_parsing; up to 10 pages when task is not set or is set to another task.
This parameter is not a standard OpenAI parameter. In the Python SDK, pass it using extra_body={"ocr_options": {...}}. In the Node.js SDK and curl, use ocr_options as a top-level parameter.
The maximum number of output tokens. Minimum value is 16.
- Qwen3.8 series: The maximum total number of tokens in both the model's response content and chain-of-thought content combined.
- Other models: The maximum number of tokens in the model's response content.
If the model output exceeds this value, generation stops early and the status is incomplete.
Configuration for the model's text output. The output can be plain text or structured JSON data.
Response
The unique ID for this response. It is valid for 7 days. You can use this parameter in the previous_response_id parameter to create a multi-turn conversation.
The Unix timestamp in seconds for this request.
The object type. The value is response.
The status of the response generation.
The ID of the model that is used to generate the response.
An array of output items generated by the model. The type and order of elements in the array depend on the model's response.
Whether parallel tool calls are enabled.
The value of the tool_choice parameter from the echo request. Valid values are auto, none, and required.
The complete content of the tools parameter from the echo request. The structure is the same as the tools parameter in the request body.
The error object that is returned when the model fails to generate a response. This field is null on success.
Tool usage statistics for this request, recorded separately from model token usage in usage. When no tools are called, this field defaults to an empty object {}.
The token consumption information for this request.