{"uid":"cap_8lrUyLQMoPDI0laLqkUWN","slug":"blockrun-pay-per-call-ai-chat-completions-31573690","name":"BlockRun Pay-Per-Call AI Chat Completions","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/chat/completions","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"AI model ID (e.g., gpt-4o-mini, claude-haiku-4.5)"},"stream":{"type":"boolean","description":"Enable streaming responses"},"messages":{"type":"array","description":"Array of chat messages with role and content"},"max_tokens":{"type":"integer","description":"Maximum tokens to generate"},"temperature":{"type":"number","description":"Sampling temperature (0-2)"}}},"responseSchema":null,"example":{"request":{"model":"gpt-4o-mini","stream":false,"messages":[{"role":"user","content":"What is artificial intelligence?"}],"max_tokens":150,"temperature":0.7},"response":{"id":"chatcmpl-DpoJ3QLcWOtNhVbCEqCagyOhVmXoH","model":"gpt-4o-mini","usage":{"total_tokens":204,"prompt_tokens":98,"completion_tokens":106,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"completion_tokens_details":{"audio_tokens":0,"reasoning_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Artificial intelligence (AI) refers to the simulation of human intelligence in machines that are programmed to think and learn like humans. This includes capabilities such as problem-solving, understanding natural language, recognizing patterns, and making decisions. AI can be categorized into two main types: narrow AI, which is designed for specific tasks (like virtual assistants or recommendation systems), and general AI, which aims to perform any intellectual task that a human can do. AI technologies include machine learning, neural networks, natural language processing, and robotics, among others."},"finish_reason":"stop"}],"created":1781240477}},"exampleRequest":{"model":"gpt-4o-mini","stream":false,"messages":[{"role":"user","content":"What is artificial intelligence?"}],"max_tokens":150,"temperature":0.7},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ATIox-ipK2b5nqdycjT2H","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sends chat messages to AI models (e.g. GPT-4o-mini, Claude Haiku) and returns completions, billed per call in USDC with no API key required.","exampleAgentPrompt":"Send this conversation to gpt-4o-mini on BlockRun and get a completion — messages are [{role: user, content: 'Explain proof of work in two sentences'}], max 200 tokens, temperature 0.7, no streaming.","exampleUseCases":null,"resultDescription":"Returns an OpenAI-compatible chat completion object containing the assistant's generated message, finish reason, and token usage counts. If streaming is enabled, returns server-sent events with incremental token chunks.","failureModes":["Insufficient USDC balance or failed x402 micropayment — returns 402 Payment Required","Invalid or unsupported model ID — returns 400 with model not found error","Messages array missing or malformed — returns 400 validation error","Max tokens exceeds model context limit — returns 400 or truncated response","Network timeout on long completions — returns 504 or partial stream","Rate limiting if too many concurrent calls — returns 429"],"whenToPreferThis":"Choose this endpoint when your agent needs LLM completions without managing separate API keys for OpenAI or Anthropic, especially in Web3-native or crypto-payment contexts where paying per call in USDC over Base or Solana is preferred over subscription billing. Ideal for autonomous agents using the x402 payment protocol or frameworks like OpenClaw, Claude Code, or Franklin Agent.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:51:49.923Z","isFirstParty":false}