> ## 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 the **gateway key** auth pattern: 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-by-plan).
</Note>

## 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`).

<Steps>
  <Step title="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).
  </Step>

  <Step title="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`).

    <Frame>
      <img src="https://mintcdn.com/truefoundry/n3EuZuJ0K8wBFp1G/images/new-code-snippet.png?fit=max&auto=format&n=n3EuZuJ0K8wBFp1G&q=85&s=3634c2dc8c3565fd77ab896d3fd07ed9" alt="TrueFoundry playground showing unified code snippet with base URL and model name" width="2940" height="1664" data-path="images/new-code-snippet.png" />
    </Frame>

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

  <Step title="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).
    </Note>
  </Step>

  <Step title="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.
  </Step>

  <Step title="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).
  </Step>
</Steps>

## Now roll it out

<CardGroup cols={2}>
  <Card title="Pick the auth pattern for your plan" icon="key" href="/docs/ai-gateway/claude-code#authentication-by-plan">
    Enterprise, or Team / Pro / Max subscription passthrough.
  </Card>

  <Card title="Set up Claude Desktop" icon="desktop" href="/docs/ai-gateway/claude-desktop">
    Same gateway, third-party inference mode.
  </Card>

  <Card title="Govern MCP servers" icon="server" href="/docs/ai-gateway/claude-mcp-governance">
    Route every connector through the MCP Gateway.
  </Card>

  <Card title="Enforce fleet-wide with MDM" icon="shield-halved" href="/docs/ai-gateway/claude-mdm">
    Lock the config so developers can't remove it.
  </Card>
</CardGroup>


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