Theme
Qwen Responses
Create responses with an OpenAI Responses API–compatible format (Qwen). Supports multimodal input, tool calling, streaming, and context compaction.
http
POST /v1/responsesThe Responses API targets multimodal workflows, tool calling, and context continuation. Compared with Qwen Chat Completions, its input/output and tool-call structure is better suited to complex task orchestration.
The default model is .
Available models
| Model | Description |
|---|---|
| Qwen 3.7 high-spec model | |
| Qwen 3.7 enhanced model | |
| Qwen 3.6 enhanced model | |
| Qwen 3.5 enhanced model |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Request authentication. Use a Bearer Token, for example: | |
| string | Yes | Request content type; must be |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Model name; default example ; see Available models above | |
| string | array | No | Model input: a plain text string, or an array of text / image / file input items | |
| string | No | System (developer) message; not automatically inherited when used with | |
| object | No | Reasoning config for Qwen reasoning capability | |
| object | No | Text output config (, ) | |
| array | No | Callable tools (built-in / MCP / function) | |
| string | object | No | Tool selection: / / , or a specific tool object | |
| boolean | No | Whether to allow parallel tool calls; default | |
| integer | No | Upper bound on tokens generated per response (visible output plus reasoning tokens); minimum | |
| integer | No | Maximum total built-in tool calls in a single response | |
| number | No | Sampling temperature, range –, default | |
| number | No | Nucleus sampling, range –, default | |
| integer | No | –; number of candidate token log probabilities to return | |
| boolean | No | Whether to stream via SSE; default | |
| object | No | Streaming options; only effective when | |
| boolean | No | Whether to run asynchronously in the background; default | |
| boolean | No | Whether to store the response for later retrieval; default | |
| object | No | Up to 16 key-value metadata pairs | |
| array | No | Extra output data to include (e.g. retrieval results, logprobs) | |
| string | No | Deprecated. Truncation strategy: / (default) | |
| string | No | Previous response ID for multi-turn continuation; cannot be used with | |
| string | object | No | Conversation ID or ; cannot be used with | |
| object | No | Reusable prompt template ( / / ) | |
| string | No | Prompt cache bucket key | |
| object | No | Cache options (, ); supported by Qwen models | |
| string | No | Stable end-user identifier, up to 64 characters | |
| string | No | Processing tier: / / / / / | |
| string | No | Deprecated; use / | |
| object | No | Content moderation config | |
| array | No | Long-context management config |
reasoning
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | / / / / / / ; default | |
| string | No | / / |
text
| Name | Type | Required | Description |
|---|---|---|---|
| object | No | Default ; can use / | |
| string | No | / / ; default |
stream_options
| Name | Type | Required | Description |
|---|---|---|---|
| boolean | No | Stream obfuscation field; can be disabled on trusted links to save bandwidth. Usage is typically returned on |
prompt
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Prompt template ID | |
| string | No | Template version | |
| object | No | Template variables |
Request example
bash
curl -X POST https://octopusx.ai/v1/responses \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"instructions": "You are a concise technical assistant.",
"input": "Explain in three sentences what scenarios the Responses API is good for."
}'bash
curl -X POST https://octopusx.ai/v1/responses \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"input": [
{
"type": "input_text",
"text": "Describe the main content of this image."
},
{
"type": "input_image",
"image_url": "https://example.com/image.png"
}
]
}'bash
curl -X POST https://octopusx.ai/v1/responses \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"input": "Look up the weather in Hangzhou today.",
"tools": [
{
"type": "function",
"name": "get_weather",
"description": "Get weather by city",
"parameters": {
"type": "object",
"properties": {
"city": { "type": "string" }
},
"required": ["city"]
}
}
],
"tool_choice": "auto"
}'bash
curl -X POST https://octopusx.ai/v1/responses \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"input": "Explain the advantages of the Responses API step by step.",
"stream": true
}'Response example
json
{
"id": "resp_abc123",
"object": "response",
"created_at": 1735689600,
"status": "completed",
"model": "qwen3.7-max",
"output": [
{
"type": "message",
"id": "msg_abc123",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The Responses API fits multimodal input, tool calling, and tasks that need context continuation. It splits output into structured items that are easy for programs to read. Through a unified gateway you can reuse the same auth, billing, and channel routing.",
"annotations": []
}
]
}
],
"usage": {
"prompt_tokens": 26,
"completion_tokens": 62,
"total_tokens": 88
}
}Response fields
| Name | Type | Description |
|---|---|---|
| string | Response ID | |
| string | Always | |
| integer | Creation timestamp (seconds) | |
| string | Status, e.g. | |
| string | Model actually used | |
| array | Structured output items | |
| string | Output item type, e.g. | |
| array | Content parts (e.g. ) | |
| object | Token usage | |
| integer | Input tokens | |
| integer | Output tokens | |
| integer | Total tokens |
Context compaction
POST /v1/responses/compact compresses a long context into a summary that can continue later. The request shape is close to /v1/responses; common fields are model, input, instructions, and previous_response_id.
bash
curl -X POST https://octopusx.ai/v1/responses/compact \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.7-max",
"instructions": "Compress into context that later turns can continue from; keep decisions, constraints, and todos.",
"input": [
{ "role": "user", "content": "Round 1 requirements..." },
{ "role": "assistant", "content": "Round 1 proposal..." }
]
}'Notes
TIP
Whether optional parameters take effect depends on the upstream model’s capabilities. In the debugger, non-required fields are off by default and are only written into the request body when you enable them.
WARNING
previous_response_id and conversation cannot be used together. Streaming usage is typically returned via the response.completed event.