OhMyGPT
Code CLI

Codex CLI

Configure OpenAI Codex CLI to use OhMyGPT as the API provider.

Codex CLI is OpenAI's official agentic coding tool. This guide shows how to connect it to OhMyGPT.

Quick Setup

Run the interactive installer:

npx omgvibe

This configures your environment automatically. For manual setup, continue reading.

Manual Configuration

Step 1: Install Codex CLI

npm install -g @openai/codex

Step 2: Configure Provider

Edit ~/.codex/config.toml:

model_provider = "omg"
model = "gpt-5"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.omg]
name = "omg"
base_url = "https://api.ohmygpt.com/code-assist/v1"
wire_api = "responses"

Step 3: Configure API Key

Edit ~/.codex/auth.json:

{
  "omg": "<your-ohmygpt-api-key>"
}

Configuration Reference

SettingValueDescription
model_provideromgUse OhMyGPT as the provider
modelModel identifierModel to use
model_reasoning_effortlow, medium, highReasoning depth
base_urlhttps://api.ohmygpt.com/code-assist/v1API endpoint
wire_apiresponsesAPI format

Troubleshooting

SymptomCauseSolution
"Invalid API key"Key not set or incorrectVerify auth.json contains your OhMyGPT key
"Connection refused"Wrong base URLEnsure base_url is set to https://api.ohmygpt.com/code-assist/v1
"Model not found"Using unsupported modelVerify model name is correct
Config not loadingWrong file formatEnsure config is TOML format, not JSON

API Endpoint

The Code CLI service uses the OpenAI Chat Completions API format:

POST https://api.ohmygpt.com/code-assist/v1/chat/completions

Request and response formats are compatible with the OpenAI API.

How is this guide?

Last updated on

On this page