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
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-28 | verified |
| Training cutoff | openai.com β | 2026-05-28 | verified |
| License | openai.com β | 2026-05-28 | verified |
| Knowledge cutoff | openai.com β | 2026-05-28 | verified |
| MMLU | openai.com β | 2026-05-28 | verified |
| GPQA Diamond | openai.com β | 2026-05-28 | verified |
| IFEval | openai.com β | 2026-05-28 | to verify |
| GPT-4.1 family launched | openai.com β | 2026-05-28 | verified |
| How does GPT-4.1 Mini compare to GPT-4o Mini? | openai.com β | 2026-05-28 | to verify |
| Is GPT-4.1 Mini available through ChatGPT? | openai.com β | 2026-05-28 | to verify |
| Does GPT-4.1 Mini support structured outputs (JSON schema)? | openai.com β | 2026-05-28 | to verify |