GPT-5.2-Codex
Гид по API
Chat completion
Стандартные chat completions — работают с OpenAI SDK после замены baseURL на api.therouter.ai/v1. Поддерживаются все параметры GPT-5.2-Codex, включая reasoning_effort, tools и response_format.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2-codex",
"messages": [
{"role": "system", "content": "You are an expert software engineer."},
{"role": "user", "content": "Write a Python function to merge two sorted lists in place."}
]
}'Streaming
Для длительных сессий кодинга потоковая передача позволяет видеть промежуточные результаты, не дожидаясь полного ответа. GPT-5.2-Codex поддерживает стандартный SSE-стриминг.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2-codex",
"messages": [{"role": "user", "content": "Explain the visitor pattern with a TypeScript example."}],
"stream": true
}'Function calling / tools
GPT-5.2-Codex отлично справляется с агентным использованием инструментов — модель может координировать параллельные вызовы и поддерживать состояние в многоэтапных сессиях, что идеально для агентов, которым нужно читать файлы, запускать тесты или запрашивать базы данных.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2-codex",
"messages": [
{"role": "user", "content": "Find all pending-review comments in the /src directory"}
],
"tools": [{
"type": "function",
"function": {
"name": "search_files",
"description": "Search for text patterns in files",
"parameters": {
"type": "object",
"properties": {
"pattern": {"type": "string"},
"path": {"type": "string"}
},
"required": ["pattern", "path"]
}
}
}],
"tool_choice": "auto"
}'Reasoning effort
GPT-5.2-Codex поддерживает настраиваемое усилие рассуждений. Модель наследует глубину рассуждений GPT-5.2 — сравнима с GPT-5.2-Thinking по бенчмаркам — с добавлением оптимизаций Codex для долгосрочных агентных задач.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2-codex",
"messages": [
{"role": "user", "content": "Design a distributed cache eviction strategy for a multi-region deployment."}
],
"reasoning_effort": "high"
}'JSON mode
GPT-5.2-Codex поддерживает response_format для структурированного JSON-вывода. Полезно для извлечения структурированных данных из кода, генерации типизированных интерфейсов или создания машиночитаемых результатов анализа.
curl https://api.therouter.ai/v1/chat/completions -H "Authorization: Bearer $THEROUTER_API_KEY" -H "Content-Type: application/json" -d '{
"model": "openai/gpt-5.2-codex",
"messages": [
{"role": "user", "content": "Analyze this code and return a structured summary of potential bugs: function add(a,b){return a+b}"}
],
"response_format": { "type": "json_object" }
}'Vision / изображения
GPT-5.2-Codex принимает изображения для интерпретации скриншотов, технических диаграмм, макетов и UI-поверхностей. Модель может превращать дизайн-макеты в функциональные прототипы и анализировать UI-баги по скриншотам.
curl https://api.therouter.ai/v1/chat/completions -H "Authorization: Bearer $THEROUTER_API_KEY" -H "Content-Type: application/json" -d '{
"model": "openai/gpt-5.2-codex",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Convert this UI mockup to HTML/CSS code."},
{"type": "image_url", "image_url": {"url": "https://therouter.ai/assets/vision-sample.png"}}
]
}
],
"max_tokens": 4000
}'Реестр фактов — каждая утверждаемая величина имеет источник
| источник | URL | получено | |
|---|---|---|---|
| Дата релиза | openai.com ↗ | 2026-05-28 | проверено |
| Дата отсечения знаний | simonwillison.net ↗ | 2026-05-28 | проверено |
| Архитектура | — | — | неизвестно |
| Компрессия контекста | platform.openai.com ↗ | 2026-05-28 | проверено |
| Поддержка Windows | openai.com ↗ | 2026-05-28 | проверено |
| Преемник | openai.com ↗ | 2026-05-28 | проверено |
| SWE-Bench Pro | openai.com ↗ | 2026-05-28 | проверено |
| Terminal-Bench 2.0 | openai.com ↗ | 2026-05-28 | проверено |
| SWE-Bench Verified (Python) | nxcode.io ↗ | 2026-05-28 | к проверке |
| CVE-Bench | nxcode.io ↗ | 2026-05-28 | к проверке |
| AIME 2025 | digitalapplied.com ↗ | 2026-05-28 | к проверке |
| OpenAI выпускает GPT-5.3-Codex, преемника GPT-5.2-Codex | openai.com ↗ | 2026-05-28 | проверено |
| OpenAI запускает GPT-5.2-Codex | openai.com ↗ | 2026-05-28 | проверено |
| В чём разница между GPT-5.2-Codex и GPT-5.2? | openai.com ↗ | 2026-05-28 | к проверке |
| Стоит ли использовать GPT-5.2-Codex или GPT-5.3-Codex? | openai.com ↗ | 2026-05-28 | к проверке |
| Могу ли я использовать GPT-5.2-Codex через стандартный OpenAI SDK на TheRouter? | openai.com ↗ | 2026-05-28 | к проверке |
| Какими кибербезопасными возможностями обладает GPT-5.2-Codex? | openai.com ↗ | 2026-05-28 | к проверке |
| GPT-5.2-Codex всё ещё доступен на TheRouter? | openai.com ↗ | 2026-05-28 | к проверке |