Back to Models
GPT OSS 20B
openaiopenai/gpt-oss-20b
API guide
Chat completion
Use standard OpenAI-compatible chat completion via TheRouter. The model uses the harmony chat format; TheRouter handles the conversion automatically.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [
{"role": "user", "content": "What makes Mixture-of-Experts models efficient for edge deployment?"}
]
}'Reasoning mode
Set reasoning effort via system message. Use 'Reasoning: low', 'Reasoning: medium', or 'Reasoning: high' to control CoT length and accuracy.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [
{"role": "system", "content": "Reasoning: low"},
{"role": "user", "content": "Simplify this code: function factorial(n) { if (n <= 1) return 1; return n * factorial(n-1); }"}
]
}'Tool/function calling
Full support for OpenAI-compatible tool and function calling. Define functions in the standard OpenAI schema.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [{"role": "user", "content": "What is the weather in Tokyo?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {
"type": "object",
"properties": {"location": {"type": "string"}},
"required": ["location"]
}
}
}],
"tool_choice": "auto"
}'Structured Outputs
GPT OSS 20B supports OpenAI Structured Outputs for guaranteed JSON responses matching a schema.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [{"role": "user", "content": "Extract the date, amount, and vendor from this invoice text."}],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "invoice_fields",
"schema": {
"type": "object",
"properties": {
"date": {"type": "string"},
"amount": {"type": "number"},
"vendor": {"type": "string"}
},
"required": ["date", "amount", "vendor"]
}
}
}
}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-29 | verified |
| Architecture | openai.com β | 2026-05-29 | verified |
| License | openai.com β | 2026-05-29 | verified |
| Knowledge cutoff | arxiv.org β | 2026-05-29 | verified |
| Tokenizer | arxiv.org β | 2026-05-29 | verified |
| Minimum memory | openai.com β | 2026-05-29 | verified |
| Quantization | arxiv.org β | 2026-05-29 | verified |
| Checkpoint size | huggingface.co β | 2026-05-29 | verified |
| Reasoning modes | openai.com β | 2026-05-29 | verified |
| MMLU | arxiv.org β | 2026-05-29 | verified |
| AIME 2024 | arxiv.org β | 2026-05-29 | verified |
| AIME 2025 | arxiv.org β | 2026-05-29 | verified |
| Codeforces Elo | openai.com β | 2026-05-29 | to verify |
| SWE-Bench Verified | arxiv.org β | 2026-05-29 | verified |
| GPQA Diamond | arxiv.org β | 2026-05-29 | verified |
| HLE | arxiv.org β | 2026-05-29 | verified |
| HealthBench | arxiv.org β | 2026-05-29 | verified |
| Tau-Bench Retail | arxiv.org β | 2026-05-29 | verified |
| Can I use GPT OSS 20B through TheRouter's API without self-hosting? | openai.com β | 2026-05-29 | to verify |
| What license does GPT OSS 20B use? | openai.com β | 2026-05-29 | to verify |
| How does GPT OSS 20B compare to GPT OSS 120B? | openai.com β | 2026-05-29 | to verify |
| What hardware do I need to self-host GPT OSS 20B? | github.com β | 2026-05-29 | to verify |