# GPT-5 Codex

GPT-5 Codex costs $1.25 per 1M input tokens and $10 per 1M output tokens on LLM API, with a 400K-token context window.

Model ID: `gpt-5-codex` · OpenAI · Text generation · Released September 23, 2025
Deprecated: stops serving requests on March 17, 2027.
Updated: 2026-10-27
Canonical: https://llmapi.ai/models/openai-gpt-5-codex/

- Input: $1.25 per 1M tokens
- Output: $10 per 1M tokens
- Cache read: $0.125 per 1M tokens
- Context: 400K tokens
- Max output: 128K tokens

## Pricing

Served by Azure, the only provider.

| Price | Amount | Per |
| --- | --- | --- |
| Input | $1.25 | per 1M tokens |
| Output | $10 | per 1M tokens |
| Cache read | $0.125 | per 1M tokens |

**Volume pricing.** At higher monthly volume, GPT-5 Codex may cost less. Book a call and sales will quote a price for your usage. [Book a call with sales](https://meetings.hubspot.com/julia-andriienko/llmapi) or [Create an account first](https://app.llmapi.ai/signup).

## Features

- Tools: Yes
- Parallel tool calls: No
- Image input: Yes
- Reasoning: Yes (Levels: low, medium, high)
- Prompt caching: Yes
- Structured outputs: Yes
- JSON mode: Yes
- Streaming: Yes
- Web search: No

## Call GPT-5 Codex

### Responses (`POST /v1/responses`)

Set LLMAPI_KEY to your LLM API key.

```python
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

response = client.responses.create(
    model="gpt-5-codex",
    input="Hello",
)
print(response.output_text)
```

Docs: [Responses docs](https://docs.llmapi.ai/api/v1/responses)

### Chat Completions (`POST /v1/chat/completions`)

Set LLMAPI_KEY to your LLM API key.

```python
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

response = client.chat.completions.create(
    model="gpt-5-codex",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
```

Docs: [Chat Completions docs](https://docs.llmapi.ai/api/v1/chat/completions)

## More from OpenAI

- [GPT-6 Astra](https://llmapi.ai/models/openai-gpt-6-astra/): $10 / $50 per 1M input / output
- [GPT-6.1 Sol](https://llmapi.ai/models/gpt-6-1-sol/): $2 / $10 per 1M input / output
- [GPT-6 Luna](https://llmapi.ai/models/openai-gpt-6-luna/): $0.075 / $0.375 per 1M input / output

Prices synced 2026-11-03.

Next step: [Get API key](https://app.llmapi.ai/signup)
