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

# Connect Codex CLI and desktop to APIONE

> Configure a custom provider for the Responses API.

Codex uses the Responses protocol. APIONE exposes /v1/responses; select a model that supports this protocol and coding tool calls.

## Set the key

After installing Codex CLI, set the key in the terminal used to launch it:

```bash theme={null}
export APIONE_API_KEY="YOUR_APIONE_KEY"
```

In PowerShell, use `$env:APIONE_API_KEY="YOUR_APIONE_KEY"`. Do not commit real credentials.

## Add a custom provider

Merge the following into the user-level `~/.codex/config.toml`, retaining other settings. Replace the model placeholder:

```toml theme={null}
model_provider = "apione"
model = "YOUR_APIONE_MODEL_ID"

[model_providers.apione]
name = "APIONE"
base_url = "https://api.apione.ai/v1"
env_key = "APIONE_API_KEY"
wire_api = "responses"
```

The env\_key value is the environment variable name, not the key itself. Do not append /responses to the base URL. See the [official configuration reference](https://developers.openai.com/codex/config-reference/).

## One-click setup from APIONE desktop

In APIONE desktop, choose the tool, pricing group, and model. Review the configuration file and Responses URL in **Confirm changes**, then apply the setup. Retain the generated local model catalog together with its configuration. Back up existing settings before switching between manual and one-click setup; use one credential source for the selected provider.

![APIONE one-click Codex Responses configuration preview](https://mintcdn.com/apione/eGTb2vS-514SNt6Q/images/integrations/screenshots/codex-desktop-preview.png?fit=max\&auto=format\&n=eGTb2vS-514SNt6Q\&q=85\&s=b8ba2cab77ce6479e6221a6a91534548)

Review the Codex configuration changes in APIONE desktop.

## Launch and verify

Open a test project in the same terminal and run `codex`. Ask it to explain the directory structure. Confirm APIONE request activity before testing tools. Basic text generation does not establish support for remote compaction, web search, or other extended capabilities.

The desktop app should use the same user's configuration. Fully quit and relaunch after changes. **An app launched from a desktop icon may not inherit shell variables.** If APIONE\_API\_KEY is unavailable, use a credential or launch-environment method supported by that desktop version.

## Troubleshoot

* 401: confirm the running process can access a valid key.
* 404 or model errors: check the model ID and Responses access.
* 400: check tool, reasoning, and optional parameter support.
* Old provider still used: inspect project settings or launch arguments overriding user settings.

APIONE API charges are separate from ChatGPT or Codex subscriptions. An APIONE key does not provide official subscription benefits.

***

[Integration directory](https://apione.ai/docs/en/guides/clients.md) · [Choose a model](https://apione.ai/docs/en/models/catalog.md) · [Troubleshooting](https://apione.ai/docs/en/support/errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.