Назад к моделям
GPT-4.1 Mini
openaiopenai/gpt-4.1-mini
Гид по API
Chat completion
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Hello"}]}'Стриминг
Стриминг идентичен SDK OpenAI — установите stream: true.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Hello"}],"stream":true}'Вызов инструментов
GPT-4.1 Mini поддерживает параллельный вызов инструментов и определение функций через OpenAI-совместимый API.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"What is the weather in Tokyo?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get current temperature","parameters":{"type":"object","properties":{"location":{"type":"string"}}}}}],"tool_choice":"auto"}'Структурированные выходные данные
Установите response_format в JSON schema для гарантированного структурированного разбора.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Extract name and age from: John is 30"}],"response_format":{"type":"json_schema","json_schema":{"name":"person","strict":true,"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"number"}},"additionalProperties":false}}}}'Реестр фактов — каждая утверждаемая величина имеет источник
| источник | URL | получено | |
|---|---|---|---|
| Дата релиза | 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 | проверено |
| GPQA Diamond | openai.com ↗ | 2026-05-28 | проверено |
| IFEval | openai.com ↗ | 2026-05-28 | к проверке |
| Запуск семейства GPT-4.1 | openai.com ↗ | 2026-05-28 | проверено |
| Как GPT-4.1 Mini соотносится с GPT-4o Mini? | openai.com ↗ | 2026-05-28 | к проверке |
| Доступна ли GPT-4.1 Mini в ChatGPT? | openai.com ↗ | 2026-05-28 | к проверке |
| Поддерживает ли GPT-4.1 Mini структурированные выходные данные (JSON schema)? | openai.com ↗ | 2026-05-28 | к проверке |