返回模型列表

GPT-5 Nano

openaiopenai/gpt-5-nano

API 使用指南

Chat 调用

GPT-5 Nano 通过 TheRouter 的标准 chat completions endpoint 调用,与任何兼容 OpenAI 的模型一样。支持所有 GPT-5 参数。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [
      {"role": "user", "content": "Classify this text as positive, negative, or neutral: \"The service was okay but nothing special.\""}
    ],
    "reasoning_effort": "minimal",
    "response_format": { "type": "json_object" }
  }'

流式输出

GPT-5 Nano 支持流式输出。配合 minimal reasoning_effort,可为分类和摘要任务提供近乎即时的响应开始。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [
      {"role": "user", "content": "Summarize this article in three bullet points: <article text>"}
    ],
    "reasoning_effort": "low",
    "stream": true
  }'

推理努力参数

GPT-5 Nano 支持完整的 reasoning_effort 范围:minimal 用于即时分类,low 用于平衡提取任务,medium 为默认值,high 用于较长输入的深度分析。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [
      {"role": "user", "content": "Extract all entities, dates, and monetary values from this invoice."}
    ],
    "reasoning_effort": "low",
    "response_format": { "type": "json_object" }
  }'

工具调用

GPT-5 Nano 支持并行工具调用和带文法定制的 custom_tools,且为 GPT-5 系列最低价格。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [{"role": "user", "content": "What's the weather in Tokyo and what's the current time?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {"type": "string", "description": "City name"}
          },
          "required": ["location"]
        }
      }
    }],
    "parallel_tool_calls": true
  }'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期openai.com ↗2026-05-29已核实
知识截止日期openrouter.ai ↗2026-05-29待核实
OpenAI 模型 IDplatform.openai.com ↗2026-05-29待核实
许可——已核实
SWE-bench Verifiedopenai.com ↗2026-05-29待核实
AIME 2025openai.com ↗2026-05-29待核实
MMMU (Multimodal)openai.com ↗2026-05-29待核实
GPT-5 系列发布 — GPT-5、Mini 和 Nanoopenai.com ↗2026-05-29已核实
GPT-5 Nano 与 GPT-5 Mini 有何区别?openai.com ↗2026-05-29待核实
GPT-5 Nano 支持视觉输入吗?platform.openai.com ↗2026-05-29待核实
GPT-5.4 Nano 发布后,GPT-5 Nano 还能用吗?platform.openai.com ↗2026-05-29待核实
缓存读取价格有什么优势?platform.openai.com ↗2026-05-29待核实
帮助与联系