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

# Claude Code via Raziel: CLI Setup and Launch Guide

> Run Claude Code through the Raziel gateway using the razi CLI. One setup command, one launch command — no shell config changes required.

The `razi` CLI is the fastest way to run Claude Code through the Raziel gateway. It starts a local proxy on `localhost:3099`, injects your credentials, and spawns Claude Code with the correct environment already set. No shell configuration changes needed.

## Prerequisites

* Claude Code installed (`claude` on your `PATH`)
* A Raziel account with at least \$0.05 USDC balance

## Install and set up

Run the setup command once per machine:

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

Your browser opens to the Raziel sign-in page. After you authorize, your `rz_live_…` key is saved to `~/.config/raziel/config.json`. Subsequent `razi` commands read from there — you do not need to set any environment variables.

## Launch Claude Code

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

This starts the local proxy on port 3099, then spawns Claude Code. `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` are injected automatically; `ANTHROPIC_API_KEY` is removed so it does not trigger a connectivity check against Anthropic's servers.

## Pass arguments to Claude Code

All arguments after `claude` are forwarded directly to the Claude Code process:

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

## Available models

| Model ID                    | Description  |
| --------------------------- | ------------ |
| `claude-opus-4-7`           | Most capable |
| `claude-sonnet-4-6`         | Balanced     |
| `claude-haiku-4-5-20251001` | Fastest      |

## How the proxy works

The local proxy listens on `localhost:3099` and rewrites requests:

```
localhost:3099/v1/... → raziel.fun/gateway/v1/...
```

The `raziel.fun` domain never appears in Claude Code's network traffic. Your `rz_live_…` key is injected by the proxy on each forwarded request.

## Manual setup (advanced)

If you prefer not to use the CLI, set these environment variables before launching Claude Code:

<CodeGroup>
  ```bash CLI method theme={null}
  razi claude
  ```

  ```bash Manual method theme={null}
  export ANTHROPIC_BASE_URL=https://raziel.fun/gateway
  export ANTHROPIC_AUTH_TOKEN=rz_live_xxxxxxxxxxxx
  unset ANTHROPIC_API_KEY
  claude logout  # if signed in via claude.ai OAuth
  claude
  ```
</CodeGroup>

<Note>
  Use `ANTHROPIC_AUTH_TOKEN`, not `ANTHROPIC_API_KEY`. Setting `ANTHROPIC_API_KEY` causes Claude Code to run a connectivity check against Anthropic's servers, which will fail because you are routing through Raziel.
</Note>
