Grok 4.20 Reasoning
Чем обслуживание в TheRouter отличается от вендорского
xAI предоставляет Grok 4.20 Reasoning как нативную модель xAI API с собственными ценовыми уровнями xAI, учётом reasoning-токенов, server-side tools и документированным ограничением: logprobs/top_logprobs silently ignored для Grok 4.20 и новее.
TheRouter обслуживает закреплённый маршрут xai/grok-4.20-reasoning через OpenAI-compatible chat endpoint с ценами TheRouter из standard-models.yaml; endpoints для media generation, audio и embeddings для этой модели не предоставляются.
Гид по API
Reasoning chat
Используйте стандартный OpenAI-compatible endpoint chat completions. Закрепляйте model id xai/grok-4.20-reasoning, когда нужно стабильное поведение Grok 4.20 reasoning вместо движущегося latest alias.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [
{"role": "system", "content": "Reason carefully, cite uncertainty, and give the shortest defensible answer."},
{"role": "user", "content": "Compare these two migration plans and identify the hidden failure modes."}
],
"reasoning": {"effort": "high"}
}'Reasoning + вызов инструментов
Reasoning-режим полезен, когда модель должна выбрать инструмент, проверить результат и продолжить. Держите схемы инструментов компактными, чтобы не тратить бюджет 2M контекста на лишние варианты.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{"role": "user", "content": "Find the risk score for customer c_123 and explain whether to escalate."}],
"tools": [{"type": "function", "function": {"name": "get_customer_risk", "description": "Return the current risk score for a customer", "parameters": {"type": "object", "properties": {"customer_id": {"type": "string"}}, "required": ["customer_id"]}}}],
"tool_choice": "auto",
"reasoning": {"effort": "medium"}
}'Vision reasoning
Передавайте блоки image_url через тот же chat endpoint для графиков, скриншотов, сканов и visual QA, где нужно рассуждение по evidence.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "https://therouter.ai/assets/vision-sample.png"}},
{"type": "text", "text": "Identify the single highest-risk bottleneck and justify it."}
]
}],
"reasoning": {"effort": "medium"}
}'Structured reasoning output
Сочетайте рассуждение с response_format: json_object, когда ответ должен потреблять downstream-система. Модель по-прежнему рассуждает внутренне, но финальное сообщение — разбираемый JSON.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-reasoning",
"messages": [{"role": "user", "content": "Return a risk matrix for migrating a healthcare support bot."}],
"response_format": {"type": "json_object"},
"reasoning": {"effort": "medium"}
}'Реестр фактов — каждая утверждаемая величина имеет источник
| источник | URL | получено | |
|---|---|---|---|
| Дата выпуска (публичный API) | — | — | неизвестно |
| Слаг модели API (закреплённый) | docs.x.ai ↗ | 2026-07-31 | проверено |
| Режим рассуждения | docs.x.ai ↗ | 2026-07-31 | проверено |
| Контекстное окно | docs.x.ai ↗ | 2026-07-31 | проверено |
| Максимум токенов завершения | — | — | проверено |
| Модальности ввода | docs.x.ai ↗ | 2026-07-31 | проверено |
| Модальности вывода | — | — | проверено |
| Цены TheRouter | — | — | проверено |
| Публичная upstream-цена | docs.x.ai ↗ | 2026-07-31 | проверено |
| Вызов функций / инструменты | — | — | проверено |
| Структурированные выводы (response_format) | — | — | проверено |
| Дата отсечки знаний | — | — | неизвестно |
| Лицензия | — | — | проверено |
| BenchLM public score | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| Chatbot Arena Elo — Text Overall | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| SWE-bench Verified | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| LiveCodeBench Pro | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| Terminal-Bench 2.0 | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| DeepSearchQA | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| ARC-AGI-2 | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| GPQA Diamond | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| HLE without tools | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| MMMU-Pro | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| CharXiv Reasoning | benchlm.ai ↗ | 2026-07-26 | неизвестно |
| BenchLM верифицирует профиль Grok 4.20 Reasoning с 19 публичными benchmark-строками | benchlm.ai ↗ | 2026-07-26 | проверено |
| Документация xAI перечисляет цены Grok 4.20 и compatibility caveats | docs.x.ai ↗ | 2026-07-31 | проверено |
| Когда выбирать xai/grok-4.20-reasoning вместо xai/grok-4.20-non-reasoning? | benchlm.ai ↗ | 2026-07-26 | к проверке |
| Новые xAI-нагрузки должны использовать Grok 4.20 Reasoning или Grok 4.3? | benchlm.ai ↗ | 2026-07-26 | к проверке |