BlockRun
Integrations / LiteLLM

Register BlockRun as a LiteLLM provider, or run it as the proxy

blockrun-litellm adds BlockRun as a LiteLLM provider and ships an OpenAI-compatible proxy: every model, one wallet, no provider keys — the payment is signed locally per call.

How it works

LiteLLM is the common adapter layer many Python agent stacks already sit on. blockrun-litellm plugs BlockRun in at that layer: call register() once and any blockrun/<model> id works through LiteLLM's normal completion call, with the payment signed from your wallet per request.

The same package ships a proxy mode that exposes a local OpenAI-compatible endpoint. Anything that can point at an OpenAI base URL — LangChain, an agents SDK, a plain openai client — then pays per request through it without knowing x402 exists.

Behind it is the BlockRun catalog: 78 chat models plus image, video, music and speech generation, search, market data and multi-chain RPC, priced per call. 6 open-weight models are free and need no wallet.

Setup

1. In-process provider

pip install blockrun-litellm
# python
from blockrun_litellm import register; register()
# then: litellm.completion(model="blockrun/openai/gpt-5.4", ...)

2. Proxy mode

pip install 'blockrun-litellm[proxy]'
export BLOCKRUN_WALLET_KEY=0x<base wallet key>
blockrun-litellm-proxy --port 4001

Questions

Which model ids do I use?
The catalog ids, prefixed with blockrun/ in provider mode; in proxy mode use the bare catalog id.
Does streaming work?
Yes in both modes; the proxy passes SSE through unchanged.

Two ways to run this

Get an API key

Sign in, get a key, and call the same endpoints with usage billed to your account. For teams that want one invoice instead of one wallet.

Get an API key 

Or let your agent pay per call, in USDC

No account, no API key. Three steps, and the last one is the request this page is about.

  1. 01
    Point your agent at BlockRun

    Install ClawRouter, or add the BlockRun MCP server to Claude Code, Cursor, Codex or OpenClaw. Any OpenAI-compatible client works too — change the base URL, nothing else.

    curl -fsSL https://blockrun.ai/ClawRouter-update | bash
  2. 02
    Fund a wallet with USDC

    Send USDC to a wallet on Base or Solana. There is no account to create and no API key to issue: the wallet is the account, and it pays per call.

  3. 03
    Use BlockRun from LiteLLM

    The first call returns HTTP 402 with the exact price, your agent signs it, and the answer comes back. Payment settles on-chain; nothing is charged if the call fails.

    pip install blockrun-litellm
    # python
    from blockrun_litellm import register; register()
    # then: litellm.completion(model="blockrun/openai/gpt-5.4", ...)