Back to Models

GPT-4.1 Nano

openaiopenai/gpt-4.1-nano

API guide

Chat completion

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"}]}'

Streaming

Streaming works identically to the OpenAI SDK β€” set stream: true. Ideal for Nano's low-latency profile.

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}'

Tool calling

GPT-4.1 Nano supports parallel tool calling via the OpenAI-compatible API β€” useful for fast tool-selection routing steps in agentic workflows.

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"}'

Structured outputs

Set response_format to JSON schema for guaranteed structured parsing. Nano's low cost makes it ideal for high-volume extraction pipelines.

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}}}}'

Vision

GPT-4.1 Nano accepts image inputs alongside text. Use it for cheap, fast image classification or OCR pre-processing.

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"}}]}]}'
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-28verified
Knowledge cutoffopenai.com β†—2026-05-28verified
Training cutoffopenai.com β†—2026-05-28verified
Licenseopenai.com β†—2026-05-28verified
Model family positionopenai.com β†—2026-05-28verified
MMLUopenai.com β†—2026-05-28verified
GPQAopenai.com β†—2026-05-28verified
Aider Polyglotopenai.com β†—2026-05-28verified
GPT-4.1 family launched with first-ever Nano modelopenai.com β†—2026-05-28verified
How does GPT-4.1 Nano compare to GPT-4o Mini?openai.com β†—2026-05-28to verify
What is GPT-4.1 Nano best used for?openai.com β†—2026-05-28to verify
Help & contact