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

# Route Claude Code through Raziel: get started in 4 steps

> Install the Raziel CLI, deposit credits, and route your first Claude Code session through the spot-price gateway in under 5 minutes.

Raziel Router cuts your Claude Code costs by routing requests through a marketplace of spot-priced providers. This guide walks you from a fresh machine to a running Claude Code session — you only need Node.js and Claude Code installed.

<Steps>
  <Step title="Install the CLI and authenticate">
    Run the setup command once. Your browser opens to sign in; after you authorize, your API key is saved locally — no manual copy-paste required.

    ```bash theme={null}
    npx @raziel.fun/cli setup
    ```

    The key is written to `~/.config/raziel/config.json`. If you already have a key, you can paste it manually when prompted instead.
  </Step>

  <Step title="Issue an API key">
    The `setup` command creates a key automatically when you sign in. If you prefer to manage keys yourself, go to **Customer → API Keys** in the dashboard and click **Issue key**.

    <Warning>
      Copy the full key immediately after issuing it. It is shown only once. If you lose it, revoke the key and issue a new one.
    </Warning>

    Keys start with `rz_live_`. You can issue multiple keys (for example, one per machine or project) and revoke them individually at any time.
  </Step>

  <Step title="Deposit credits">
    Go to **Customer → Deposit** in the dashboard. Your current balance and a top-up link are shown on that page. Credits appear within seconds of a completed checkout.

    <Tip>
      Check your remaining balance at any time on the dashboard. Usage is metered per token and balances update after each request, so you can top up at any time without interrupting a session.
    </Tip>

    Requests are forwarded only when your balance is **\$0.05 or above**. If a request is rejected with a `402` error, your balance has dropped below the minimum — top up and retry.
  </Step>

  <Step title="Launch Claude Code">
    Start Claude Code through the Raziel proxy with one command:

    ```bash theme={null}
    razi claude
    ```

    This starts a local proxy on `localhost:3099`, then spawns Claude Code with `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` already set. No shell configuration changes are needed — the environment is injected only for the child process.

    All arguments after `claude` pass through directly to Claude Code:

    ```bash theme={null}
    razi claude --model claude-opus-4-7
    ```

    You should see a short banner confirming the proxy port and key prefix before Claude Code's interface appears.
  </Step>
</Steps>

<Note>
  **Manual setup (advanced):** If you prefer to set environment variables directly without the CLI, export the following before running `claude`:

  ```bash theme={null}
  export ANTHROPIC_BASE_URL=https://raziel.fun/gateway
  export ANTHROPIC_AUTH_TOKEN=rz_live_xxxxxxxxxxxx
  unset ANTHROPIC_API_KEY
  claude logout  # only needed if you're signed in via claude.ai OAuth
  ```

  Use `ANTHROPIC_AUTH_TOKEN`, not `ANTHROPIC_API_KEY`. The `ANTHROPIC_API_KEY` variable triggers a connectivity check against Anthropic's servers, which will fail because you are pointing at the Raziel gateway instead.
</Note>

<CardGroup cols={2}>
  <Card title="Router overview" icon="route" href="/router/overview">
    Learn how the gateway routes requests, what models are available, and how spot pricing works.
  </Card>

  <Card title="Teams overview" icon="server" href="/teams/overview">
    Spin up a persistent agent VM with Hermes, Claude Code, and integrations preinstalled for \$40/mo.
  </Card>
</CardGroup>
