返回模型列表

Qwen3 Coder 30B

qwenqwen/qwen3-coder-30b

API 使用指南

Chat 调用

使用标准 OpenAI 兼容 Chat Completions 端点处理代码编辑、测试和解释。提示词应具体:包含目标文件、失败断言或 API 契约。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3-coder-30b",
    "messages": [
      {"role": "system", "content": "You are a senior software engineer. Return concise patches and tests."},
      {"role": "user", "content": "Write unit tests for this parser and cover edge cases: ..."}
    ],
    "temperature": 0.7,
    "max_tokens": 4096
  }'

流式输出

在 IDE 助手和长代码解释中启用流式输出,让用户更快看到进度。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3-coder-30b",
    "messages": [{"role": "user", "content": "Explain why this CI job is flaky and propose a minimal fix."}],
    "stream": true
  }'

工具调用

用工具执行仓库搜索、lint/test 和补丁应用,而不是让模型猜测项目状态。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3-coder-30b",
    "messages": [{"role": "user", "content": "Find the file that defines the retry policy."}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "repo_search",
        "description": "Search repository files by query",
        "parameters": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}
      }
    }],
    "tool_choice": "auto"
  }'

结构化 JSON

使用 response_format 生成机器可读的评审输出、分流标签或测试计划。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3-coder-30b",
    "messages": [
      {"role": "system", "content": "Return JSON with keys risk, files, tests."},
      {"role": "user", "content": "Review this diff: ..."}
    ],
    "response_format": {"type": "json_object"}
  }'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
架构huggingface.co ↗2026-06-03已核实
参数规模huggingface.co ↗2026-06-03已核实
层数huggingface.co ↗2026-06-03已核实
专家数量huggingface.co ↗2026-06-03已核实
原生上下文huggingface.co ↗2026-06-03已核实
输出模式huggingface.co ↗2026-06-03已核实
Agentic Coding / Browser-Use / Foundational Codinghuggingface.co/Qwen ↗2026-06-03已核实
SWE-Bench Verifiedqwenlm.github.io ↗2026-06-03未知
Qwen 发布 Qwen3-Coder-30B-A3B-Instructhuggingface.co/Qwen ↗2026-06-03已核实
Qwen 发布 Qwen3-Coder 系列与 Qwen Codeqwenlm.github.io ↗2026-06-03已核实
qwen/qwen3-coder-30b 与 qwen/qwen3-coder-480b 有什么区别?huggingface.co ↗2026-06-03待核实
Qwen3-Coder-30B 支持工具调用吗?huggingface.co ↗2026-06-03待核实
它会返回隐藏推理或 <think> 块吗?huggingface.co ↗2026-06-03待核实
可以从 Cursor、Cline 或其他 OpenAI 兼容客户端使用它吗?qwenlm.github.io ↗2026-06-03待核实
262K 上下文是 TheRouter 保证吗?huggingface.co ↗2026-06-03待核实
帮助与联系