BlockRun
Integrations / Vercel AI SDK

Use BlockRun from the Vercel AI SDK with the TypeScript client

Call every BlockRun model from a Vercel AI SDK app with the @blockrun/llm TypeScript client, or through an OpenAI-compatible provider pointed at a local sidecar.

How it works

The @blockrun/llm TypeScript client creates or adopts a wallet, signs x402 payments and exposes chat, image, video and search calls with types. Inside a Vercel AI SDK app it is the shortest path: call the client from a route handler or a tool and stream the result back through the SDK's own primitives.

For code that must stay on the SDK's provider abstraction, the OpenAI-compatible provider pointed at a local blockrun-litellm sidecar gives the same catalog without a provider key; the sidecar signs each request from the wallet on the server.

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. Install the client

npm install @blockrun/llm

2. Call a model

import { LLMClient } from "@blockrun/llm";
const client = new LLMClient();
const reply = await client.chat("openai/gpt-4o", "Hello!");

Questions

Can this run in the browser?
Keep the wallet server-side. Call the client from a route handler or server action and stream to the client.
Which chains?
Base by default; the client also supports paying on Solana.

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 Vercel AI SDK

    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.

    npm install @blockrun/llm