{"uid":"cap_Pr4jrCdudpwJhpc0G58QQ","slug":"blockrun-messages-api-pay-per-call-claude-compatible-ai-gateway-c62b671a","name":"BlockRun Messages API — Pay-per-call Claude-compatible AI Gateway","description":"Pay for the outcome. One endpoint for every model, tool and data source an agent needs — each call priced before it runs, at the best value per dollar. 103 models and 100 data and tool APIs.","url":"https://blockrun.ai/api/v1/messages","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Anthropic-style model id"},"tools":{"type":"array","description":"Optional tool definitions"},"stream":{"type":"boolean","description":"Stream response as SSE"},"system":{"type":"string","description":"Optional system prompt"},"messages":{"type":"array","description":"Conversation history"},"max_tokens":{"type":"integer","description":"Max output tokens"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.011","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.011/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.011","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.011","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-e6IkOYIp_-ldM-hDNEm3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.011","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Proxies Anthropic-style chat completion requests (messages API) with per-call USDC micropayment settlement on Base or Solana, requiring no API keys","exampleAgentPrompt":"Send a message to Claude using BlockRun — no API key needed, just pay per call in USDC on Base — asking it to summarize this article: 'Crypto markets rallied today as Bitcoin crossed $100k for the first time.' Use claude-3-5-sonnet and allow up to 512 output tokens.","exampleUseCases":[{"title":"Autonomous agent summarizing content","prompt":"I need you to use BlockRun to ask Claude to summarize this research paper about blockchain scalability for me. Pay per call in USDC on Base, use claude-3-5-sonnet, and give me the summary in under 500 tokens."},{"title":"Multi-model routing without key management","prompt":"Route my question through BlockRun to whichever frontier model is cheapest right now — could be Claude or another provider — and have it explain how decentralized finance works. Just handle the USDC payment on Solana automatically, no keys needed."},{"title":"Streaming AI agent running autonomously","prompt":"Set up a Claude agent using BlockRun that can stream responses back to me as tokens arrive. Have it analyze market sentiment from these tweets, settle each call in USDC micropayments on Base, and don't worry about managing API credentials."}],"resultDescription":"Returns an Anthropic-style messages API response containing the assistant's reply text, any tool call invocations, usage token counts, and stop reason; supports optional SSE streaming for incremental token delivery. Payment of $0.01 USDC is settled on-chain per call via x402.","failureModes":["402 Payment Required — USDC payment not attached or insufficient balance","invalid model ID — model string not recognized by the gateway","malformed messages array — conversation history missing required role/content fields","max_tokens exceeded — requested token limit beyond model capacity","streaming error — SSE stream interrupted mid-response","payment settlement failure — on-chain transaction rejected on Base or Solana"],"whenToPreferThis":"Choose this endpoint when you need Claude-compatible LLM inference without managing Anthropic API keys, especially in autonomous agent contexts where crypto-native micropayment settlement (USDC on Base or Solana via x402) is preferred over subscription billing. Ideal for OpenClaw, Claude Code, or Franklin Agent integrations that need a single endpoint handling models, data, and runtime with no key management overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:01:01.989Z","isFirstParty":false}