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

# Use AIsa in Codex

> Add AIsa as a model provider in OpenAI's Codex CLI with one config block.

Use AIsa in the Codex CLI with one provider block in `~/.codex/config.toml` and one API key.

AIsa endpoint:

```txt theme={null}
https://api.aisa.one/v1
```

## Prerequisites

Before you start, make sure you have:

* An AIsa API key ([console.aisa.one/api-keys](https://console.aisa.one/api-keys))
* A terminal on macOS, Linux, or Windows WSL2

## 1. Install Codex

```bash theme={null}
npm install -g @openai/codex
```

Or with Homebrew:

```bash theme={null}
brew install codex
```

Verify the installation:

```bash theme={null}
codex --version
```

## 2. Add AIsa as the model provider

Export your AIsa API key (add it to `~/.zshrc` or `~/.bashrc` to persist):

```bash theme={null}
export AISA_API_KEY="sk-aisa-..."
```

Then add this to `~/.codex/config.toml` (create the file if it doesn't exist):

```toml theme={null}
model = "gpt-5.3-codex"
model_provider = "aisa"

[model_providers.aisa]
name = "AIsa"
base_url = "https://api.aisa.one/v1"
env_key = "AISA_API_KEY"
wire_api = "chat"
```

* `env_key` tells Codex which environment variable holds your key.
* `wire_api = "chat"` uses AIsa's standard OpenAI-compatible Chat Completions endpoint. Models that expose `POST /v1/responses` in the [catalog](/docs/guides/models) (e.g. `gpt-5.4`, `gpt-5.5`) also work with `wire_api = "responses"`.
* Swap `model` for any coding-capable model — `gpt-5`, `claude-opus-4-8`, `kimi-k2.5`, `qwen3-coder-plus`, etc.

## 3. Start Codex and connect AIsa capabilities

```bash theme={null}
codex
```

Then paste this prompt:

```txt theme={null}
Read https://aisa.one/docs/agent-quickstart.md and help me safely connect, configure, and use AIsa's APIs, Skills, and LLMs in this agent environment.
```

Codex will fetch AIsa's agent-facing instructions and guide you through the remaining setup.

Try:

```txt theme={null}
Use AIsa capabilities to search the web and summarize the latest information about Codex CLI.
```

## Quick reference

| Item                    | Value                                                                                                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Config file             | `~/.codex/config.toml`                                                                                                                                   |
| `base_url`              | `https://api.aisa.one/v1`                                                                                                                                |
| `env_key`               | `AISA_API_KEY`                                                                                                                                           |
| `wire_api`              | `chat` (or `responses` for models that support it)                                                                                                       |
| Default model           | `gpt-5.3-codex`                                                                                                                                          |
| Capability setup prompt | `Read https://aisa.one/docs/agent-quickstart.md and help me safely connect, configure, and use AIsa's APIs, Skills, and LLMs in this agent environment.` |

## Troubleshooting

| Problem                              | Fix                                                                              |
| ------------------------------------ | -------------------------------------------------------------------------------- |
| Authentication error (401)           | Confirm `AISA_API_KEY` is exported: `echo $AISA_API_KEY`                         |
| "unexpected status 404"              | Make sure `base_url` is exactly `https://api.aisa.one/v1`                        |
| Errors with `wire_api = "responses"` | Switch to `wire_api = "chat"`, or pick a model that exposes `POST /v1/responses` |
| Model not found                      | Use an exact model ID from the [catalog](/docs/guides/models)                         |
| Codex still asks for ChatGPT login   | Confirm `model_provider = "aisa"` is set at the top level of `config.toml`       |

## Related

<CardGroup cols={3}>
  <Card title="Use AIsa in Claude Code" icon="terminal" href="/docs/guides/tutorials/use-aisa-in-claude-code">
    Configure Anthropic's Claude Code with the same AIsa key.
  </Card>

  <Card title="Authentication" icon="key" href="/docs/guides/authentication">
    API key creation, rotation, and storage best practices.
  </Card>

  <Card title="Model Catalog" icon="list" href="/docs/guides/models">
    Browse coding models before choosing a Codex default.
  </Card>
</CardGroup>
