> ## Documentation Index
> Fetch the complete documentation index at: https://docs.altrum.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding agents

> Run Claude Code, Codex CLI, Gemini CLI and Cursor through the AI Gateway with your personal key.

Make a [personal key](/ai-gateway/virtual-keys.md#personal-keys) under **AI Gateway**, **My keys**, which also shows the settings below under **Use it in your coding agent**, with your organization's address filled in. Use it for your own coding agent, so its traffic, cost and tool use are yours. Your organization's guardrails, budgets and model access apply to every request it sends. A coding agent puts its own instructions into each request, so it is refused when **Prompt Injections** is set to **Block** in your organization's guardrails: keep that guardrail on **Log only** there.

## Claude Code

Add to the `env` block of `~/.claude/settings.json`:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.altrum.ai/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your-personal-key"
  }
}
```

To use your organization's MCP servers in Claude Code, add Altrum's MCP endpoint. The endpoint answers only a request that carries a key, and shows only the tools that key may use. For Codex CLI, Cursor and VS Code, see [MCP tools](/ai-gateway/mcp.md).

```bash theme={null}
claude mcp add --transport http altrum https://api.altrum.ai/mcp --header "Authorization: Bearer your-personal-key"
```

## Codex CLI

Set your key, then add a provider to `~/.codex/config.toml`:

```bash theme={null}
export ALTRUM_VIRTUAL_KEY="your-personal-key"
```

```toml theme={null}
model_provider = "altrum"

[model_providers.altrum]
name = "Altrum"
base_url = "https://api.altrum.ai/openai/v1"
env_key = "ALTRUM_VIRTUAL_KEY"
wire_api = "responses"
```

Choose any model your key allows with `--model`, for example `--model anthropic/claude-sonnet-4-5`. Codex warns that it has no details for a model it does not know; the request still works.

## Gemini CLI

```bash theme={null}
export GOOGLE_GEMINI_BASE_URL="https://api.altrum.ai/genai"
export GEMINI_API_KEY="your-personal-key"
```

When Gemini CLI asks how to sign in, choose the Gemini API key.

## Cursor

In Cursor's model settings, enter your personal key as the OpenAI API key, turn on **Override OpenAI Base URL**, and enter `https://api.altrum.ai/cursor`. Add the models you want as `provider/model`. To use your organization's MCP servers, add Altrum's MCP endpoint, `https://api.altrum.ai/mcp`, as an HTTP MCP server with your personal key in the `Authorization` header.

## When the MCP endpoint refuses

A client that sends no key gets:

```
virtual key required to access the MCP server; set one of x-alt-vk, Authorization: Bearer <key>, x-api-key, or x-goog-api-key in your MCP client config
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.