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.

01
Install and authenticate
npx @raziel.fun/cli setup
Your 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.
02
Add credit
Sign in → Customer → Deposit. Pay by card via Polar — credit is applied to your balance immediately. Minimum balance of $0.05 required before requests are forwarded.
03
Launch Claude Code
raziel claude
This 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
04
That's it
Usage is metered per token. Balances update after each request. Top up any time from the dashboard.
Manual setup (advanced)

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

01
Get a Claude Code setup token
In your terminal, run:
claude setup-token
This outputs a token starting with sk-ant-oat01-…. Copy it.
02
Create a listing
Sign in → My listings → New listing. Paste the setup token, set your price per Mtok, and set daily/monthly caps.
03
Payouts
Claim your earnings any time from the payouts page — no minimum, no waiting. Protocol margin is 15% taken at deposit time on the customer side.

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
EndpointPOST http://localhost:3099/v1/messages
AuthInjected automatically by the proxy
Routinglocalhost:3099 → raziel.fun/gateway
Direct
EndpointPOST /gateway/v1/messages
AuthAuthorization: Bearer rz_live_…
BodyAnthropic Messages API JSON (pass through)
StreamingSupported — 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 URLhttps://raziel.fun/gateway/openai/v1
ModelsGET /gateway/openai/v1/models
ChatPOST /gateway/openai/v1/chat/completions
AuthAuthorization: Bearer rz_live_…
StreamingSupported — 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

StatusTypeMeaning
401auth_errorInvalid or revoked Raziel key
402auth_errorInsufficient balance — top up at raziel.fun/customer/deposit
503no_listingNo live providers for this model — try again shortly
502upstream_errorAll 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.