Point Codex CLI at any free OpenAI-compatible backend.
Codex CLI reads OPENAI_BASE_URL and OPENAI_API_KEY from the environment (or ~/.codex/config.toml). Point them at a free provider and pass --model (or set it in the config).
export OPENAI_BASE_URL="https://api.groq.com/openai/v1"
export OPENAI_API_KEY="your-groq-key" # get at console.groq.com/keys
codex --model "llama-3.3-70b-versatile"export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="sk-or-v1-your-key" # get at openrouter.ai/keys
codex --model "deepseek/deepseek-v4-flash:free"export OPENAI_BASE_URL="https://integrate.api.nvidia.com/v1"
export OPENAI_API_KEY="nvapi-your-key" # get at build.nvidia.com
codex --model "deepseek-ai/deepseek-r1"[model_providers.groq]
name = "Groq"
base_url = "https://api.groq.com/openai/v1"
env_key = "OPENAI_API_KEY"
model_provider = "groq"
model = "llama-3.3-70b-versatile"- Free tiers have rate limits — Groq: 14,400 requests/day, NVIDIA NIM: 40 RPM, OpenRouter: 50 requests/day (free tier).
- Some free models are weaker at long agentic tool-use chains than GPT-5-class models — prefer larger models (70B+) for multi-step coding tasks.
See the full Provider Directory and Quick Reference in the main README for all 33 free providers, or browse free-llm.com.