Last refreshed 2026-04-19. Next refresh: weekly.
Why use gpt-oss-20b on OpenAI API?
OpenAI API offers gpt-oss-20b with competitive pricing. OpenAI is a leading AI research and deployment company dedicated to developing safe and beneficial artificial general intelligence (AGI) for humanity.
Compare gpt-oss-20b across 11 providers to find the best fit for your use caseInput / 1M
-
Output / 1M
-
Cache
Not sourced
Batch
Not sourced
Setup recipe
Python + curlInstall
pip install openaiAuth
export OPENAI_API_KEY=...Call
import os
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY from env
response = client.chat.completions.create(Model ID
gpt-oss-20bRequest example
import os
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY from env
response = client.chat.completions.create(
model="gpt-oss-20b",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Gotchas
- Use the model slug directly, e.g. "gpt-4o" or "gpt-4.1-mini".
- The examples expect OPENAI_API_KEY; rename it only if your application config maps the new variable.
Compare gpt-oss-20b Across Providers
| Provider | Input (per 1M) | Output (per 1M) |
|---|---|---|
| Cloudflare Workers AI | $0.20 | $0.30 |
| OpenRouter | $0.03 | $0.14 |
| Fireworks AI | $0.07 | $0.30 |
| GCP Vertex AI | $0.07 | $0.25 |
| NVIDIA NIM | — | — |
Capabilities
JSON / Tool useStructured Outputs
About gpt-oss-20b
OpenAI open-weight model with 20 billion parameters. Lightweight, efficient text-only model with reasoning and function calling. Free for self-hosting. Released August 5, 2025.
Get Started
Model Specs
Released2025-08-05
Parameters20B
Context131k
ArchitectureDecoder Only
Knowledge cutoff2025-08