新我们如何抓出挂错模型的卖家,并在发生时为你退款。
Alibaba 标志

如何在Claude Code中使用Qwen 4 Max?

qwen/qwen4-max

Claude Code 通过 MartLLM 的 Anthropic 兼容地址访问Qwen 4 Max。将ANTHROPIC_BASE_URL设置为https://api.martllm.com(末尾不带 /v1),将ANTHROPIC_AUTH_TOKEN设置为您的 MartLLM 密钥,并将ANTHROPIC_MODEL设置为qwen/qwen4-max[1m],然后启动claude。 同样将 opus、sonnet、haiku 和 subagent 模型变量设置为qwen/qwen4-max:未设置的槽位会继续以 Claude 的价格请求 Claude 模型。 ID 末尾的[1m]告诉 Claude Code Qwen 4 Max具有1M个 token 的上下文;没有它,Claude Code 会按200,000个 token 进行规划。

bash
export ANTHROPIC_BASE_URL=https://api.martllm.com
export ANTHROPIC_AUTH_TOKEN=ull_your_key
export ANTHROPIC_MODEL='qwen/qwen4-max[1m]'
export ANTHROPIC_DEFAULT_OPUS_MODEL='qwen/qwen4-max'
export ANTHROPIC_DEFAULT_SONNET_MODEL='qwen/qwen4-max'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='qwen/qwen4-max'
export CLAUDE_CODE_SUBAGENT_MODEL='qwen/qwen4-max'
claude

Claude Code 调用:Anthropic Messages API https://api.martllm.com/v1/messages · 完整的Claude Code指南

把 ull_your_key 换成你的 MartLLM API 密钥。一个密钥可用于所有工具和所有模型。

通过 API,Qwen 4 Max 在三个地址上响应,使用相同的 MartLLM 密钥和模型 ID qwen/qwen4-max:位于https://api.martllm.com/v1/chat/completions的 OpenAI 聊天补全、位于https://api.martllm.com/v1/responses的 OpenAI Responses API 以及位于https://api.martllm.com/v1/messages的 Anthropic Messages API。

Qwen 4 Max API 多少钱?

在 2026年11月20日,通过 MartLLM,Qwen 4 Max 的输入 token 价格为每百万 $0.1353,输出 token 价格为每百万 $0.4059,这比其标价 $1.425 和 $4.275 低 90.5%。市场上 49 家供应商可以提供此服务。在之前的 7 天里,其 1,075 次流式请求中有一半在 6.6 秒内获得了第一个 token,典型提示词长度为 107,247 token。它支持高达 1,000,000 token 的上下文。MartLLM 不对这些价格收取额外费用,失败的请求不计费。

价格更新于 UTC 11:00。

在其他工具中使用 Qwen 4 Max

Claude Code 中的其他模型