The Codex
Everything you need to invoke Raziel from Claude Code.
Customer setup
The raziel CLI runs a local proxy that routes Claude Code through the cheapest live provider. One command to install, one command to launch.
npx @raziel.fun/cli setupYour browser will open to sign in. Once authorized, your key is saved to
~/.config/raziel/config.json. You can also paste a key manually if you prefer.raziel claudeThis starts a local proxy on
localhost:3099, then spawns Claude Code with the correct environment already set. No shell config changes needed. All arguments after claude are passed through:raziel claude --model claude-opus-4-7
If you prefer to set env vars directly without the CLI:
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
Use ANTHROPIC_AUTH_TOKEN not ANTHROPIC_API_KEY— the latter triggers a connectivity check against Anthropic's servers.
Provider setup
claude setup-tokenThis outputs a token starting with
sk-ant-oat01-…. Copy it.Gateway endpoint
The gateway is a drop-in replacement for the Anthropic Messages API. When using the CLI, requests go through a local proxy — the raziel.fun domain never appears in Claude Code's network traffic.
| Via CLI | |
|---|---|
| Endpoint | POST http://localhost:3099/v1/messages |
| Auth | Injected automatically by the proxy |
| Routing | localhost:3099 → raziel.fun/gateway |
| Direct | |
|---|---|
| Endpoint | POST /gateway/v1/messages |
| Auth | Authorization: Bearer rz_live_… |
| Body | Anthropic Messages API JSON (pass through) |
| Streaming | Supported — pass stream: true as usual |
OpenAI-compatible endpoint
The gateway also speaks OpenAI's chat completions format at /gateway/openai/v1. Use it with any client that accepts a custom base URL — Hermes, Continue, LibreChat, or the plain OpenAI SDK.
| Field | |
|---|---|
| Base URL | https://raziel.fun/gateway/openai/v1 |
| Models | GET /gateway/openai/v1/models |
| Chat | POST /gateway/openai/v1/chat/completions |
| Auth | Authorization: Bearer rz_live_… |
| Streaming | Supported — pass stream: true |
from openai import OpenAI
client = OpenAI(
base_url="https://raziel.fun/gateway/openai/v1",
api_key="rz_live_xxxxxxxxxxxx",
)
resp = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)Supported fields: messages, model, max_tokens, temperature, stream, tools, tool_choice, stop, top_p.
Silently ignored: logprobs, n, response_format, presence_penalty, frequency_penalty, seed. For a full Hermes setup guide see the dashboard → Hermes.
Error codes
| Status | Type | Meaning |
|---|---|---|
| 401 | auth_error | Invalid or revoked Raziel key |
| 402 | auth_error | Insufficient balance — top up at raziel.fun/customer/deposit |
| 503 | no_listing | No live providers for this model — try again shortly |
| 502 | upstream_error | All candidate providers failed — retry with backoff |
Security
- → Setup tokens are envelope-encrypted (AES-256-GCM) before being stored. Plaintext lives only in memory, briefly, during request forwarding.
- → Prompt content is never logged or stored.
- → Customer balances and usage are stored in Postgres. Deposits are processed by card via Polar.
- → Provider tokens can be rotated at any time by creating a new listing.