---
title: Codex setup
description: Connect the Codex terminal client using an Infistar API key and a Responses-compatible model.
lastUpdated: 2026-09-08
---

Codex is a terminal coding tool that can read and modify project files. You do not need it for ordinary web chat.

## Install

Install [Node.js](https://nodejs.org/), then run:

```bash
npm install -g @openai/codex
```

## Set the key in your current terminal

PowerShell:

```powershell
$env:INFISTAR_API_KEY = "YOUR_API_KEY"
```

macOS or Linux:

```bash
export INFISTAR_API_KEY="YOUR_API_KEY"
```

## Configure the provider

Edit `%USERPROFILE%\.codex\config.toml` on Windows or `~/.codex/config.toml` on macOS/Linux. Replace the placeholder model with an exact Responses-compatible model ID available to your key:

```toml
model = "YOUR_EXACT_MODEL_ID"
model_provider = "infistar"

[model_providers.infistar]
name = "Infistar"
base_url = "https://infistar.ai/v1"
env_key = "INFISTAR_API_KEY"
wire_api = "responses"
```

The environment variable must be available in the same terminal that runs `codex`; setting it in one shell does not automatically persist it in a new shell.

## Verify

Run `codex` in your project directory. For an initial configuration check, ask:

```text
Reply only with "Configuration successful". Do not read or modify files, and do not run commands.
```

If the key is missing, set the variable again in that terminal. For `404`, check the base URL includes `/v1` exactly once. For model errors, copy the current exact ID from [Model Square](https://infistar.ai/pricing). Review proposed actions and diffs before permitting edits.

Provider fields follow the [official Codex configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference).
