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

# Codex

> Connect the Codex SDK or Codex CLI to the AI Reserve gateway over the OpenAI Responses format.

<Card title="Connect Codex in one click →" icon="zap" href="https://aireserve.com/connect/codex" horizontal>
  The guided connect page creates a managed key and walks you through the setup.
</Card>

The Codex runtime speaks the OpenAI Responses format, served at
`/v1/responses`:

```typescript theme={"dark"}
import { Codex } from "@openai/codex-sdk";

const codex = new Codex({
  baseUrl: "https://api.aireserve.com/v1", // /v1 suffix
  apiKey: process.env.AUDACITY_API_KEY,
});

const thread = codex.startThread({ model: "gpt-4o-mini" });
const result = await thread.run("hello");
```

If your codex install insists on ChatGPT-plan auth for the built-in provider, define a
custom provider in `~/.codex/config.toml` instead:

```toml theme={"dark"}
[model_providers.audacity]
name = "AI Reserve gateway"
base_url = "https://api.aireserve.com/v1"
env_key = "AUDACITY_API_KEY"
wire_api = "responses"
requires_openai_auth = false

model_provider = "audacity"
model = "gpt-4o-mini"
```
