Back to Models
GPT-4o
openaiopenai/gpt-4o
API guide
Chat completion
Standard chat or text-in/text-out completion via TheRouter's OpenAI-compatible endpoint.
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","messages":[{"role":"user","content":"Explain what GPT-4o is in one sentence."}]}'Vision / image input
GPT-4o accepts image URLs or base64-encoded images alongside text in the chat message.
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","messages":[{"role":"user","content":[{"type":"text","text":"Describe what is in this image"},{"type":"image_url","image_url":{"url":"https://therouter.ai/assets/vision-sample.png"}}]}]}'Structured output (JSON)
Use response_format to get GPT-4o to return valid JSON matching a schema β ideal for tool calls, data extraction, and 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-4o","messages":[{"role":"user","content":"Extract the name, age, and city from: John is 32 and lives in Tokyo."}],"response_format":{"type":"json_object"}}'Tool / function calling
GPT-4o natively supports tool calling for structured function invocations within the conversation.
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","messages":[{"role":"user","content":"What is the weather in Tokyo?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}'Streaming
Stream partial completions token-by-token for low-latency user experiences.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"model":"openai/gpt-4o","messages":[{"role":"user","content":"Tell me a short story"}],"stream":true}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-28 | verified |
| Latest snapshot | developers.openai.com β | 2026-05-28 | verified |
| Training cutoff | β | β | single source |
| Input modalities | openai.com β | 2026-05-28 | verified |
| Output modalities | openai.com β | 2026-05-28 | verified |
| Structured output support | platform.openai.com β | 2026-05-28 | verified |
| Max output tokens | developers.openai.com β | 2026-05-28 | verified |
| Deployment | openai.com β | 2026-05-28 | verified |
| License | β | β | verified |
| MMLU | openai.com β | 2026-05-28 | verified |
| HumanEval | openai.com β | 2026-05-28 | verified |
| MMMU | openai.com β | 2026-05-28 | verified |
| MATH | openai.com β | 2026-05-28 | verified |
| GSM8K | openai.com β | 2026-05-28 | verified |
| GPT-4o retired from ChatGPT | openai.com β | 2026-05-28 | verified |
| GPT-4.1 announced as GPT-4o successor | openai.com β | 2026-05-28 | verified |
| GPT-4o November 2024 snapshot released | openai.com β | 2026-05-28 | verified |
| Is GPT-4o still available in the API? | openai.com β | 2026-05-28 | to verify |
| What is the difference between GPT-4o and GPT-4o Mini? | openai.com β | 2026-05-28 | to verify |
| Can GPT-4o process audio inputs? | openai.com β | 2026-05-28 | to verify |
| Is GPT-4o a reasoning model? | openai.com β | 2026-05-28 | to verify |