---
title: "Codex CLI setup: config.toml, Responses API — AI Creator API"
description: "How to connect Codex CLI to AI Creator API with config.toml and the Responses protocol."
url: https://llm.aicreator.app/en/docs/codex/
lang: en
updated: 2026-11-10
---

# Codex CLI

Codex CLI works over OpenAI Responses and no longer supports Chat Completions. We answer over Responses as is: the `response.*` event stream, tools and reasoning.

## Setup

Add a provider to `~/.codex/config.toml`:

```toml title="~/.codex/config.toml"
model = "gpt-6-astra"
model_provider = "aic"

[model_providers.aic]
name = "AI Creator"
base_url = "https://api.aicreator.app/v1"
env_key = "AIC_API_KEY"
wire_api = "responses"
stream_idle_timeout_ms = 300000
```

Codex reads the key from the environment variable named by `env_key`:

```bash
export AIC_API_KEY=sk-aic-…
codex
```

- `base_url` ends with `/v1`.
- `wire_api = "responses"` — required.
- `stream_idle_timeout_ms` — five minutes without events; on long runs we send keepalives, so the stream holds.

## Models

Set `model` to the model’s full id. Models tagged Codex on the [pricing page](https://llm.aicreator.app/en/pricing/) work with Codex. The API itself gives the exact list for your key:

```bash
curl "https://api.aicreator.app/v1/models?surface=responses" \
  -H "Authorization: Bearer $AIC_API_KEY"
```

A model that is not on the Responses protocol returns 400 `model_not_available`. Other common failures are in [Troubleshooting](https://llm.aicreator.app/en/docs/troubleshooting/).
