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

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Codex CLI

> Point the OpenAI Codex CLI at Venice models with a config.toml model provider entry, your VENICE_API_KEY, and the OpenAI-compatible base URL.

This guide shows how to run OpenAI Codex CLI with Venice using Codex's official config paths: `~/.codex/config.toml` (user-level) or `.codex/config.toml` (project-level).

> [card] Simple Setup
>
> One config file in your project

> [card] OpenAI Compatible
>
> Uses Venice's OpenAI-compatible API

> [card] Model Flexibility
>
> Swap in any supported Venice text model

***

## Prerequisites

* A Venice API key from [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation)
* Codex CLI installed and working on your machine

***

## Setup

**1. Create the project config path**

From your project root:

```bash theme={"system"}
mkdir -p .codex
```

**2. Create .codex/config.toml**

Create the file and paste the configuration below:

```toml theme={"system"}
#:schema https://developers.openai.com/codex/config-schema.json

model = "openai-gpt-54" # use any Venice model
model_provider = "venice"
model_reasoning_effort = "high"
personality = "pragmatic"
sandbox_mode = "workspace-write"

[model_providers.venice]
name = "Venice"
base_url = "https://api.venice.ai/api/v1/"
experimental_bearer_token = "YOUR VENICE API KEY"
wire_api = "responses"
```

**3. Replace the two placeholders**

Update:

* `model` with the Venice model ID you want to use
* `experimental_bearer_token` with your real Venice API key

You can browse available model IDs in the [text model catalog](https://docs.venice.ai/models/text.md).

**4. Run Codex CLI normally**

Start Codex CLI from the same project. It will load `.codex/config.toml` (for trusted projects) and route requests through Venice.

***

## Official Codex Config Locations

* **User defaults**: `~/.codex/config.toml`
* **Project overrides**: `.codex/config.toml` (loaded only for trusted projects)

If you want Venice settings to apply everywhere, put the same config in `~/.codex/config.toml`.

***

## Configuration Precedence (Highest First)

1. CLI flags and `--config` overrides
2. Profile values (`--profile <name>`)
3. Project config layers (`.codex/config.toml`, closest directory wins)
4. User config (`~/.codex/config.toml`)
5. System config (`/etc/codex/config.toml`, Unix)
6. Built-in defaults

***

## Notes

* Keep your API key private and never commit real keys to git.
* Codex ignores project `.codex/` config when a project is marked untrusted.
* If you switch models, only update the `model` field.
* The `wire_api = "responses"` setting is required for this provider setup.

***

## Resources

> [card] [Venice API Reference](https://docs.venice.ai/api-reference/api-spec.md)
>
> Full endpoint and parameter docs

> [card] [Venice Text Models](https://docs.venice.ai/models/text.md)
>
> Available model IDs

> [card] [Debug with a Local Proxy](https://docs.venice.ai/learn/local-debug-proxy.md)
>
> See every request Codex sends to Venice


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