GPT-4o Mini
Гид по API
Chat completion
GPT-4o Mini поддерживает стандартные chat completion с опциональными изображениями, вызовом инструментов, JSON-режимом и стримингом. Используйте ваш существующий OpenAI SDK — просто смените имя модели и 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"}
}'Стриминг
Потоковая передача токенов с низкой задержкой для чатов реального времени. Компактный размер GPT-4o Mini обеспечивает быстрое время первого токена.
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
}'Вызов инструментов
GPT-4o Mini поддерживает вызов функций для извлечения структурированных данных или запуска внешних действий — идеально для высокообъёмных пайплайнов извлечения данных и классификации.
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-режим
Гарантируйте структурированный JSON-вывод с помощью response_format. GPT-4o Mini широко используется для высокообъёмного извлечения данных из чеков, счетов, писем и диалогов.
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"}
}'Зрение / изображения
GPT-4o Mini принимает изображения для OCR, анализа документов и визуальной классификации. Комбинируйте с JSON-режимом для структурированного извлечения из чеков, форм и скриншотов.
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"}
}'Реестр фактов — каждая утверждаемая величина имеет источник
| источник | URL | получено | |
|---|---|---|---|
| Дата выпуска | openai.com ↗ | 2026-05-28 | проверено |
| Дата отсечения знаний | openai.com ↗ | 2026-05-28 | проверено |
| Макс. вывод токенов | openai.com ↗ | 2026-05-28 | проверено |
| Входные модальности | openai.com ↗ | 2026-05-28 | проверено |
| Выходные модальности | openai.com ↗ | 2026-05-28 | проверено |
| Лицензия | — | — | проверено |
| Метод безопасности | openai.com ↗ | 2026-05-28 | проверено |
| MMLU | openai.com ↗ | 2026-05-28 | проверено |
| MGSM | openai.com ↗ | 2026-05-28 | проверено |
| HumanEval | openai.com ↗ | 2026-05-28 | проверено |
| MMMU | openai.com ↗ | 2026-05-28 | проверено |
| LMSYS Chatbot Arena | openai.com ↗ | 2026-05-28 | проверено |
| GPT-4.1, GPT-4.1 mini и GPT-4.1 nano запущен в API | openai.com ↗ | 2026-05-28 | проверено |
| GPT-4o Mini анонсирована — замена GPT-3.5 Turbo | openai.com ↗ | 2026-05-28 | проверено |
| Поддерживается ли GPT-4o Mini после выхода GPT-4.1 Mini? | openai.com ↗ | 2026-05-28 | к проверке |
| Поддерживает ли GPT-4o Mini вызов функций/инструментов? | openai.com ↗ | 2026-05-28 | к проверке |
| Какова дата отсечения знаний GPT-4o Mini? | openai.com ↗ | 2026-05-28 | к проверке |
| Что делает GPT-4o Mini безопаснее предыдущих малых моделей? | openai.com ↗ | 2026-05-28 | к проверке |