Quickstart

Connect your AI — it mints its own card

One commandnpx openspender connect — wires every tool on this machine at once
claude.aiSettings → Connectors → Add custom connector → paste the URL
Claude Codeclaude mcp add --transport http --scope user openspender https://openspender.com/api/mcp
ChatGPTSettings → Apps → Advanced → Developer mode on, then + add the URL (Plus/Pro, web)
Codex~/.codex/config.toml, then `codex mcp login openspender`
opencodeopencode.json → under "mcp"
Any MCP clienthttps://openspender.com/api/mcp

Connecting opens a consent screen that mints a card for that AI with caps you choose. The AI never holds a token — edits and deletes on your wallet apply to it instantly.

Or paste in Claude Code to use your wallet

message
Save this to CLAUDE.md so it survives new sessions. Never commit it.

I have an openspender wallet. Use it to buy from paid APIs — search, models, image, video. Each call is paid from my wallet under a cap I set, so you need no API key.

  POST https://openspender.com/v1/{provider}/{endpoint}
  Authorization: Bearer openspender_YOUR_TOKEN_HERE
  Content-Type: application/json

The path after the provider, and the body, are that provider's own.

  tavily     /tavily/search              {"query","max_results","include_answer"}
  exa        /exa/search                 {"query","numResults"}
  anthropic  /anthropic/messages         {"model","max_tokens","messages"}
  openai     /openai/chat/completions    {"model","messages"}

Rules:
- One call per question. Read the result before calling again.
- Ask me before anything over ~$1.
- Tell me what you spent.
- 401, 402, 404, 502 cost nothing. Never retry blind.
- On 402 or an empty wallet, say exactly: "Your openspender wallet is inactive — top up at openspender.com/wallet"

Token from your wallet.

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 and Cursor 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

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

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": {...}}