Skip to main content

Codex CLI

Before you start

You need a Divyam account and an API key. If you don't have them yet, follow Getting Started first.

Replace the shortened divyam-sw-v1-... shown in examples with your complete API key.

The examples use divyam-as/gpt-6-sol. For another model, select its current ID in your harness or copy it from Models and pricing, and check its context limit and supported features.

1. Install Codex CLI​

Follow the official Codex CLI installation instructions.

2. Add the Divyam profile​

Add these settings to ~/.codex/divyam.config.toml:

model_provider = "divyam"
web_search = "disabled"

[model_providers.divyam]
name = "Divyam"
base_url = "https://api.preview.divyam.ai/v1"
env_key = "DIVYAM_API_KEY"
wire_api = "responses"

Codex loads this file when you pass --profile divyam. Your API key selects the Divyam project for your requests.

The profile disables provider-hosted web search, which Divyam does not serve.

3. Send your first prompt​

Choose a model for your Codex session:

divyam-as/

Model ID: divyam-as/gpt-6-sol. Context window: 1,050,000 tokens. Models and pricing

From your project folder, run:

export DIVYAM_API_KEY="divyam-sw-v1-..."
codex --profile divyam --model divyam-as/gpt-6-sol
In Codex CLI's composer
Hello, what are your capabilities?
Paste this message, then send it.

Check your requests​

Open the Divyam console and select Logs. Your requests appear there within a few seconds, newest first, with their status, token counts and latency. Usage and Credits & Billing catch up within a few minutes.

Local cost estimates

Some clients display zero when model prices are missing. Check Credits & Billing for Divyam charges. Local dollar limits depend on the client's price and usage data.

For filters, cached-token counts and the requested-versus-routed view, see Logs and usage.