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 omgvibeThis configures your environment automatically. For manual setup, continue reading.
Manual Configuration
Step 1: Install Codex CLI
npm install -g @openai/codexStep 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
| Setting | Value | Description |
|---|---|---|
model_provider | omg | Use OhMyGPT as the provider |
model | Model identifier | Model to use |
model_reasoning_effort | low, medium, high | Reasoning depth |
base_url | https://api.ohmygpt.com/code-assist/v1 | API endpoint |
wire_api | responses | API format |
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
| "Invalid API key" | Key not set or incorrect | Verify auth.json contains your OhMyGPT key |
| "Connection refused" | Wrong base URL | Ensure base_url is set to https://api.ohmygpt.com/code-assist/v1 |
| "Model not found" | Using unsupported model | Verify model name is correct |
| Config not loading | Wrong file format | Ensure 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/completionsRequest and response formats are compatible with the OpenAI API.
How is this guide?
Last updated on
