> ## Documentation Index
> Fetch the complete documentation index at: https://mixroute.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-5.2 Codex

> GPT-5.2 Codex：编程与软件工程模型。包含 MixRoute 调用示例与参数。

GPT-5.2 Codex 是 OpenAI 推出的编程与软件工程模型。

可使用下方端点通过 MixRoute 调用 `gpt-5.2-codex`。

## 核心能力

* Responses API - 使用 input 传入文本或结构化内容
* 推理控制 - 可为支持的模型设置 reasoning effort
* 工具调用 - 支持函数与托管工具定义

## 快速示例

**cURL**

```bash theme={null}
curl "https://api.mixroute.ai/v1/responses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5.2-codex",
  "input": [
    {
      "role": "user",
      "content": "Explain quantum entanglement in simple terms."
    }
  ],
  "max_output_tokens": 256,
  "reasoning": {
    "effort": "low"
  }
}'
```

**Python**

```python theme={null}
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")

response = client.responses.create(
    model="gpt-5.2-codex",
    input="Explain quantum entanglement in simple terms.",
    reasoning={"effort": "low"},
    max_output_tokens=256,
)

print(response.output_text)
```

**Streaming**

```python theme={null}
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.mixroute.ai/v1")

with client.responses.stream(
    model="gpt-5.2-codex",
    input="Write a short poem about the sea.",
    reasoning={"effort": "low"},
    max_output_tokens=256,
) as stream:
    for event in stream:
        if event.type == "response.output_text.delta":
            print(event.delta, end="")
```

## 参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `gpt-5.2-codex`。 |
| `input` | string \| array | 是 | 文本或结构化输入。 |
| `max_output_tokens` | integer | 否 | 最大输出 token 数。 |
| `stream` | boolean | 否 | 启用 SSE 流式输出，默认 false。 |
| `reasoning` | object | 否 | 推理配置，包括 effort。 |
| `text` | object | 否 | 文本格式与 verbosity 控制。 |
| `tools` | array | 否 | 模型可以调用的工具。 |
| `store` | boolean | 否 | 是否存储响应。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.