返回模型列表

GPT-4.1 Nano

openaiopenai/gpt-4.1-nano

API 使用指南

Chat 调用

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"Hello"}]}'

流式传输

流式传输与 OpenAI SDK 完全一致 — 设置 stream: true。非常适合 Nano 的低延迟特性。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"Hello"}],"stream":true}'

工具调用

GPT-4.1 Nano 通过 OpenAI 兼容 API 支持并行工具调用——在代理工作流中适合作为快速工具选择路由步骤。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"What is the weather in Tokyo?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get current temperature","parameters":{"type":"object","properties":{"location":{"type":"string"}}}}}],"tool_choice":"auto"}'

结构化输出

设置 response_format 为 JSON schema,确保结构化解析。Nano 的低成本使其成为大批量提取管线的理想选择。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"Extract name and age from: John is 30"}],"response_format":{"type":"json_schema","json_schema":{"name":"person","strict":true,"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"number"}},"additionalProperties":false}}}}'

视觉

GPT-4.1 Nano 支持图像输入。用于低成本、快速的图像分类或 OCR 预处理。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":[{"type":"text","text":"What is in this image?"},{"type":"image_url","image_url":{"url":"https://therouter.ai/assets/vision-sample.png"}}]}]}'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期openai.com ↗2026-05-28已核实
知识截止日期openai.com ↗2026-05-28已核实
训练数据截止openai.com ↗2026-05-28已核实
许可openai.com ↗2026-05-28已核实
系列定位openai.com ↗2026-05-28已核实
MMLUopenai.com ↗2026-05-28已核实
GPQAopenai.com ↗2026-05-28已核实
Aider Polyglotopenai.com ↗2026-05-28已核实
GPT-4.1 系列发布,首次推出 Nano 模型openai.com ↗2026-05-28已核实
GPT-4.1 Nano 与 GPT-4o Mini 相比如何?openai.com ↗2026-05-28待核实
GPT-4.1 Nano 最适合用于什么?openai.com ↗2026-05-28待核实
帮助与联系