# Set up AgentKeyRoute with your AI coding agent · One prompt

Set up with your AI agent

# One prompt. Your coding agent does the setup.

Claude Code, Codex, Cursor and other coding agents can read AgentKeyRoute's machine-readable docs and connect your project themselves. Paste one prompt, add your key, and every LLM call goes through one governed gateway.

[Get a free key](https://app.agentkeyroute.com/signup)[80+ setup guides](https://docs.agentkeyroute.com/connect)

Step 1 · Paste this into your coding agent

## The setup prompt.

Create a free key first, then put it in the `AGENTKEYROUTE_API_KEY` environment variable. The agent never needs to see it.

```
Set up AgentKeyRoute for this project.
Read https://agentkeyroute.com/llms.txt and follow its "Instructions for AI coding agents":
route this project's LLM calls (and your own, if you are Claude Code, Codex or Cursor)
through https://gateway.agentkeyroute.com, read the key from the AGENTKEYROUTE_API_KEY environment variable,
never hard-code it, then make one test call to GET /v1/models and show me the result.
```

Prefer to do it yourself

## Change the base URL and the key. Nothing else.

The gateway is OpenAI- and Anthropic-compatible, so existing code and tools keep working.

### Claude Code · Shell, or the env block in ~/.claude/settings.json

```
export ANTHROPIC_BASE_URL="https://gateway.agentkeyroute.com"
export ANTHROPIC_AUTH_TOKEN="$AGENTKEYROUTE_API_KEY"
claude
```

### Codex CLI · ~/.codex/config.toml

```
model_provider = "agentkeyroute"

[model_providers.agentkeyroute]
name = "AgentKeyRoute gateway"
base_url = "https://gateway.agentkeyroute.com/v1"
env_key = "AGENTKEYROUTE_API_KEY"
wire_api = "responses"
```

### Cursor · Cursor Settings → Models

```
OpenAI API Key:               <your AgentKeyRoute key>
Override OpenAI Base URL:     https://gateway.agentkeyroute.com/v1
Add custom model:             <a model your key may use>
```

### OpenAI SDK (Python) · Any OpenAI-compatible client

```
import os
from openai import OpenAI

client = OpenAI(base_url="https://gateway.agentkeyroute.com/v1",
                api_key=os.environ["AGENTKEYROUTE_API_KEY"])
```

### Anthropic SDK (Python) · Messages API

```
import os, anthropic

client = anthropic.Anthropic(base_url="https://gateway.agentkeyroute.com",
                             api_key=os.environ["AGENTKEYROUTE_API_KEY"])
```

Using something else? [Setup guides for 80+ tools](https://docs.agentkeyroute.com/connect), from Aider and Cline to LangChain, n8n and voice agents.

For AI agents and LLM tools

## Machine-readable, on purpose.

### [llms.txt](https://agentkeyroute.com/llms.txt)

What AgentKeyRoute is, the gateway URL, authentication and copy-paste setup for every common tool.

### [llms-full.txt](https://docs.agentkeyroute.com/llms-full.txt)

Every documentation page in one plain-text file, from quickstart to API errors.

### Markdown everywhere

Add `.md` to any page, or send `Accept: text/markdown`, and you get clean Markdown instead of HTML.

See also [AgentKeyRoute for startups](https://agentkeyroute.com/startups) and [how it compares](https://agentkeyroute.com/compare).

## Give your coding agent one governed key.

Free for small teams. One base URL change.

[Get started](https://app.agentkeyroute.com/signup)[See pricing](https://agentkeyroute.com/pricing)

---
Source: https://agentkeyroute.com/ai-setup · Markdown: https://agentkeyroute.com/ai-setup.md
