GPT OSS 20B API

OpenAI’s GPT OSS 20B offers flexible reasoning levels, agentic features, and robust coding support in an open-source, memory-efficient transformer.

Modalities
TextText
In / Out price
$0.05/$0.2per 1M
Context window
131K tokens
Released
Sep 9, 2025

GPT OSS 20B overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by GPT OSS 20B through AI/ML API

GPT OSS 20B by OpenAI

Lightweight yet powerful, GPT OSS 20B supports multi-step workflows, tool integration, and runs efficiently on hardware with 16GB memory.

GPT OSS 20B specs

Model ID
openai/gpt-oss-20b
Developer
OpenAI
Context window
131,000 tokens
Max output
117,964 tokens
Input
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

GPT OSS 20B is an open-weight language model by OpenAI optimized for efficient, local, and specialized use cases with strong reasoning and coding capabilities. It offers a balance of high performance and low latency, making it suitable for edge devices and applications needing rapid iteration or lower compute requirements. Designed for agentic workflows, it supports chain-of-thought reasoning, function calling, and Python code execution, with customizable reasoning effort and structured output capabilities.

Technical Specifications

  • Model Size: 20 billion parameters with 3.6 billion active parameters
  • Compatibility: Runs within 16GB memory, optimized for lower latency and local deployment
  • Architecture: Text-only model supporting strong instruction following and tool usage

Performance Benchmarks

  • Demonstrates performance comparable to OpenAI’s proprietary o3-mini model on many reasoning and coding tasks
  • Efficient for deployment on consumer-grade hardware and edge devices
  • Strong in few-shot learning, multi-step reasoning, and tool integration

Key Capabilities

  • Advanced Reasoning: Configurable reasoning effort levels (low, medium, high) to balance accuracy and latency
  • Agentic Features: Supports function calling, web browsing, code execution, and structured outputs within workflows
  • Code Generation: Produces and edits code effectively across multiple programming languages
  • Lightweight Deployment: Runs efficiently in constrained environments with modest hardware requirements

Optimal Use Cases

  • On-device AI applications requiring lightweight but capable models
  • Rapid experimentation and iterations in coding and analytic tasks
  • Applications benefitting from flexible reasoning depth and tool integration
  • Local or offline deployments demanding privacy and data control

Comparison with Other Models

vs GPT OSS 120B: GPT OSS 20B operates efficiently on limited hardware with 16GB memory, making it well-suited for local and rapid deployment with solid reasoning and coding capabilities, whereas GPT OSS 120B offers significantly larger capacity (120B parameters), delivers higher accuracy, and is designed for large-scale, high-compute tasks.

vs OpenAI o3-mini: GPT OSS 20B demonstrates comparable performance to the o3-mini model, with the added advantage of open-weight access and flexible configuration, benefiting researchers and developers who require transparency and customization.

vs GLM-4.5: GLM-4.5 outperforms GPT OSS 20B in practical coding challenges and advanced tool integration, but GPT OSS 20B remains competitive in general reasoning tasks and is easier to deploy on hardware with limited resources.

Limitations and Considerations

  • While more affordable than larger models, it is less powerful than GPT OSS 120B for extremely complex tasks
  • Best used with explicit prompt design to achieve optimal outputs
  • Performance and latency depend on hardware capabilities and input size
  • Open-weight nature means enterprises should apply additional safeguards for production safety

Use cases

  • On-device AI applications requiring lightweight but capable models
  • Rapid experimentation and iterations in coding and analytic tasks
  • Applications benefitting from flexible reasoning depth and tool integration
  • Local or offline deployments demanding privacy and data control

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning
  • Web search

GPT OSS 20B benchmarks by Artificial Analysis

See how GPT OSS 20B compares in generation speed and latency. Data retrieved Nov 4, 2026.

Speed

Output tokens / second

Benchmark results

Compare 9 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

GPT OSS 20B API pricing

GPT OSS 20B pricing in US dollars
UsagePriceUnit
Input$0.051M tokens
Output$0.21M tokens
Cached input$0.03971M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

GPT OSS 20B vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
GPT OSS 20B$0.05$0.2
GPT-6.1 Terra$1$5
GPT-6.1 Sol$2$10
GPT-6 Sol$2$10
GPT-6.1 Terra Pro$2.12$10.58

How to use the GPT OSS 20B API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-oss-20b",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

GPT OSS 20B FAQ

What is the context window of GPT OSS 20B?

GPT OSS 20B has a 131,000 tokens context window and can return up to 131,072 tokens.

What inputs and outputs does GPT OSS 20B support?

GPT OSS 20B takes text as input and returns text.

What is the model ID for GPT OSS 20B?

Use openai/gpt-oss-20b as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

When was GPT OSS 20B released?

GPT OSS 20B became available on September 9, 2025.

How much does GPT OSS 20B cost?

GPT OSS 20B costs $0.05 input and $0.2 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does GPT OSS 20B support streaming?

Yes, GPT OSS 20B can stream responses as they are generated.

Who created GPT OSS 20B?

GPT OSS 20B was built by OpenAI.

Start building with GPT OSS 20B

GPT OSS 20B API

openai/gpt-oss-20b

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-oss-20b",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'