Back to Models

GPT OSS Safeguard 20B

openaiopenai/gpt-oss-safeguard-20b

API guide

Safety classification via chat

The gpt-oss-safeguard models use OpenAI's Harmony response format. Provide your policy and content in the user message. The model returns structured reasoning and a classification conclusion.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-oss-safeguard-20b",
    "messages": [
      {
        "role": "system",
        "content": "You are a safety classifier. You must respond in the Harmony format."
      },
      {
        "role": "user",
        "content": "[POLICY]\nClassify the following user message as:\n- hate_speech: content that attacks or demeans a group based on protected attributes\n- harassment: content that targets an individual with threats or degrading language\n- safe: none of the above\n\n[CONTENT]\nI completely disagree with your opinion on this topic."
      }
    ],
    "reasoning_effort": "medium"
  }'

Configurable reasoning effort

The gpt-oss-safeguard models support low, medium, and high reasoning effort. Use 'low' for high-throughput filtering, 'high' for complex policy decisions requiring detailed chain-of-thought.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-oss-safeguard-20b",
    "messages": [
      {
        "role": "system",
        "content": "You are a safety classifier. Use the Harmony format."
      },
      {
        "role": "user",
        "content": "[POLICY]\n[your policy here]\n\n[CONTENT]\n[content to classify]"
      }
    ],
    "reasoning_effort": "high"
  }'
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-29verified
Licensehuggingface.co β†—2026-05-29verified
Architecturegithub.com β†—2026-05-29verified
Base modelopenai.com β†—2026-05-29verified
GPU requirementhuggingface.co β†—2026-05-29verified
Response formatgithub.com β†—2026-05-29verified
Model weights sizehuggingface.co β†—2026-05-29verified
Training cutoffβ€”β€”unknown
Multi-policy accuracy (internal eval)openai.com β†—2026-05-29verified
2022 Moderation Evaluation Setopenai.com β†—2026-05-29verified
ToxicChatopenai.com β†—2026-05-29verified
OpenAI releases gpt-oss-safeguard β€” open-weight safety reasoning modelsopenai.com β†—2026-05-29verified
What is the Harmony response format and why is it required?cookbook.openai.com β†—2026-05-29to verify
How is this different from the OpenAI Moderation API?openai.com β†—2026-05-29to verify
What reasoning effort should I use?github.com β†—2026-05-29to verify
Help & contact