qwen3.7-max

Before use, press Access Basics to set SHANHAI_BASE_URL (this site’s root address) and SHANHAI_API_KEY (this site’s token). The following command is suitable for Bash; the material example address must be replaced with a real address that can be downloaded directly.

Select and bill independently with qwen3.7-plus. Supports thinking switches, thinking budgets, and multi-round thinking content retention; for complex tasks, it is recommended to explicitly set the required switches and output length.

Basic information

Request interface: POST /v1/chat/completions. Use this site token for authentication. For the differences between the three dialogue formats, tool round-trips and error handling, see General Description of Dialog Interface.

request parameters

Parameter Type Required Usage
model string is The exact model name on this page
messages array is Pass in complete conversations in chronological order, at least one
messages[].role string is system Set task, user Ask a question, assistant is the historical answer, tool is the tool result
messages[].content string / array / null Depends on the message Literal is usually a string; the tool call message can be null. The image content format is shown below. Ordinary file paths cannot be automatically uploaded as text
messages[].tool_calls array No Keep the tool calls returned by the model as they are, and return them together with the corresponding tool results
messages[].tool_call_id string Tool result required Same as the responded tool call id
max_tokens integer No Limit the output length, example 1024 is not the model upper limit; the context also includes input and historical messages
stream boolean No Default false; true Return segment by event
stream_options.include_usage boolean No cooperates with stream:true to request the end usage; empty choices and empty usage are allowed during processing
temperature number No Adjust the generated randomness; retain the model default value when not set, and may be fixed or ignored in thinking mode
top_p number No Adjust the range of candidate words, usually only one with temperature
stop string / array No Stop when encountering the specified text; do not write the end condition as a message role
response_format object No {"type":"json_object"} Request JSON, and explicitly require JSON in the message; support is limited by the model and thinking mode
tools array No Function tool definition; type is function, function is written with name, description, parameters
tool_choice string / object No auto Determined by the model; none disabled; required or specified function needs model support
parallel_tool_calls boolean No Whether parallel tool recommendations are allowed, the client should still process each call returned

Extended parameters of this model

The following fields are placed at the top level of JSON; when using the extra_body parameter of the client library, they are merged into the top level by the client library.

Parameter Type Meaning
enable_thinking boolean true turns on thinking, false turns off; omit and inherit the model default behavior
thinking_budget integer The length budget of the thinking process cannot replace the final answer length limit;
preserve_thinking boolean Whether to use historical reasoning_content for this round of thinking; 3.8 defaults to true, 3.7 defaults to false
max_completion_tokens integer Thinking and final answer of the total output limit, and max_tokens Choose one of the two
top_k integer Number of candidate words; non-negative integer, more than 100 means not filtering by top_k, default 20
presence_penalty number -2~2, positive value reduces duplication; the default value changes with the thinking mode
repetition_penalty number is greater than 0; 1 means no penalty, omit and use the model default value
seed integer Controls randomness and does not guarantee that different model versions will obtain the same results
enable_search boolean Whether to search online, default false; usage may increase
search_options object is used with enable_search:true; forced_search is a Boolean value, search_strategy can be set to turbo or max
vl_high_resolution_images boolean High-resolution image understanding switch, default false; only used when including pictures

Image understanding can write user message content into two content blocks: text and image_url. For a complete example, see General Instructions. The range of temperature is 0 (inclusive) to 2 (exclusive); top_p is recommended to use a value between 0 and 1.

Request Example

curl --fail-with-body "$SHANHAI_BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen3.7-max",
  "messages": [
    {
      "role": "user",
      "content": "请用三点说明如何安排一次产品发布。"
    }
  ],
  "max_tokens": 1024,
  "stream": false
}'

Continuous output

In the above example, change stream to true and add the following fields; curl also uses -N to prevent the client from caching the output.

{
  "stream": true,
  "stream_options": {
    "include_usage": true
  }
}

Explicit control thinking

{
  "model": "qwen3.7-max",
  "messages": [
    {
      "role": "user",
      "content": "只输出 JSON 对象,键为 title 和 steps,内容是产品发布计划。"
    }
  ],
  "max_tokens": 1024,
  "stream": false,
  "enable_thinking": false,
  "response_format": {
    "type": "json_object"
  }
}

Return results

Read choices[0].message.content. finish_reason is stop which means it ends normally, length means it is truncated by the upper limit of the length, tool_calls means the tool needs to be executed. The prompt_tokens, completion_tokens, and total_tokens in usage represent input, output, and total processing volume respectively; Token is the unit for measuring text in the model, and is not fixed to the number of Chinese characters.

The streaming response parses the data: events one by one, splices delta.content into the answer, and saves delta.reasoning_content separately. Tool parameter fragments must be completely spliced ​​before parsing JSON; they cannot be executed after receiving only half of the fragments. When [DONE] is received, the error will be retained when the stream is cut off, and the half-section of content will not be regarded as the complete result.

encountered a problem

If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, task number, error time and error message. Do not provide the complete token.