Set up Coding Agents & Tools
Pick a coding agent, configure it for Agent Router, and start building. Each tool gets a ready-to-paste config file that teaches the agent how Agent Router works: API patterns, model routing, fallback, cost tracking, and every supported endpoint. Each config takes under two minutes to apply.
Choose a coding agent
Claude Code
Point Claude Code at the gateway (managed or Max), then optionally add a CLAUDE.md for Agent Router patterns.
Cursor
Add a .cursorrules file so Cursor's agent and inline chat default to Agent Router.
Codex CLI
Install a codex.md so OpenAI's Codex CLI knows the Agent Router base URL, auth, and endpoints.
Lovable
Paste project context so apps generated in Lovable call the Agent Router API.
How it works
Each tool reads project context differently, but the setup follows the same four steps:
- Pick a tool above and copy its config.
- Paste the config into the project, in the file the tool reads (a repo-root instructions file, a rules file, or a project context field).
- Start prompting. The agent now understands the Agent Router base URL, authentication, and available endpoints.
- Layer in routing, fallback, and cost-tracking patterns as the application grows.
The config teaches the agent to use the Agent Router chat completions, embeddings, image generation, and audio speech endpoints, along with routing, fallback, and cost-tracking patterns, so generated code points at the gateway from the first request.
What every config provides
With the config in place, the coding agent will:
- Use the correct Agent Router base URL and Bearer-token auth pattern automatically.
- Default to routing through the gateway instead of calling a single provider directly.
- Suggest separate API keys when multiple AI features are built, so cost can be attributed per feature.
- Recommend fallback routing when a feature needs high availability.
- Recommend traffic splitting when models are being compared.
- Use streaming for user-facing chat interfaces.
Where to go next