GPT-4o Mini
API guide
Chat completion
GPT-4o Mini handles standard chat completions with optional vision/image inputs, tool calls, JSON mode, and streaming. Use the same OpenAI SDK you already have β just swap the model name and base URL.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Extract the date, vendor name, and total from this receipt in JSON."}
],
"response_format": {"type": "json_object"}
}'Streaming
Low-latency per-token streaming for real-time customer-facing chat. GPT-4o Mini's small footprint delivers fast first-token times.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Write a 200-word summary of quantum computing."}],
"stream": true
}'Tool calling
GPT-4o Mini supports function calling for extracting structured data or triggering external actions β ideal for high-volume data extraction and classification pipelines.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "What is the weather like in Tokyo today?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}]
}'JSON mode
Guarantee structured JSON output with response_format. GPT-4o Mini is widely used for high-volume data extraction from receipts, invoices, emails, and chat transcripts.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{"role": "system", "content": "Extract name, email, and intent as JSON."},
{"role": "user", "content": "Hi, I am Jane from Acme Corp, please email me the invoice at jane@acme.com."}
],
"response_format": {"type": "json_object"}
}'Vision / image input
GPT-4o Mini accepts images for OCR, document analysis, and visual classification tasks. Combine with JSON mode for structured extraction from receipts, forms, and screenshots.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Extract the total amount and date from this receipt."},
{"type": "image_url", "image_url": {"url": "https://therouter.ai/assets/vision-sample.png"}}
]
}
],
"response_format": {"type": "json_object"}
}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-28 | verified |
| Knowledge cutoff | openai.com β | 2026-05-28 | verified |
| Max output tokens | openai.com β | 2026-05-28 | verified |
| Input modalities | openai.com β | 2026-05-28 | verified |
| Output modalities | openai.com β | 2026-05-28 | verified |
| License | β | β | verified |
| Safety technique | openai.com β | 2026-05-28 | verified |
| MMLU | openai.com β | 2026-05-28 | verified |
| MGSM | openai.com β | 2026-05-28 | verified |
| HumanEval | openai.com β | 2026-05-28 | verified |
| MMMU | openai.com β | 2026-05-28 | verified |
| LMSYS Chatbot Arena | openai.com β | 2026-05-28 | verified |
| GPT-4.1, GPT-4.1 mini, and GPT-4.1 nano launched in API | openai.com β | 2026-05-28 | verified |
| GPT-4o Mini announced β replacing GPT-3.5 Turbo | openai.com β | 2026-05-28 | verified |
| Is GPT-4o Mini still supported after GPT-4.1 Mini launched? | openai.com β | 2026-05-28 | to verify |
| Does GPT-4o Mini support function/tool calling? | openai.com β | 2026-05-28 | to verify |
| What is the knowledge cutoff date for GPT-4o Mini? | openai.com β | 2026-05-28 | to verify |
| What makes GPT-4o Mini safer than previous small models? | openai.com β | 2026-05-28 | to verify |