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

# GPT-5.2 Codex

> GPT-5.2 Codex: coding and software engineering model. Request examples and parameters for MixRoute.

GPT-5.2 Codex is a coding and software engineering model from OpenAI.

Call `gpt-5.2-codex` through MixRoute using the endpoint shown below.

## Key capabilities

* Responses API - Uses input for text and structured content
* Reasoning control - Configure reasoning effort on supported models
* Tool use - Supports function and hosted tool definitions

## Quick example

<Tabs>
  <Tab title="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"
      }
    }'
    ```
  </Tab>

  <Tab title="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)
    ```
  </Tab>

  <Tab title="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="")
    ```
  </Tab>
</Tabs>

## Parameters

| Parameter           | Type            | Required | Description                                |
| ------------------- | --------------- | -------- | ------------------------------------------ |
| `model`             | string          | Yes      | Must be `gpt-5.2-codex`.                   |
| `input`             | string \| array | Yes      | Text or structured response input.         |
| `max_output_tokens` | integer         | No       | Maximum output tokens.                     |
| `stream`            | boolean         | No       | Enable SSE streaming. Default: false.      |
| `reasoning`         | object          | No       | Reasoning configuration, including effort. |
| `text`              | object          | No       | Text format and verbosity controls.        |
| `tools`             | array           | No       | Tools the model may call.                  |
| `store`             | boolean         | No       | Whether to store the response.             |
