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

# Codex

> Configure Codex CLI to work with Axon models

### Get API Key

<CardGroup cols={2}>
  <Card title="Get API Key" icon="key" href="/axon-ai/api-keys">
    Generate a new API key
  </Card>
</CardGroup>

## Configuration

To integrate Axon models with Codex CLI, configure your `~/.codex/config.toml` file as following:

1. `vi ~/.codex/config.toml`

2. Add MatterAI as provider and `axon-code` model config:

```toml ~/.codex/config.toml lines icon="toml" theme={null}
model = "axon-code"
model_provider = "matterai"
model_context_window = 256000
model_max_output_tokens = 32000

[profiles.matterai]
model = "axon-code"
provider = "matterai"

[model_providers.matterai]
name = "MatterAI"
base_url = "https://api.matterai.so/v1"
env_key = "MATTERAI_API_KEY"
wire_api = "chat"
```

3. Export `MATTERAI_API_KEY` in your environment

```
export MATTERAI_API_KEY=<your_matterai_api_key>
```

<Note>
  This export is for the current shell, to always use it, please set in
  `~/.bashrc` OR `~/.zshrc` file
</Note>

4. Start using Codex

```
codex "explain this readme to me"
```
