Skip to content

Qwen Responses

Create responses with an OpenAI Responses API–compatible format (Qwen). Supports multimodal input, tool calling, streaming, and context compaction.

http
POST /v1/responses

The 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

ModelDescription
Qwen 3.7 high-spec model
Qwen 3.7 enhanced model
Qwen 3.6 enhanced model
Qwen 3.5 enhanced model

Headers

NameTypeRequiredDescription
stringYesRequest authentication. Use a Bearer Token, for example:
stringYesRequest content type; must be

Request body

NameTypeRequiredDescription
stringYesModel name; default example ; see Available models above
string | arrayNoModel input: a plain text string, or an array of text / image / file input items
stringNoSystem (developer) message; not automatically inherited when used with
objectNoReasoning config for Qwen reasoning capability
objectNoText output config (, )
arrayNoCallable tools (built-in / MCP / function)
string | objectNoTool selection: / / , or a specific tool object
booleanNoWhether to allow parallel tool calls; default
integerNoUpper bound on tokens generated per response (visible output plus reasoning tokens); minimum
integerNoMaximum total built-in tool calls in a single response
numberNoSampling temperature, range , default
numberNoNucleus sampling, range , default
integerNo; number of candidate token log probabilities to return
booleanNoWhether to stream via SSE; default
objectNoStreaming options; only effective when
booleanNoWhether to run asynchronously in the background; default
booleanNoWhether to store the response for later retrieval; default
objectNoUp to 16 key-value metadata pairs
arrayNoExtra output data to include (e.g. retrieval results, logprobs)
stringNoDeprecated. Truncation strategy: / (default)
stringNoPrevious response ID for multi-turn continuation; cannot be used with
string | objectNoConversation ID or ; cannot be used with
objectNoReusable prompt template ( / / )
stringNoPrompt cache bucket key
objectNoCache options (, ); supported by Qwen models
stringNoStable end-user identifier, up to 64 characters
stringNoProcessing tier: / / / / /
stringNoDeprecated; use /
objectNoContent moderation config
arrayNoLong-context management config

reasoning

NameTypeRequiredDescription
stringNo / / / / / / ; default
stringNo / /

text

NameTypeRequiredDescription
objectNoDefault ; can use /
stringNo / / ; default

stream_options

NameTypeRequiredDescription
booleanNoStream obfuscation field; can be disabled on trusted links to save bandwidth. Usage is typically returned on

prompt

NameTypeRequiredDescription
stringYesPrompt template ID
stringNoTemplate version
objectNoTemplate 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

NameTypeDescription
stringResponse ID
stringAlways
integerCreation timestamp (seconds)
stringStatus, e.g.
stringModel actually used
arrayStructured output items
stringOutput item type, e.g.
arrayContent parts (e.g. )
objectToken usage
integerInput tokens
integerOutput tokens
integerTotal 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.