Back to Models

GPT-4o Mini

openaiopenai/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
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
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
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
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
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
sourceURLretrieved
Release dateopenai.com β†—2026-05-28verified
Knowledge cutoffopenai.com β†—2026-05-28verified
Max output tokensopenai.com β†—2026-05-28verified
Input modalitiesopenai.com β†—2026-05-28verified
Output modalitiesopenai.com β†—2026-05-28verified
Licenseβ€”β€”verified
Safety techniqueopenai.com β†—2026-05-28verified
MMLUopenai.com β†—2026-05-28verified
MGSMopenai.com β†—2026-05-28verified
HumanEvalopenai.com β†—2026-05-28verified
MMMUopenai.com β†—2026-05-28verified
LMSYS Chatbot Arenaopenai.com β†—2026-05-28verified
GPT-4.1, GPT-4.1 mini, and GPT-4.1 nano launched in APIopenai.com β†—2026-05-28verified
GPT-4o Mini announced β€” replacing GPT-3.5 Turboopenai.com β†—2026-05-28verified
Is GPT-4o Mini still supported after GPT-4.1 Mini launched?openai.com β†—2026-05-28to verify
Does GPT-4o Mini support function/tool calling?openai.com β†—2026-05-28to verify
What is the knowledge cutoff date for GPT-4o Mini?openai.com β†—2026-05-28to verify
What makes GPT-4o Mini safer than previous small models?openai.com β†—2026-05-28to verify
Help & contact