Codex: Run an AI Coding Agent on Your Android Phone
July 10, 2026 · 8 min read
Some links below are affiliate links. I may earn a commission at no extra cost to you.
What Is Codex?
Codex is OpenAI's open-source AI coding agent. It runs in your terminal, understands your codebase, and can write, edit, and debug code autonomously. Think of it as an AI pair programmer that lives in your terminal.
Why Codex + 9Router?
Codex works with any OpenAI-compatible API. By pointing it at 9Router (http://localhost:20128/v1), you get access to 18+ providers without paying for OpenAI API credits. Use free models like Groq's Llama 3.3 70B or Cloudflare's Qwen for coding tasks.
Installation
Requirements: Node.js 18+ and 9Router installed.
npm install -g @openai/codex
Configure it to use 9Router:
export OPENAI_API_KEY="sk-d25ec2e336a68df0-r5e3uw-03b936b4" export OPENAI_BASE_URL="http://localhost:20128/v1" codex --model groq/llama-3.3-70b-versatile
Daily Usage
Navigate to any project and run Codex:
cd my-project codex "add error handling to the API routes"
Codex will read your files, understand the context, and make changes. It handles:
- Code generation — Write functions, classes, tests
- Debugging — Find and fix bugs with explanations
- Refactoring — Restructure code safely
- Documentation — Generate docstrings and comments
- Code review — Analyze code for issues
Best Models for Coding
| Provider | Model | Quality | Cost |
|---|---|---|---|
| Groq | Llama 3.3 70B | ★★★★ | Free |
| Cloudflare AI | Qwen 2.5 Coder 32B | ★★★★★ | Free (10k/day) |
| Gemini | Gemini 2.5 Pro | ★★★★★ | Free tier |
| OpenRouter | Various | ★★★-★★★★★ | Free options |
Tips
- Use
codex --model cf/@cf/qwen/qwen2.5-coder-32b-instructfor code-specific tasks - Keep your files under 500 lines for best results
- Use
codex --interactivefor back-and-forth conversations about your code
This article contains affiliate links. I may earn a commission at no extra cost to you.