---
title: OpenAI: Gpt Oss 20b API | Text Generation | ModelsLab
description: Efficient open-weight reasoning model with 20B parameters (3.6B active), 128K context window, runs on 16GB memory—ideal for local inference and edge.
url: https://modelslab.com/models/openai/openai-gpt-oss-20b/api.md
canonical: https://modelslab.com/models/openai/openai-gpt-oss-20b/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-15T00:19:11.329184Z
---

OpenAI: gpt-oss-20b
---

 [LLMs.txt](https://modelslab.com/models/open_router/openai-gpt-oss-20b/llms.txt) [.md](https://modelslab.com/models/openai/openai-gpt-oss-20b.md)

openai-gpt-oss-20b openai Closed Source Model $0.085000 / call

OpenAI: gpt-oss-20b
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### OpenAI: gpt-oss-20b

openai openai-gpt-oss-20b

Copy model ID

PricingInput $0.03 / 1M tokens

Output $0.14 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[Q3](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 30B A3b

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)

[DR](https://modelslab.com/models/open_router/deepseek-deepseek-r1-0528)[Open Router](https://modelslab.com/models/open_router)

 [DeepSeek: R1 0528

Closed Source Model](https://modelslab.com/models/open_router/deepseek-deepseek-r1-0528)

[AA](https://modelslab.com/models/open_router/arcee-ai-trinity-large-thinking)[Open Router](https://modelslab.com/models/open_router)

 [Arcee AI: Trinity Large Thinking

Closed Source Model](https://modelslab.com/models/open_router/arcee-ai-trinity-large-thinking)

[N3](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-70b-instruct)[Together AI](https://modelslab.com/models/together_ai)

 [nim/meta/llama-3.1-70b-instruct

Closed Source Model](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-70b-instruct)

[Q0](https://modelslab.com/models/together_ai/Qwen-Qwen3-0.6B-Base)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 0.6B Base

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-0.6B-Base)

[AO](https://modelslab.com/models/open_router/allenai-olmo-3.1-32b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [AllenAI: Olmo 3.1 32B Instruct

Closed Source Model](https://modelslab.com/models/open_router/allenai-olmo-3.1-32b-instruct)

[MM](https://modelslab.com/models/open_router/mistralai-mistral-small-3.1-24b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Mistral: Mistral Small 3.1 24B

Closed Source Model](https://modelslab.com/models/open_router/mistralai-mistral-small-3.1-24b-instruct)

[AC](https://modelslab.com/models/open_router/anthropic-claude-opus-4.6-fast)[Open Router](https://modelslab.com/models/open_router)

 [Anthropic: Claude Opus 4.6 (Fast)

Closed Source Model](https://modelslab.com/models/open_router/anthropic-claude-opus-4.6-fast)

[IM](https://modelslab.com/models/open_router/inception-mercury-2)[Open Router](https://modelslab.com/models/open_router)

 [Inception: Mercury 2

Closed Source Model](https://modelslab.com/models/open_router/inception-mercury-2)

[OG](https://modelslab.com/models/open_router/openai-gpt-4o-mini)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-4o-mini

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-4o-mini)

[GG](https://modelslab.com/models/open_router/google-gemini-2.5-pro-preview)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemini 2.5 Pro Preview 06-05

Closed Source Model](https://modelslab.com/models/open_router/google-gemini-2.5-pro-preview)

[QQ](https://modelslab.com/models/alibaba_cloud/qwen-qwen3.5-122b-a10b)[Alibaba](https://modelslab.com/models/alibaba_cloud)

 [Qwen: Qwen3.5-122B-A10B

Closed Source Model](https://modelslab.com/models/alibaba_cloud/qwen-qwen3.5-122b-a10b)

[M(](https://modelslab.com/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.1)[ModelsLab](https://modelslab.com/models/mistral_ai)

 [Mistral (7B) Instruct

Closed Source Model](https://modelslab.com/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.1)

[![GPT 5.2](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/2bdd00f4-1692-49d8-a562-72cb1753d0ff.png)](https://modelslab.com/models/openai/gpt-5.2)[Open Ai](https://modelslab.com/models/openai)

 [GPT 5.2

Closed Source Model](https://modelslab.com/models/openai/gpt-5.2)

[CC](https://modelslab.com/models/open_router/cohere-command-r7b-12-2024)[Open Router](https://modelslab.com/models/open_router)

 [Cohere: Command R7B (12-2024)

Closed Source Model](https://modelslab.com/models/open_router/cohere-command-r7b-12-2024)

[![GPT-5-nano](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/264a17fd-e3e6-4145-a644-88e3c644638f.webp)](https://modelslab.com/models/openai/gpt-5-nano)[Open Ai](https://modelslab.com/models/openai)

 [GPT-5-nano

Closed Source Model](https://modelslab.com/models/openai/gpt-5-nano)

[Q7](https://modelslab.com/models/open_router/qwen-qwen-2.5-72b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Qwen2.5 72B Instruct

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen-2.5-72b-instruct)

[ML](https://modelslab.com/models/meta/meta-llama-Llama-3.3-70B-Instruct-Turbo)[ModelsLab](https://modelslab.com/models/meta)

 [Meta Llama 3.3 70B Instruct Turbo

Closed Source Model](https://modelslab.com/models/meta/meta-llama-Llama-3.3-70B-Instruct-Turbo)

About OpenAI: Gpt-Oss-20b
---

gpt-oss-20b is an open-weight 21B parameter model released by OpenAI under the Apache 2.0 license. It uses a Mixture-of-Experts (MoE) architecture with 3.6B active parameters per forward pass, optimized for...

### Technical Specifications

Model IDopenai-gpt-oss-20bCategoryLLM ModelsTaskText GenerationPrice$0.085000 per million tokensAddedFebruary 20, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate OpenAI: Gpt-Oss-20b into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "openai-gpt-oss-20b",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab.com/models/openai/openai-gpt-oss-20b/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

OpenAI: Gpt-Oss-20b API costs $0.085000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Learn more about OpenAI: Gpt-Oss-20b](https://modelslab.com/openai-gpt-oss-20b) [Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Openai](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

OpenAI: Gpt-Oss-20b FAQ
---

### What is OpenAI: Gpt-Oss-20b?

gpt-oss-20b is an open-weight 21B parameter model released by OpenAI under the Apache 2.0 license. It uses a Mixture-of-Experts (MoE) architecture with 3.6B active parameters per forward pass, optimized for...

### How do I use the OpenAI: Gpt-Oss-20b API?

You can integrate OpenAI: Gpt-Oss-20b into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "openai-gpt-oss-20b" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does OpenAI: Gpt-Oss-20b cost?

OpenAI: Gpt-Oss-20b costs $0.085000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the OpenAI: Gpt-Oss-20b model ID?

The model ID for OpenAI: Gpt-Oss-20b is "openai-gpt-oss-20b". Use this ID in your API requests to specify this model.

### Does OpenAI: Gpt-Oss-20b have a free tier?

Yes, ModelsLab offers a free tier that lets you try OpenAI: Gpt-Oss-20b and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-04-15*