Skip to content

The router

One base URL in front of every machine-payable endpoint. Point a client at it, name a provider in the path, and the request goes where it should — paid per call from your allowance.

Base URL

One host in front of every provider. Everything below is this base plus two more path segments.

base url
https://openspender.com/v1

The route

A provider slug, then whatever path that provider expects. Nothing is rewritten, and the body is passed through untouched.

POST  {base}/{provider}/{endpoint}

So a Messages call to Anthropic and a search call to Exa differ only in the two segments after the base:

POST  https://openspender.com/v1/anthropic/messages
POST  https://openspender.com/v1/exa/search

Quickstart

The fastest start is one command — it wires Claude Code, Codex, opencode, Gemini CLI, Cursor, Hermes, OpenClaw and Grok Build to the MCP server in one pass, and each connection mints its own capped card at a browser consent:

one command
npx openspender connect

No terminal, or a chat-only model? One sentence does it the long way:

paste into your agent
Read https://openspender.com/llms.txt and set up payments.

Or point an existing client at the base URL yourself. Anything that speaks the OpenAI or Anthropic wire format works unmodified.

claude code
export ANTHROPIC_BASE_URL=https://openspender.com/v1/anthropic
export ANTHROPIC_AUTH_TOKEN=$OPENSPENDER_ALLOWANCE_TOKEN
curl
curl https://openspender.com/v1/anthropic/messages \
-H "Authorization: Bearer $OPENSPENDER_ALLOWANCE_TOKEN" \
-H "content-type: application/json" \
-d '{
  "model": "claude-opus-5",
  "max_tokens": 1024,
  "messages": [{"role": "user", "content": "hello"}]
}'
openai sdk
from openai import OpenAI

client = OpenAI(
  base_url="https://openspender.com/v1/openai",
  api_key=os.environ["OPENSPENDER_ALLOWANCE_TOKEN"],
)

client.chat.completions.create(
  model="gpt-5.1",
  messages=[{"role": "user", "content": "hello"}],
)

How a route resolves

Three ways to name a destination, tried in order. The first one that matches wins, so an explicit path always beats inference.

  1. 1
    Explicit path. /v1/anthropic/messages goes to Anthropic. No ambiguity, no lookup.
  2. 2
    Prefixed model landing next. Post to /v1/chat/completions with "model": "anthropic/claude-opus-5" and the prefix picks the provider — the OpenRouter convention.
  3. 3
    Catalog lookup landing next. A bare model or service name is resolved against the indexed catalog. Ambiguous names are rejected rather than guessed.

Providers

openspender never resells inference. Each slug forwards to the provider's own machine-payable endpoint.

SlugExampleForwards toProtocol
anthropic/v1/anthropic/messageshttps://anthropic.mpp.tempo.xyz/v1MPP
openai/v1/openai/chat/completionshttps://openai.mpp.tempo.xyz/v1MPP
exa/v1/exa/searchhttps://api.exa.aiMPP
tavily/v1/tavily/searchhttps://x402.tavily.comx402
fal/v1/fal/fal-ai/flux/schnellhttps://fal.mpp.tempo.xyzMPP
blockrun/v1/blockrun/v1/chat/completionshttps://blockrun.ai/apix402

Plus every x402 service in the Bazaar catalog and every service in the MPP registry, addressable by the same grammar.

Routes

The full paid surface behind the tier-1 slugs. Every route marked live answered an unauthenticated probe with a real payment challenge on 2026-08-21 — the price shown is what the provider's own challenge quoted, not a list price.

RouteWhat it doesRailPriceStatus
POST /v1/anthropic/messagesClaude messages (Sonnet, Opus, Haiku)MPP · Tempomodel-priced, from $0.001live
POST /v1/openai/chat/completionsGPT chat completionsMPP · Tempomodel-priced, from ~$0.005live
POST /v1/openai/responsesOpenAI Responses APIMPP · Tempomodel-pricedlive
POST /v1/openai/embeddingstext embeddingsMPP · Tempoper requestlive
POST /v1/openai/images/generationsimage generationMPP · Tempoper imagelive
POST /v1/exa/searchneural web searchMPP · Tempo$0.007 / searchlive
POST /v1/exa/contentspage contents for result idsMPP · Tempoper requestlive
POST /v1/tavily/searchweb search (advanced tier)x402 · Base$0.01 / searchlive
POST /v1/fal/fal-ai/flux/schnellFLUX.1 schnell text-to-imageMPP · Tempo$0.003 / imagelive
POST /v1/fal/fal-ai/{model}the gateway's listed image routes (Flux dev/pro, SD 3.5, fast-sdxl, Recraft v3 — unlisted slugs 404 and spend nothing)MPP · Tempomodel-priced, from $0.003live
POST /v1/fal/xai/grok-imagine-imageGrok Imagine text-to-imageMPP · Tempo$0.04 / imagelive
POST /v1/blockrun/v1/chat/completions93 models — Gemini, Grok, DeepSeek, Kimi, GLM, Qwen and more; 29 freex402 · Baseper-token at lab rates, $0.002 min; free tier $0live
GET /v1/blockrun/v1/modelsthe full BlockRun model registry with pricesx402 · Base$0 — freelive
POST /v1/blockrun/v1/audio/speechElevenLabs text-to-speech → hosted MP3x402 · Base$0.05–0.10 / 1k chars, min $0.002live
POST /v1/blockrun/v1/videos/generationsseedance-2.5 (30s), sora-2, grok video — async, settled on delivery; poll leg is wallet-bound (see inspect: advanced)x402 · Base$0.08–0.33 / sec by modellive
POST /v1/pinata/v1/pin/public?fileSize=NIPFS pin: local file → public URL (presigned upload, see inspect)x402 · Basefrom $0.001 / pinlive

Exa's /findsimilar and /answer exist upstream but answer 401 (API-key only), not a payment challenge — not machine-payable today.

MPP is bigger than single charges. The spec at mpp.dev defines extensions — sessions (metered pay-as-you-go), streaming payments over SSE, subscriptions, a native MCP binding (pay inside tool calls), WebSocket transport and relays. openspender settles single charge intents today and adopts extensions as providers ship them. The discovery surface is already wide: the mpp.dev directory lists 141 MPP services (machine-readable at mpp.dev/api/services), and the Bazaar catalog indexes the x402 long tail — both are the router's expansion path.

Payment

Providers answer an unpaid request with a challenge — 402 Payment Required for x402, a WWW-Authenticate: Payment header for MPP. openspender reads the challenge, checks it against your allowance, pays, and replays the request. Your client sees one response.

what your client never has to handle
→ POST /v1/anthropic/messages          (unpaid probe)
← 402  WWW-Authenticate: Payment …     (provider quotes)
 ·   policy check against your allowance
→ POST /v1/anthropic/messages          (payment attached)
← 200  {"content": [...], "usage": {...}}