Open-source tool
Codex is locked to the Responses API. Almost nobody uses that. This script points Codex at any model — local, hosted, or proxy — through the OpenAI-compatible endpoint every provider already speaks.
Use it your way — terminal native or full desktop app
Works with
Three steps. No npm, no Docker, no config files you'll forget about.
01
Download the script. Run it. It asks which provider you want, grabs your
API_KEY, and writes the config for Codex to pick up.
02
Pick from presets — gpt-4.1, llama3,
deepseek-chat — or type any model name your provider supports.
03
The script sets OPENAI_BASE_URL and OPENAI_API_KEY,
then drops you into the Codex REPL. Everything just works.
Anything that speaks /v1/chat/completions works.
| Provider | Base URL | Works |
|---|---|---|
| OpenAI | api.openai.com/v1 | ✓ |
| Ollama | localhost:11434/v1 | ✓ |
| OpenRouter | openrouter.ai/api/v1 | ✓ |
| Together AI | api.together.xyz/v1 | ✓ |
| NVIDIA NIM | integrate.api.nvidia.com/v1 | ✓ |
| Groq | api.groq.com/openai/v1 | ✓ |
| z.ai | api.z.ai/v1 | ✓ |
| Any proxy | your-server/v1 | ✓ |
The details that matter.
Plain bash. No Node, no Python, no package manager. Runs on any machine with curl.
Common models per provider baked in. Override with any string your provider accepts.
Writes ~/.codex/config.json once. Re-run to switch providers. No orphaned state.
Ollama works out of the box. No API key, no cloud, no telemetry. Your code stays local.
Point at any OpenAI-compatible proxy — LiteLLM, Helicone, your own server.
Delete the config file. Codex reverts to defaults. No uninstaller, no cleanup.
Just a script.
View on GitHub ›