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

# Codex

> High-reasoning capabilities for complex tasks and critical reviews

## Overview

Codex is powered by OpenAI's models and offers high-reasoning capabilities for complex tasks and critical reviews.

## Latest Model

* **GPT 5.2** - OpenAI's latest model with advanced reasoning capabilities

## Authentication

Codex supports two authentication methods:

<Tabs>
  <Tab title="OpenAI API Key">
    **Pay-as-you-go API access**

    1. Get an API key at [OpenAI Platform](https://platform.openai.com/api-keys)
    2. In [Blocks Dashboard](https://blocks.team), go to **Dashboard** → **Agents**
    3. Select **Codex** and choose "API Key"
    4. Paste your API key (starts with `sk-`)
  </Tab>

  <Tab title="OpenAI Subscription">
    **Connect your ChatGPT Plus/Team subscription**

    1. Go to [Blocks Dashboard](https://blocks.team) → **Dashboard** → **Agents**
    2. Select **Codex** and choose "Connect Subscription"
    3. Authorize Blocks to use your OpenAI subscription

    This uses your subscription credits instead of pay-as-you-go billing.
  </Tab>
</Tabs>

## Setting as Default

To use Codex automatically for all requests:

1. Go to **Dashboard** → **Agents**
2. Select "Set as default agent" from Codex's dropdown menu

## Using Codex

Once configured, Codex is used automatically if it's your default agent:

```
@blocks can you implement this feature?
```

Or use the `/codex` slash command to use it specifically:

```
@blocks /codex implement this API endpoint
```

## Best For

* Complex reasoning tasks
* Critical code reviews
* Advanced problem solving
* Detailed analysis
* Architecture decisions
* In-depth explanations

## Cost

Codex uses your OpenAI API key or subscription:

* Check pricing at [OpenAI Pricing](https://openai.com/pricing)
* Monitor usage in [OpenAI Dashboard](https://platform.openai.com/usage)
* API usage is billed by OpenAI based on tokens

## Next Steps

<CardGroup cols={2}>
  <Card title="Claude Code" icon="brain" href="/using-blocks/agents/claude-code">
    Learn about Claude Code
  </Card>

  <Card title="Gemini CLI" icon="sparkles" href="/using-blocks/agents/gemini-cli">
    Explore Gemini CLI (experimental)
  </Card>
</CardGroup>
