Назад к моделям
GPT-4o
openaiopenai/gpt-4o
Гид по API
Chat completion
Стандартный чат или text-in/text-out через OpenAI-совместимый эндпоинт TheRouter.
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 / Изображения
GPT-4o принимает URL изображений или base64-кодированные изображения вместе с текстом в сообщении чата.
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"}}]}]}'Структурированный вывод (JSON)
Используйте response_format для получения от GPT-4o валидного JSON, соответствующего схеме — идеально для вызова инструментов, извлечения данных и парсинга.
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 нативно поддерживает вызов инструментов для структурированных функций в рамках диалога.
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
Стриминг частичных завершений токен за токеном для низкой задержки.
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}'Реестр фактов — каждая утверждаемая величина имеет источник
| источник | URL | получено | |
|---|---|---|---|
| Дата релиза | openai.com ↗ | 2026-05-28 | проверено |
| Последний snapshot | developers.openai.com ↗ | 2026-05-28 | проверено |
| Дата отсечения данных | — | — | один источник |
| Модальности ввода | openai.com ↗ | 2026-05-28 | проверено |
| Модальности вывода | openai.com ↗ | 2026-05-28 | проверено |
| Структурированный вывод | platform.openai.com ↗ | 2026-05-28 | проверено |
| Максимум выходных токенов | developers.openai.com ↗ | 2026-05-28 | проверено |
| Доступ | openai.com ↗ | 2026-05-28 | проверено |
| Лицензия | — | — | проверено |
| MMLU | openai.com ↗ | 2026-05-28 | проверено |
| HumanEval | openai.com ↗ | 2026-05-28 | проверено |
| MMMU | openai.com ↗ | 2026-05-28 | проверено |
| MATH | openai.com ↗ | 2026-05-28 | проверено |
| GSM8K | openai.com ↗ | 2026-05-28 | проверено |
| GPT-4o udalena iz ChatGPT | openai.com ↗ | 2026-05-28 | проверено |
| GPT-4.1 anonsirovana kak preyemnik GPT-4o | openai.com ↗ | 2026-05-28 | проверено |
| Vypushchen snapshot GPT-4o noyabrya 2024 | openai.com ↗ | 2026-05-28 | проверено |
| GPT-4o vse yeshche dostupna v API? | openai.com ↗ | 2026-05-28 | к проверке |
| V chem raznitsa mezhdu GPT-4o i GPT-4o Mini? | openai.com ↗ | 2026-05-28 | к проверке |
| Mozhet li GPT-4o obrabatyvat audio vkhod? | openai.com ↗ | 2026-05-28 | к проверке |
| Yavlyayetsya li GPT-4o reasoning-modelu? | openai.com ↗ | 2026-05-28 | к проверке |