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

# Claude quick start

> Route Claude Code on one machine through the TrueFoundry AI Gateway and see the first request in Analytics, about five minutes.

This walkthrough gets a single developer's Claude Code talking to the AI Gateway with a TrueFoundry API key. It is the fastest way to see requests, cost, and logs flowing before you decide on plan-specific auth, Desktop, or a fleet rollout.

> [!NOTE]
>
> This uses **API-key mode**: your TrueFoundry key in `ANTHROPIC_AUTH_TOKEN`, and an Anthropic API key on the model account. If your users are on a Team, Pro, or Max subscription and you want usage billed to their seats instead, finish this page first, then switch to [subscription passthrough](/docs/ai-gateway/claude-code#authentication-and-who-pays).

## Prerequisites

* A TrueFoundry account with the AI Gateway enabled, [sign up](https://www.truefoundry.com/register) and follow the [Gateway quick start](/docs/ai-gateway/quick-start) if you haven't.
* [Claude Code](https://code.claude.com/docs/en/overview) installed (`npm install -g @anthropic-ai/claude-code`).

**1. Add a Claude model account**

In TrueFoundry, go to **AI Gateway → Models** and add an **Anthropic** account with your Anthropic API key (Bedrock and Vertex work too). Add at least Opus, Sonnet, and Haiku so Claude Code's model aliases all resolve. Full steps in [Anthropic model integration](/docs/ai-gateway/anthropic).

**2. Copy your gateway base URL and a model name**

Open the **Playground**, pick one of the Claude models you just added, and open the **code snippet**. Copy the **base URL** and the **model name** (it looks like `your-account/claude-sonnet-4-6`).

![TrueFoundry playground showing unified code snippet with base URL and model name](https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/new-code-snippet.png?fit=max\&auto=format\&n=n3EuZuJ0K8wBFp1G\&q=85\&s=3634c2dc8c3565fd77ab896d3fd07ed9)

Create a TrueFoundry API key from **Settings → API Keys** if you don't have one. See [Generating API keys](/docs/generating-truefoundry-api-keys).

**3. Point Claude Code at the gateway**

Add the following to `~/.claude/settings.json` (or `.claude/settings.json` inside one project), replacing the placeholders:

```json theme={"dark"}
{
  "env": {
    "ANTHROPIC_BASE_URL": "{GATEWAY_BASE_URL}",
    "ANTHROPIC_AUTH_TOKEN": "your-truefoundry-api-key",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "your-account/claude-opus-4-6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "your-account/claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "your-account/claude-haiku-4-5",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}
```

> [!NOTE]
>
> Keep a recognizable Anthropic model id (`claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4-5`, …) in each model value. Claude Code string-matches the id to decide which features to enable, and an unrecognized name can trigger `400: This model does not support the effort parameter`. Details under [Model configuration](/docs/ai-gateway/claude-code#model-configuration).

**4. Send a request**

Start Claude Code and ask it anything:

```bash theme={"dark"}
claude "Summarize what this repository does"
```

Run `/model` inside the session to confirm the picker shows your gateway models.

**5. See it on the gateway**

In TrueFoundry, open **AI Gateway → Analytics**. The request appears under your API key with its model, token counts, and cost. Open **Request Logs** to see the prompt and response. See [Analytics overview](/docs/ai-gateway/analytics-overview) and [Request logging](/docs/ai-gateway/request-logging).

## Now roll it out

> **[Decide who pays: API key or seats](/docs/ai-gateway/claude-code#authentication-and-who-pays)**
>
> Enterprise, or Team / Pro / Max subscription passthrough.

> **[Set up Claude Desktop](/docs/ai-gateway/claude-desktop)**
>
> Same gateway, third-party inference mode.

> **[Govern MCP servers](/docs/ai-gateway/claude-mcp-governance)**
>
> Route every connector through the MCP Gateway.

> **[Enforce fleet-wide with MDM](/docs/ai-gateway/claude-mdm)**
>
> Lock the config so developers can't remove it.


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