Back to Models

Qwen3 Coder 30B

qwenqwen/qwen3-coder-30b

API guide

Chat completion

Use the standard OpenAI-compatible chat completions endpoint for code edits, tests, and explanations. Keep prompts concrete: include the target file, failing assertion, or API contract.

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
  }'

Streaming

Enable streaming for IDE assistants and long code explanations so users see progress quickly.

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
  }'

Tool calling

Use tools for repository search, lint/test execution, and patch application instead of asking the model to infer project state.

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"
  }'

Structured JSON

Use response_format for machine-readable review output, triage labels, or test plans.

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"}
  }'
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Architecturehuggingface.co β†—2026-06-03verified
Parametershuggingface.co β†—2026-06-03verified
Layershuggingface.co β†—2026-06-03verified
Expertshuggingface.co β†—2026-06-03verified
Native contexthuggingface.co β†—2026-06-03verified
Output modehuggingface.co β†—2026-06-03verified
Agentic Coding / Browser-Use / Foundational Codinghuggingface.co/Qwen β†—2026-06-03verified
SWE-Bench Verifiedqwenlm.github.io β†—2026-06-03unknown
Qwen releases Qwen3-Coder-30B-A3B-Instructhuggingface.co/Qwen β†—2026-06-03verified
Qwen launches the Qwen3-Coder family and Qwen Codeqwenlm.github.io β†—2026-06-03verified
How is qwen/qwen3-coder-30b different from qwen/qwen3-coder-480b?huggingface.co β†—2026-06-03to verify
Does Qwen3-Coder-30B support tool calling?huggingface.co β†—2026-06-03to verify
Does it return hidden reasoning or <think> blocks?huggingface.co β†—2026-06-03to verify
Can I use it from Cursor, Cline, or another OpenAI-compatible client?qwenlm.github.io β†—2026-06-03to verify
Is the 262K context a TheRouter guarantee?huggingface.co β†—2026-06-03to verify
Help & contact