gpt-oss-safeguard-20b overview
gpt-oss-safeguard-20b specs
- Model ID
openai/gpt-oss-safeguard-20b- Developer
- OpenAI
- Context window
- 131,072 tokens
- Max output
- 65,536 tokens
- Input
- Image, Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
What is gpt-oss-safeguard-20b API?
Where to Use gpt-oss-safeguard-20b
Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.
Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.
Use cases
Used for policy-based safety classification, where it reasons over a developer-provided policy to classify user messages, completions, and full chats.
Suited to lightweight content moderation and guardrail tasks in lower-latency or constrained environments.
Used for online content labeling, including classifying posts, messages, or media metadata for policy violations.
Used for offline batch labeling or review workflows, including moderation queues and trust-and-safety pipelines.
Capabilities
- Function calling
- Reasoning
- Streaming
- Structured outputs
- Web search
gpt-oss-safeguard-20b API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.0794 | 1M tokens |
| Output | $0.3174 | 1M tokens |
| Cached input | $0.0397 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
gpt-oss-safeguard-20b vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.0794 | $0.3174 | |
| $0.1 | $0.5 | |
| $1 | $5 | |
| $2 | $10 | |
| $2.12 | $10.58 |
How to use the gpt-oss-safeguard-20b API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport 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-safeguard-20b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "openai/gpt-oss-safeguard-20b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "openai/gpt-oss-safeguard-20b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
gpt-oss-safeguard-20b FAQ
What is the context window of gpt-oss-safeguard-20b?
gpt-oss-safeguard-20b has a 131,072 tokens context window and can return up to 65,536 tokens.
What inputs and outputs does gpt-oss-safeguard-20b support?
gpt-oss-safeguard-20b takes image, text as input and returns text.
What is the model ID for gpt-oss-safeguard-20b?
Use openai/gpt-oss-safeguard-20b as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
How much does gpt-oss-safeguard-20b cost?
gpt-oss-safeguard-20b costs $0.0794 input and $0.3174 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does gpt-oss-safeguard-20b support streaming?
Yes, gpt-oss-safeguard-20b can stream responses as they are generated.
Can gpt-oss-safeguard-20b read images?
Yes, gpt-oss-safeguard-20b accepts image input alongside text.
Who created gpt-oss-safeguard-20b?
gpt-oss-safeguard-20b was built by OpenAI.
Is gpt-oss-safeguard-20b a general-purpose chat model?
Yes, it is classified as a Chat model.

