.claude/skills/codex-custom-model-provider/SKILL.md
Configure OpenAI Codex CLI to use custom model providers like Groq, OpenRouter, or other OpenAI-compatible APIs. Use when: (1) Getting 401 errors when trying custom providers, (2) Codex profiles not loading correctly, (3) Need to route Codex to non-OpenAI endpoints, (4) wire_api errors or "responses" endpoint not found. Covers env_key auth, wire_api selection, and the -c flag workaround for profiles.
npx skillsauth add Dbochman/dotfiles codex-custom-model-providerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Configuring OpenAI Codex CLI (v0.89+) to use third-party model providers like Groq, OpenRouter, or other OpenAI-compatible APIs fails with auth errors or wrong endpoints.
/responses endpoint instead of /chat/completions-p profile_name flag not loading custom provider settings~/.codex/config.toml)[model_providers.groq]
base_url = "https://api.groq.com/openai/v1"
name = "Groq"
wire_api = "chat" # CRITICAL: Groq doesn't support "responses" API
env_key = "GROQ_API_KEY" # Environment variable containing the API key
| Setting | Purpose | Common Values |
|---------|---------|---------------|
| base_url | API endpoint | Provider's OpenAI-compatible URL |
| wire_api | API format | "chat" for most providers, "responses" for OpenAI only |
| env_key | Auth env var | Name of env var holding API key |
| name | Display name | Human-readable provider name |
[profiles.groq-gpt]
model = "openai/gpt-oss-120b"
model_provider = "groq"
-c Flag WorkaroundImportant: In Codex v0.89, the -p profile flag may not load custom providers correctly.
Use the -c flag to explicitly set the provider:
# This may NOT work:
codex -p groq-gpt exec "prompt"
# This DOES work:
export GROQ_API_KEY="your-key"
codex -c 'model_provider="groq"' -m "openai/gpt-oss-120b" exec "prompt"
Groq:
[model_providers.groq]
base_url = "https://api.groq.com/openai/v1"
name = "Groq"
wire_api = "chat"
env_key = "GROQ_API_KEY"
OpenRouter:
[model_providers.openrouter]
base_url = "https://openrouter.ai/api/v1"
name = "OpenRouter"
wire_api = "chat"
env_key = "OPENROUTER_API_KEY"
Check provider is recognized:
RUST_LOG=debug codex -c 'model_provider="groq"' -m "model-name" exec "test" 2>&1 | grep provider
Verify correct endpoint:
/responses = need wire_api = "chat"# Set API key from 1Password
export GROQ_API_KEY=$(op read "op://Private/GroqAPI Credentials/credential")
# Run with Groq provider
codex -c 'model_provider="groq"' -m "openai/gpt-oss-120b" exec --sandbox read-only "What model are you?"
wire_api = "chat" shows deprecation warning but is required for non-OpenAI providers/responses) is OpenAI-specific; most providers only support Chat Completions[projects] trust levels) should be added manually after installdevelopment
Search the web for current information, news, facts, and answers. Use when asked questions about current events, needing to look something up, finding websites, researching topics, or when you need up-to-date information beyond your training data.
development
Summarize any URL, YouTube video, podcast, PDF, or file into concise text. Use when asked to read an article, summarize a link, get the gist of a video or podcast, extract content from a URL, or when you need to understand what a web page or document contains.
development
Play music via Spotify and control Google Home speakers. Use when asked to play music, songs, artists, playlists, podcasts, or control speakers/volume/audio.
testing
Create new OpenClaw skills, modify and improve existing skills, and measure skill performance with evals. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. Also use when asked to "make a skill", "turn this into a skill", "improve this skill", or "test this skill".