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
| source | URL | retrieved | |
|---|---|---|---|
| Architecture | huggingface.co β | 2026-06-03 | verified |
| Parameters | huggingface.co β | 2026-06-03 | verified |
| Layers | huggingface.co β | 2026-06-03 | verified |
| Experts | huggingface.co β | 2026-06-03 | verified |
| Native context | huggingface.co β | 2026-06-03 | verified |
| Output mode | huggingface.co β | 2026-06-03 | verified |
| Agentic Coding / Browser-Use / Foundational Coding | huggingface.co/Qwen β | 2026-06-03 | verified |
| SWE-Bench Verified | qwenlm.github.io β | 2026-06-03 | unknown |
| Qwen releases Qwen3-Coder-30B-A3B-Instruct | huggingface.co/Qwen β | 2026-06-03 | verified |
| Qwen launches the Qwen3-Coder family and Qwen Code | qwenlm.github.io β | 2026-06-03 | verified |
| How is qwen/qwen3-coder-30b different from qwen/qwen3-coder-480b? | huggingface.co β | 2026-06-03 | to verify |
| Does Qwen3-Coder-30B support tool calling? | huggingface.co β | 2026-06-03 | to verify |
| Does it return hidden reasoning or <think> blocks? | huggingface.co β | 2026-06-03 | to verify |
| Can I use it from Cursor, Cline, or another OpenAI-compatible client? | qwenlm.github.io β | 2026-06-03 | to verify |
| Is the 262K context a TheRouter guarantee? | huggingface.co β | 2026-06-03 | to verify |