Configure Codex with a Free LLM API — No Credit Card
1. Pick your tool
2. Pick your free backend
Owl Alpha OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Owl Alpha" NVIDIA: Nemotron 3 Nano Omni (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "NVIDIA: Nemotron 3 Nano Omni (free)" Poolside: Laguna XS.2 (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Poolside: Laguna XS.2 (free)" Poolside: Laguna M.1 (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Poolside: Laguna M.1 (free)" inclusionAI: Ling-2.6-1T (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "inclusionAI: Ling-2.6-1T (free)" Tencent: Hy3 preview (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Tencent: Hy3 preview (free)" Baidu: Qianfan-OCR-Fast (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Baidu: Qianfan-OCR-Fast (free)" Google: Gemma 4 26B A4B (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Google: Gemma 4 26B A4B (free)" Google: Gemma 4 31B (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Google: Gemma 4 31B (free)" Google: Lyria 3 Pro Preview OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Google: Lyria 3 Pro Preview" Google: Lyria 3 Clip Preview OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "Google: Lyria 3 Clip Preview" NVIDIA: Nemotron 3 Super (free) OpenRouter
# Add to ~/.zshrc or ~/.bashrc
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="<your-api-key>" # Get at https://openrouter.ai
# Then run:
codex --model "NVIDIA: Nemotron 3 Super (free)"