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

# Codex

> Connect Codex to ViVi-API.

Have an API key from the [ViVi-API dashboard](https://api.viviai.cc/dashboard) ready, and confirm that its group supports your chosen model. Back up any existing configuration before merging the fields below.

## Configuration files

| Operating system | Default directory |
| - | - |
| Windows | `C:\Users\<username>\.codex` |
| macOS | `/Users/<username>/.codex` |
| Linux | `/home/<username>/.codex` |

Edit `config.toml` and `auth.json` in this directory, creating them if they do not exist. If `CODEX_HOME` is set, use that directory instead.

```toml config.toml theme={null}
model = "gpt-6-astra"
model_reasoning_effort = "high"
model_provider = "viviai"
cli_auth_credentials_store = "file"

[model_providers.viviai]
name = "viviai"
base_url = "https://api.viviai.cc/v1"
wire_api = "responses"
requires_openai_auth = true
```

```json auth.json theme={null}
{
  "OPENAI_API_KEY": "sk-your-api-key"
}
```

Choose a model available to your account that supports the Responses protocol. The example uses the ViVi-API model ID `gpt-6-astra`. Save the files, restart Codex, and test in a new conversation.

> [!NOTE]
>
> Codex uses the Responses protocol, so the gateway must support `/v1/responses`. Models or channels that only support Chat Completions may not work with Codex. Do not commit `auth.json` to a repository: it contains your API key.

This example stores credentials in a file. Back up your existing settings if you already use ChatGPT sign-in or another provider. For supported client settings, see the [official Codex configuration reference](https://developers.openai.com/codex/config-reference).

See the [Integration overview](https://docs.viviai.cc/en/scenarios.md) and [FAQ](https://docs.viviai.cc/en/faq.md) for more help.


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