> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen3.6-Plus

> 通过 AnyFast OpenAI 兼容接口调用 Qwen3.6-Plus 多模态模型。

Qwen3.6-Plus 是阿里巴巴 Qwen3.6 系列的旗舰多模态模型，通过 AnyFast 的 OpenAI 兼容 Chat Completions 接口提供服务。使用模型 ID `qwen3.6-plus`，可进行文本生成、图片和视频理解、工具调用及结构化输出。

## 核心能力

* **100 万 Token 上下文窗口** — 处理长文档、多轮对话和多模态上下文。
* **最多 64K 输出** — 适合长文本、代码和结构化结果生成。
* **多模态输入** — 支持在同一轮对话中传入文本、图片和视频。
* **大规模媒体输入** — 单次请求最多 256 张图片和 64 个视频；视频最长 2 小时、最大 2 GB。
* **函数调用** — 让模型选择并调用应用定义的函数。
* **内置工具** — 在上游服务启用时使用支持的联网搜索和代码执行工具。
* **结构化输出** — 在非思考模式下请求 JSON 输出。

## 快速示例

```bash cURL theme={null}
curl --request POST \
  --url https://www.anyfast.ai/v1/chat/completions \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "qwen3.6-plus",
    "messages": [
      {"role": "user", "content": "请用简单的语言解释日食是如何发生的。"}
    ],
    "temperature": 1,
    "max_completion_tokens": 1024
  }'
```

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://www.anyfast.ai/v1",
)

response = client.chat.completions.create(
    model="qwen3.6-plus",
    messages=[
        {"role": "user", "content": "请用简单的语言解释日食是如何发生的。"}
    ],
    temperature=1,
    max_completion_tokens=1024,
)

print(response.choices[0].message.content)
```

## 图片和视频输入

使用 OpenAI 兼容的 content 部分传入远程媒体 URL 或 base64 数据 URI。Qwen3.6-Plus 单次请求最多接受 256 张图片和 64 个视频。

```python theme={null}
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1")

response = client.chat.completions.create(
    model="qwen3.6-plus",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "比较图片和视频，然后总结它们的差异。"},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/reference.jpg"},
                },
                {
                    "type": "video_url",
                    "video_url": {"url": "https://example.com/sample.mp4"},
                },
            ],
        }
    ],
    max_completion_tokens=1024,
)

print(response.choices[0].message.content)
```

## 思考模式和结构化输出

使用 OpenAI SDK 时，通过 `extra_body` 传递 `enable_thinking`。结构化输出和工具调用场景请遵循上游要求，在非思考模式下使用。

```python theme={null}
response = client.chat.completions.create(
    model="qwen3.6-plus",
    messages=[{"role": "user", "content": "请以 JSON 格式返回结果。"}],
    response_format={"type": "json_object"},
    extra_body={"enable_thinking": False},
)
```

## 函数调用

在 `tools` 数组中定义应用函数。当模型返回 `tool_calls` 时，在应用中执行选中的函数，将工具结果追加到 `messages`，再把完整对话发送给模型。

```python theme={null}
tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "查询指定城市的当前天气。",
            "parameters": {
                "type": "object",
                "properties": {"city": {"type": "string"}},
                "required": ["city"],
            },
        },
    }
]

response = client.chat.completions.create(
    model="qwen3.6-plus",
    messages=[{"role": "user", "content": "新加坡现在的天气怎么样？"}],
    tools=tools,
    extra_body={"enable_thinking": False},
)

print(response.choices[0].message.tool_calls)
```

## 流式输出

将 `stream` 设置为 `true` 可通过 Server-Sent Events 接收增量结果。如果需要在最后一个数据块中返回 Token 用量，可将 `stream_options.include_usage` 设置为 `true`。

```python theme={null}
stream = client.chat.completions.create(
    model="qwen3.6-plus",
    messages=[{"role": "user", "content": "写一篇关于海洋的短故事。"}],
    stream=True,
    stream_options={"include_usage": True},
)

for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="")
```

## 参数说明

| 参数                      | 类型              | 必填 | 说明                                                       |
| ----------------------- | --------------- | -: | -------------------------------------------------------- |
| `model`                 | string          |  是 | 固定为 `qwen3.6-plus`。                                      |
| `messages`              | array           |  是 | 对话消息列表。内容支持文本或图片/视频 content 部分。                          |
| `max_completion_tokens` | integer         |  否 | 最大生成 Token 数，最多 65,536。                                  |
| `temperature`           | number          |  否 | `[0, 2)` 范围内的采样温度。`temperature` 和 `top_p` 二选一。           |
| `top_p`                 | number          |  否 | `(0, 1]` 范围内的核采样概率。`temperature` 和 `top_p` 二选一。          |
| `stream`                | boolean         |  否 | 返回 SSE 增量结果。默认值：`false`。                                 |
| `stream_options`        | object          |  否 | 流式选项。`include_usage` 默认为 `false`，设为 `true` 后最后一个数据块包含用量。 |
| `stop`                  | array           |  否 | 停止序列数组。当前 AnyFast 接口不支持单个字符串格式。                          |
| `seed`                  | integer         |  否 | `0` 到 `2^31 - 1` 的随机种子，用于提高结果可复现性。                       |
| `presence_penalty`      | number          |  否 | `-2` 到 `2` 的重复内容控制参数。                                    |
| `frequency_penalty`     | number          |  否 | `-2` 到 `2` 的基于词频的重复内容控制参数。                               |
| `enable_thinking`       | boolean         |  否 | 思考模式控制字段。使用 OpenAI SDK 时通过 `extra_body` 传递。              |
| `tools`                 | array           |  否 | 应用定义的函数或支持的工具。                                           |
| `tool_choice`           | string 或 object |  否 | 控制是否允许调用工具，或指定必须调用的函数。                                   |
| `response_format`       | object          |  否 | 结构化输出配置，例如 `{ "type": "json_object" }`。需要时请使用非思考模式。      |

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/alibaba/qwen3.6-plus">
  打开 Qwen3.6-Plus 的交互式 API 参考。
</Card>

<script src="/public/feedback.js" />
