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

# Raziel Router: proxy Claude requests at OpenRouter rates

> Raziel Router is a thin OpenRouter proxy that routes every request to the cheapest healthy provider, meters usage per token, and lets you top up in USDC.

Raziel Router is a thin proxy over OpenRouter. You authenticate with one `rz_live_…` key; the gateway handles provisioning an OpenRouter sub-key behind the scenes, routes each request to the cheapest healthy listing, streams the response back, and deducts from your USDC balance after each request.

## How deposits work

All balance is held in USDC. When you deposit, Raziel takes a 15% protocol margin at deposit time and credits the remainder to your account at OpenRouter rates. There are no per-request fees beyond that margin.

## Gateway endpoints

The gateway exposes two API surfaces:

| Endpoint                                      | Protocol                           |
| --------------------------------------------- | ---------------------------------- |
| `POST https://raziel.fun/gateway/v1/messages` | Anthropic Messages API (drop-in)   |
| `https://raziel.fun/gateway/openai/v1`        | OpenAI-compatible chat completions |

Both endpoints require `Authorization: Bearer rz_live_…` and support streaming.

## How routing works

Every request hits the gateway, which selects the cheapest healthy provider listing for the requested model, forwards the request, and streams the response back. If a provider fails mid-stream, the gateway returns a `502 upstream_error`. Usage is metered per token — your balance updates after each completed request.

## Error codes

| Status | Type             | Meaning                                              |
| ------ | ---------------- | ---------------------------------------------------- |
| `401`  | `auth_error`     | Invalid or revoked Raziel key                        |
| `402`  | `auth_error`     | Insufficient balance — deposit more USDC             |
| `503`  | `no_listing`     | No live providers for this model — try again shortly |
| `502`  | `upstream_error` | All candidate providers failed — retry with backoff  |

## Where to go next

<CardGroup cols={2}>
  <Card title="API Keys" icon="key" href="/router/api-keys">
    Issue and manage your `rz_live_…` keys.
  </Card>

  <Card title="Deposit" icon="coins" href="/router/deposit">
    Top up your USDC balance on Solana.
  </Card>

  <Card title="Claude Code" icon="terminal" href="/router/claude-code">
    Run Claude Code through the Raziel gateway CLI.
  </Card>

  <Card title="OpenAI-compatible endpoint" icon="plug" href="/router/openai-compat">
    Use Raziel with any OpenAI-compatible client.
  </Card>
</CardGroup>
