Back to Models
GPT-5-Codex
openaiopenai/gpt-5-codex
API guide
Chat completion
Via TheRouter, gpt-5-codex is called through the standard chat completions endpoint. TheRouter abstracts the native Responses API to the familiar chat completions interface.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5-codex",
"messages": [
{"role": "user", "content": "Write a Python script to parse logs and extract error counts for each module."}
],
"reasoning_effort": "medium"
}'Tool calling
GPT-5-Codex supports full GPT-5 tool-calling including parallel tool calls and custom_tools with grammar constraints. This powers Codex's filesystem, terminal, and web search interactions.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5-codex",
"messages": [
{"role": "user", "content": "Look at the src/ directory and list all test files"}
],
"tools": [{
"type": "function",
"function": {
"name": "list_files",
"description": "List files in a directory",
"parameters": { "type": "object", "properties": { "path": {"type": "string"} } }
}
}],
"tool_choice": "auto"
}'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-5-codex",
"messages": [
{"role": "user", "content": "Refactor this function to use async/await"}
],
"stream": true
}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-28 | verified |
| Training cutoff | β | β | unknown |
| OpenAI model id | platform.openai.com β | 2026-05-28 | verified |
| API availability | openai.com β | 2026-05-28 | verified |
| Dynamic reasoning | openai.com β | 2026-05-28 | verified |
| Autonomous execution | openai.com β | 2026-05-28 | verified |
| License | β | β | verified |
| SWE-bench Verified | openai.com β | 2026-05-28 | verified |
| Code Refactoring | openai.com β | 2026-05-28 | verified |
| Code Review Accuracy | openai.com β | 2026-05-28 | verified |
| OpenAI releases GPT-5.5 with stronger Codex performance | openai.com β | 2026-05-28 | verified |
| OpenAI releases GPT-5.3-Codex system card | openai.com β | 2026-05-28 | verified |
| OpenAI launches GPT-5.2-Codex with SOTA on agentic coding benchmarks | openai.com β | 2026-05-28 | verified |
| OpenAI releases GPT-5-Codex for agentic coding in Codex | openai.com β | 2026-05-28 | verified |
| What is the difference between GPT-5 and GPT-5-Codex? | openai.com β | 2026-05-28 | to verify |
| Can I use GPT-5-Codex via TheRouter's API? | openai.com β | 2026-05-28 | to verify |
| How does GPT-5-Codex pricing compare to GPT-5? | openai.com β | 2026-05-28 | to verify |
| Is GPT-5-Codex good for non-coding tasks? | openai.com β | 2026-05-28 | to verify |