---
title: Gpt Oss 20b API | Text Generation | ModelsLab
description: Medium-sized 21B-parameter Mixture-of-Experts LLM optimized for low-latency local deployment on 16GB memory devices, offering configurable reasoning and.
url: https://modelslab.com/models/openai/gpt-oss-20b.md
canonical: https://modelslab.com/models/openai/gpt-oss-20b
type: product
component: Playground/LLM/Index
generated_at: 2026-09-11T05:25:18.825763Z
---

gpt-oss-20b
---

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

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

images, PDFs and text files

Send

### gpt-oss-20b

openai gpt-oss-20b

Copy model ID

PricingInput $0.03 / 1M tokens

Output $0.13 / 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

Looking for something different?
---

Models that trade off differently against the one you are viewing

### Better quality

Newer flagship models that generally produce stronger results.

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

 [GPT 5.2](https://modelslab.com/models/openai/gpt-5.2)

[![GPT 5.1](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/fad83520-47a8-4059-b4b9-b32adf4d0be7.png)](https://modelslab.com/models/openai/gpt5.1)[OpenAI](https://modelslab.com/models/openai)

 [GPT 5.1](https://modelslab.com/models/openai/gpt5.1)

[![Gemini 3 Pro Preview](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/1846e76f-9d5c-4a35-a43a-82db45b7bb8b.png)](https://modelslab.com/models/google/gemini-3-pro-preview)[Google](https://modelslab.com/models/google)

 [Gemini 3 Pro Preview](https://modelslab.com/models/google/gemini-3-pro-preview)

[![GPT-5.1-Codex-Max](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/06356c4c-df09-4ccb-a5c0-629da670f75b.png)](https://modelslab.com/models/openai/gpt-5.1-codex-max)[OpenAI](https://modelslab.com/models/openai)

 [GPT-5.1-Codex-Max](https://modelslab.com/models/openai/gpt-5.1-codex-max)

### Lower cost per run

Open-source models we host, unlimited on the $149/month plan.

[Modelslab: Custom LLM

Popular](https://modelslab.com/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab.com/models/modelslab)

 [Modelslab: Custom LLM

Open Source Model](https://modelslab.com/models/modelslab/uncensored-chat)

[Qwen3.5 35B A3b](https://modelslab.com/models/Qwen/Qwen-Qwen3.5-35B-A3B)[Qwen](https://modelslab.com/models/open_router)

 [Qwen3.5 35B A3b

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

[![Gemma 3 4b it](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/c419acdb-893e-4bda-ac4d-cec941648345.png)](https://modelslab.com/models/google/google-gemma-3-4b-it)[Google](https://modelslab.com/models/open_router)

 [Gemma 3 4b it

Closed Source Model](https://modelslab.com/models/google/google-gemma-3-4b-it)

[Qwen3 14B](https://modelslab.com/models/Qwen/Qwen-Qwen3-14B)[Qwen](https://modelslab.com/models/open_router)

 [Qwen3 14B

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

[![Mistral: Mistral Nemo](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/992e2422-3d81-44d7-aaa4-25dbde8f4a73.png)](https://modelslab.com/models/mistralai/mistralai-mistral-nemo)[Mistral AI](https://modelslab.com/models/open_router)

 [Mistral: Mistral Nemo

Closed Source Model](https://modelslab.com/models/mistralai/mistralai-mistral-nemo)

[Mistral: Mistral Small 3](https://modelslab.com/models/mistralai/mistralai-mistral-small-24b-instruct-2501)[Mistral AI](https://modelslab.com/models/open_router)

 [Mistral: Mistral Small 3

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

Related Models
---

Discover similar models you might be interested in

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

[#### BytePlus/Seed 1.8

seed-1.8

From $3.00/M tokens](https://modelslab.com/models/byteplus/seed-1.8)

[#### IBM Granite/IBM: Granite 4.2 8B

ibm-granite-granite-4.2-8b

From $0.15/M tokens](https://modelslab.com/models/ibm-granite/ibm-granite-granite-4.2-8b)

[#### OpenAI/OpenAI: GPT-4 Turbo

openai-gpt-4-turbo

From $20.00/M tokens](https://modelslab.com/models/openai/openai-gpt-4-turbo)

[#### Thedrummer/TheDrummer: UnslopNemo 12B

thedrummer-unslopnemo-12b

From $0.40/M tokens](https://modelslab.com/models/thedrummer/thedrummer-unslopnemo-12b)

[#### Google/Google: Nano Banana Pro (Gemini 3 Pro Image Preview)

google-gemini-3-pro-image-preview

From $7.00/M tokens](https://modelslab.com/models/google/google-gemini-3-pro-image-preview)

[#### Z.ai/Z.ai: GLM Flash Latest

z-ai-glm-flash-latest

From $0.16/M tokens](https://modelslab.com/models/z-ai/z-ai-glm-flash-latest)

[#### Meta/Meta Llama 3.1 8B Instruct Turbo

meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo

From $0.18/M tokens](https://modelslab.com/models/meta/meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo)

[#### OpenAI/OpenAI: GPT-4o-mini (2024-07-18)

openai-gpt-4o-mini-2024-07-18

From $0.38/M tokens](https://modelslab.com/models/openai/openai-gpt-4o-mini-2024-07-18)

[#### Meta/Meta Llama 3.1 405B Instruct Turbo

meta-llama-Meta-Llama-3.1-405B-Instruct-Turbo

From $3.50/M tokens](https://modelslab.com/models/meta/meta-llama-Meta-Llama-3.1-405B-Instruct-Turbo)

[#### Meta/Meta: Muse Glimmer 30B (batch)

meta-muse-glimmer-30b-batch

From $0.46/M tokens](https://modelslab.com/models/meta/meta-muse-glimmer-30b-batch)

[#### Anthropic/Anthropic Claude Haiku Latest

anthropic-claude-haiku-latest

From $3.00/M tokens](https://modelslab.com/models/anthropic/anthropic-claude-haiku-latest)

[#### Tencent/Tencent: Hy4 preview

tencent-hy4-preview

From $1.67/M tokens](https://modelslab.com/models/tencent/tencent-hy4-preview)

[#### Qwen/Qwen3-VL-8B-Instruct

Qwen-Qwen3-VL-8B-Instruct

From $0.43/M tokens](https://modelslab.com/models/Qwen/Qwen-Qwen3-VL-8B-Instruct)

[#### Mistral AI/Mistral: Saba

mistralai-mistral-saba

From $0.40/M tokens](https://modelslab.com/models/mistralai/mistralai-mistral-saba)

[#### Qwen/Qwen: Qwen3 Next 80B A3B Thinking

qwen-qwen3-next-80b-a3b-thinking

From $0.68/M tokens](https://modelslab.com/models/qwen/qwen-qwen3-next-80b-a3b-thinking)

[#### Mistral AI/Mistral (7B) Instruct

mistralai-Mistral-7B-Instruct-v0.1

From $0.20/M tokens](https://modelslab.com/models/mistralai/mistralai-Mistral-7B-Instruct-v0.1)

[#### Qwen/Qwen: Qwen3 8B

qwen-qwen3-8b

From $0.29/M tokens](https://modelslab.com/models/qwen/qwen-qwen3-8b)

[#### Qwen/Qwen: Qwen3 VL 30B A3B Instruct

qwen-qwen3-vl-30b-a3b-instruct

From $0.38/M tokens](https://modelslab.com/models/qwen/qwen-qwen3-vl-30b-a3b-instruct)

About Gpt-Oss-20b
---

GPT-OSS 20B is a smaller open-weight model, designed for efficient reasoning and coding, lightweight enough to run on consumer GPUs.

### Technical Specifications

Model IDgpt-oss-20b

CategoryLLM Models

TaskText Generation

Price$0.08 per million tokens

AddedAugust 5, 2025

### 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 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": "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>
```

### Pricing

Gpt-Oss-20b API costs $0.08 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 Gpt-Oss-20b](https://modelslab.com/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)

Gpt-Oss-20b FAQ
---

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

GPT-OSS 20B is a smaller open-weight model, designed for efficient reasoning and coding, lightweight enough to run on consumer GPUs.

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

You can integrate 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 "gpt-oss-20b" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

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

Gpt-Oss-20b costs $0.08 per million tokens. ModelsLab plans start at $21/month (Basic), and the $149/month Open Source plan includes unlimited generation on open-source models.

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

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

### Do I need a paid plan to use Gpt-Oss-20b?

Yes. ModelsLab is subscription-based with no free tier — plans start at $21/month (Basic, 3,250 API calls). The $149/month Open Source Unlimited plan includes unlimited generation across open-source models; premium third-party models are billed per call from your wallet.

---

*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-09-11*