# GPT-5.2 Codex

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

Model ID: `gpt-5.2-codex` · OpenAI · Text generation · Released January 14, 2026
Deprecated.
Updated: 2026-10-13
Canonical: https://llmapi.ai/models/openai-gpt-5-2-codex/

- Input: $1.75 per 1M tokens
- Output: $14 per 1M tokens
- Cache read: $0.175 per 1M tokens
- Context: 400K tokens
- Max output: 4K tokens

## Pricing

Served by Azure, the only provider.

| Price | Amount | Per |
| --- | --- | --- |
| Input | $1.75 | per 1M tokens |
| Output | $14 | per 1M tokens |
| Cache read | $0.175 | per 1M tokens |
| Web search | $0.01 | per search |

**Volume pricing.** At higher monthly volume, GPT-5.2 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: none, low, medium, high, xhigh)
- Prompt caching: Yes
- Structured outputs: Yes
- JSON mode: Yes
- Streaming: Yes
- Web search: Yes
- Also accepts: codex-latest

## Call GPT-5.2 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.2-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.2-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)
