返回模型列表
GPT OSS Safeguard 20B
openaiopenai/gpt-oss-safeguard-20b
API 使用指南
通过 Chat API 进行安全分类
gpt-oss-safeguard 模型使用 OpenAI 的 Harmony 响应格式。在用户消息中同时提供策略和待分类内容,模型将返回结构化推理和分类结论。
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"
}'可配置推理强度
gpt-oss-safeguard 模型支持低、中、高三种推理强度。'低'用于高吞吐量过滤,'高'用于需要详细链式思维的复杂策略决策。
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"
}'事实档案 — 本页每条断言可在此回溯来源
| 来源 | URL | 采集于 | |
|---|---|---|---|
| 发布日期 | openai.com ↗ | 2026-05-29 | 已核实 |
| 许可协议 | huggingface.co ↗ | 2026-05-29 | 已核实 |
| 架构 | github.com ↗ | 2026-05-29 | 已核实 |
| 基座模型 | openai.com ↗ | 2026-05-29 | 已核实 |
| GPU 要求 | huggingface.co ↗ | 2026-05-29 | 已核实 |
| 响应格式 | github.com ↗ | 2026-05-29 | 已核实 |
| 模型权重大小 | huggingface.co ↗ | 2026-05-29 | 已核实 |
| 训练数据截止 | — | — | 未知 |
| Multi-policy accuracy (internal eval) | openai.com ↗ | 2026-05-29 | 已核实 |
| 2022 Moderation Evaluation Set | openai.com ↗ | 2026-05-29 | 已核实 |
| ToxicChat | openai.com ↗ | 2026-05-29 | 已核实 |
| OpenAI 发布 gpt-oss-safeguard 开源安全推理模型 | openai.com ↗ | 2026-05-29 | 已核实 |
| 什么是 Harmony 响应格式,为什么必须使用它? | cookbook.openai.com ↗ | 2026-05-29 | 待核实 |
| 它和 OpenAI Moderation API 有什么不同? | openai.com ↗ | 2026-05-29 | 待核实 |
| 应该使用哪种推理强度? | github.com ↗ | 2026-05-29 | 待核实 |