Back to Models

GPT-4.1 Mini

openaiopenai/gpt-4.1-mini

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-mini","messages":[{"role":"user","content":"Hello"}]}'

Streaming

Streaming works identically to OpenAI's SDK β€” set stream: true.

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-mini","messages":[{"role":"user","content":"Hello"}],"stream":true}'

Tool calling

GPT-4.1 Mini supports parallel tool calling and function definitions via the OpenAI-compatible 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-mini","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.

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-mini","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}}}}'
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-28verified
Training cutoffopenai.com β†—2026-05-28verified
Licenseopenai.com β†—2026-05-28verified
Knowledge cutoffopenai.com β†—2026-05-28verified
MMLUopenai.com β†—2026-05-28verified
GPQA Diamondopenai.com β†—2026-05-28verified
IFEvalopenai.com β†—2026-05-28to verify
GPT-4.1 family launchedopenai.com β†—2026-05-28verified
How does GPT-4.1 Mini compare to GPT-4o Mini?openai.com β†—2026-05-28to verify
Is GPT-4.1 Mini available through ChatGPT?openai.com β†—2026-05-28to verify
Does GPT-4.1 Mini support structured outputs (JSON schema)?openai.com β†—2026-05-28to verify
Help & contact