返回模型列表

GPT OSS 20B

openaiopenai/gpt-oss-20b

API 使用指南

Chat 调用

通过 TheRouter 使用标准 OpenAI 兼容的 chat completion。模型使用 harmony 聊天格式;TheRouter 会自动转换。

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-20b",
    "messages": [
      {"role": "user", "content": "What makes Mixture-of-Experts models efficient for edge deployment?"}
    ]
  }'

推理模式

通过系统消息设置推理努力级别。使用 'Reasoning: low'、'Reasoning: medium' 或 'Reasoning: high' 控制 CoT 长度和准确率。

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-20b",
    "messages": [
      {"role": "system", "content": "Reasoning: low"},
      {"role": "user", "content": "Simplify this code: function factorial(n) { if (n <= 1) return 1; return n * factorial(n-1); }"}
    ]
  }'

工具/函数调用

完全支持 OpenAI 兼容的工具和函数调用。使用标准 OpenAI 模式定义函数。

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-20b",
    "messages": [{"role": "user", "content": "What is the weather in Tokyo?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather",
        "parameters": {
          "type": "object",
          "properties": {"location": {"type": "string"}},
          "required": ["location"]
        }
      }
    }],
    "tool_choice": "auto"
  }'

结构化输出

GPT OSS 20B 支持 OpenAI 结构化输出,确保 JSON 响应符合指定模式。

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-20b",
    "messages": [{"role": "user", "content": "Extract the date, amount, and vendor from this invoice text."}],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "invoice_fields",
        "schema": {
          "type": "object",
          "properties": {
            "date": {"type": "string"},
            "amount": {"type": "number"},
            "vendor": {"type": "string"}
          },
          "required": ["date", "amount", "vendor"]
        }
      }
    }
  }'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期openai.com ↗2026-05-29已核实
架构openai.com ↗2026-05-29已核实
许可openai.com ↗2026-05-29已核实
知识截止日期arxiv.org ↗2026-05-29已核实
分词器arxiv.org ↗2026-05-29已核实
最低内存openai.com ↗2026-05-29已核实
量化arxiv.org ↗2026-05-29已核实
检查点大小huggingface.co ↗2026-05-29已核实
推理模式openai.com ↗2026-05-29已核实
MMLUarxiv.org ↗2026-05-29已核实
AIME 2024arxiv.org ↗2026-05-29已核实
AIME 2025arxiv.org ↗2026-05-29已核实
Codeforces Eloopenai.com ↗2026-05-29待核实
SWE-Bench Verifiedarxiv.org ↗2026-05-29已核实
GPQA Diamondarxiv.org ↗2026-05-29已核实
HLEarxiv.org ↗2026-05-29已核实
HealthBencharxiv.org ↗2026-05-29已核实
Tau-Bench Retailarxiv.org ↗2026-05-29已核实
我能否通过 TheRouter 的 API 使用 GPT OSS 20B,而无需自行托管?openai.com ↗2026-05-29待核实
GPT OSS 20B 使用什么许可证?openai.com ↗2026-05-29待核实
GPT OSS 20B 与 GPT OSS 120B 相比如何?openai.com ↗2026-05-29待核实
自行托管 GPT OSS 20B 需要什么硬件?github.com ↗2026-05-29待核实
帮助与联系