{"openapi":"3.1.0","info":{"title":"BlockRun AI Gateway","version":"1.0.0","description":"Agent-native stablecoin AI gateway. Pay-per-request with USDC on Solana. No accounts or API keys required.","x-logo":{"url":"https://blockrun.ai/brand/logo-256.png","altText":"BlockRun"},"x-guidance":"Agent-native API gateway for AI inference + crypto/finance data, paid per-request with USDC on Solana via x402 — no accounts, no API keys. To call: GET an endpoint without a payment header → server returns 402 with x402 challenge → sign with your Solana wallet → POST/GET with x-payment header → response (and on-chain settlement) returns. Free endpoints (Pyth crypto/fx/commodity feeds, voice call status polls) return 200 directly. Full per-endpoint pricing, error shapes, and rate-limit semantics: https://sol.blockrun.ai/llms.txt"},"servers":[{"url":"https://sol.blockrun.ai"}],"paths":{"/api/v1/chat/completions":{"post":{"operationId":"chatCompletions","summary":"Chat Completions","description":"Access 85 frontier LLMs with OpenAI-compatible API. Price depends on model and token usage.","security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.0001","max":"5"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"Model ID to use for completion","enum":["openai/gpt-6-astra","openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-5.6-luna","openai/gpt-5.6-sol-pro","openai/gpt-5.6-terra-pro","openai/gpt-5.6-luna-pro","openai/gpt-5.5","openai/gpt-5.5-pro","openai/chat-latest","openai/gpt-5.4","openai/gpt-5.4-pro","openai/gpt-5.2","openai/gpt-5.1","openai/gpt-5.4-mini","openai/gpt-5-mini","openai/gpt-5.4-nano","openai/gpt-5.2-pro","openai/gpt-5.3-codex","openai/gpt-4.1","openai/gpt-4.1-mini","openai/gpt-4.1-nano","openai/gpt-4o","openai/gpt-4o-mini","openai/o1","openai/o3","openai/o3-mini","openai/o4-mini","anthropic/claude-haiku-4.5","anthropic/claude-sonnet-5","anthropic/claude-sonnet-4.5","anthropic/claude-sonnet-4.6","anthropic/claude-opus-4.5","anthropic/claude-opus-4.7","anthropic/claude-fable-5.1","anthropic/claude-fable-5","anthropic/claude-opus-4.8","anthropic/claude-opus-5","google/gemini-3.1-pro","google/gemini-3-flash-preview","google/gemini-3.8-flash","google/gemini-3.6-flash","google/gemini-3.5-flash","google/gemini-2.5-pro","google/gemini-2.5-flash","google/gemini-3.5-flash-lite","google/gemini-3.1-flash-lite","google/gemini-2.5-flash-lite","deepseek/deepseek-v4-flash-vision-exp","deepseek/deepseek-v4-pro","deepseek/deepseek-chat","deepseek/deepseek-reasoner","zai/glm-5.3","zai/glm-5.3-flash","zai/glm-5.2","zai/glm-5.1","zai/glm-5","zai/glm-5-turbo","xai/grok-4.6","xai/grok-4.5","xai/grok-4.3","xai/grok-build-0.1","moonshot/kimi-k3","minimax/minimax-m3","minimax/minimax-m2.7","qwen/qwen3.8-max","qwen/qwen3.7-max","qwen/qwen3.7-plus","qwen/qwen3.7-flash","qwen/qwen3.8-flash","tencent/hy4-preview","tencent/hy3","xiaomi/mimo-v2.5","xiaomi/mimo-v2.5-pro","nvidia/nemotron-3-nano-omni-30b-a3b-reasoning","nvidia/llama-3.2-11b-vision","nvidia/nemotron-3-ultra-550b","poolside/laguna-s-2.1","poolside/laguna-xs-2.1","cohere/north-mini-code","nvidia/nemotron-3.5-lightning","nvidia/muse-glimmer-30b","nvidia/gemma-4-31b"]},"messages":{"type":"array","description":"Array of chat messages","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","description":"Maximum tokens to generate","minimum":1,"maximum":128000},"temperature":{"type":"number","description":"Sampling temperature (0-2)","minimum":0,"maximum":2},"stream":{"type":"boolean","description":"Enable streaming responses"}}}}}},"responses":{"200":{"description":"Successful completion"},"402":{"description":"Payment Required"}}}},"/api/v1beta/models/gemini-2.5-flash:generateContent":{"post":{"operationId":"geminiGenerateContent","summary":"Native Google Gemini generateContent","description":"Native Google Gemini v1beta protocol (generateContent / streamGenerateContent) for Google GenAI SDK clients. Replace the path model with any available google/* model; append :streamGenerateContent for SSE. Price depends on model and token usage.","security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.0001","max":"5"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contents"],"properties":{"contents":{"type":"array","description":"Gemini native contents array","items":{"type":"object"}},"systemInstruction":{"type":"object"},"generationConfig":{"type":"object"}}}}}},"responses":{"200":{"description":"Native Gemini GenerateContentResponse"},"402":{"description":"Payment Required"}}}},"/api/v1/search":{"post":{"operationId":"search","summary":"Grok Live Search","description":"Real-time web and news search powered by xAI Grok with live data access.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","description":"Search query","minLength":1,"maxLength":1000},"sources":{"type":"array","description":"Data sources to search","items":{"type":"string","enum":["web","news"]},"default":["web"]},"max_results":{"type":"integer","description":"Maximum number of results","minimum":1,"maximum":50,"default":10}}}}}},"responses":{"200":{"description":"Search results"},"402":{"description":"Payment Required"}}}},"/api/v1/rpc/ethereum":{"post":{"operationId":"multichainRpc","summary":"Multi-chain RPC","description":"JSON-RPC 2.0 passthrough across 40+ chains (powered by Tatum). Swap `ethereum` in the path for any network — base, solana, polygon, bsc, arbitrum, optimism, avalanche, bitcoin, sui, and more: POST /api/v1/rpc/{network}. One endpoint, every chain, no API key. $0.002 per call; a JSON-RPC batch is priced per element.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method","id"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"],"description":"\"2.0\""},"method":{"type":"string","description":"Chain RPC method — e.g. eth_blockNumber, eth_call, eth_getBalance (EVM) or getSlot, getAccountInfo (Solana)."},"params":{"type":"array","items":{},"description":"Method-specific params."},"id":{"type":"integer","default":1,"description":"JSON-RPC id."}}}}}},"responses":{"200":{"description":"JSON-RPC result for the chosen network."},"402":{"description":"Payment Required"}}}},"/api/v1/images/generations":{"post":{"operationId":"imageGenerations","summary":"Image Generation","description":"Generate images with GPT Image 1/2/2.5, Gemini Nano Banana, Z.AI CogView-4, and xAI Grok Imagine.","security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.02","max":"0.15"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"model":{"type":"string","description":"Image model to use","enum":["openai/gpt-image-1","openai/gpt-image-2","openai/gpt-image-2.5-flare","openai/gpt-image-2.5-sunburst","google/nano-banana","google/nano-banana-2","google/nano-banana-pro","zai/cogview-4","xai/grok-imagine-image","xai/grok-imagine-image-pro"]},"prompt":{"type":"string","description":"Text description of the image to generate","minLength":1,"maxLength":4000},"size":{"type":"string","description":"Image dimensions","enum":["1024x1024","1024x1792","1792x1024"],"default":"1024x1024"},"n":{"type":"integer","description":"Number of images to generate","minimum":1,"maximum":10,"default":1},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"],"description":"OpenAI gpt-image models only; lower is faster."}}}}}},"responses":{"200":{"description":"Generated images"},"402":{"description":"Payment Required"}}}},"/api/v1/images/image2image":{"post":{"operationId":"imageEdit","summary":"Image Editing (Image-to-Image)","description":"Edit images with AI using text prompts. Send the source image (and optional mask) as a base64 data URI, or an array of images for fusion. OpenAI gpt-image-1 / gpt-image-2 / gpt-image-2.5-sunburst support mask-based inpainting; Google nano-banana / nano-banana-2 / nano-banana-pro do prompt-only edits (mask not supported).","security":[],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.02","max":"0.15"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","image"],"properties":{"model":{"type":"string","description":"Image model to use","enum":["openai/gpt-image-1","openai/gpt-image-2","openai/gpt-image-2.5-sunburst","google/nano-banana","google/nano-banana-2","google/nano-banana-pro"],"default":"openai/gpt-image-2"},"prompt":{"type":"string","description":"Text description of the desired edit"},"image":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":4}],"description":"Source image as a base64 data URI (data:image/<format>;base64,...), or an array of up to 4 images for fusion. OpenAI accepts up to 4, Google nano-banana up to 3. Decoded bytes must be a real PNG, JPEG or WEBP image (Google models also accept HEIC/HEIF) and the base64 must be single-line (no newlines) — validated before the 402. Mislabeled mime types are normalized to the actual byte format."},"mask":{"type":"string","description":"Base64 data URI of the mask image (optional, for inpainting). OpenAI models only — rejected for Google nano-banana models. Must decode to a PNG."},"size":{"type":"string","enum":["1024x1024","1024x1536","1536x1024"],"default":"1024x1024"},"n":{"type":"integer","minimum":1,"maximum":10,"default":1},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"],"description":"OpenAI gpt-image models only; lower is faster."}}}}}},"responses":{"200":{"description":"Edited images"},"402":{"description":"Payment Required"}}}},"/api/v1/crypto/list":{"get":{"operationId":"cryptoList","summary":"List Supported Crypto Pairs","description":"Enumerate crypto pairs available on the Pyth feed. Free discovery endpoint.","security":[],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":100,"maximum":2000}}],"responses":{"200":{"description":"List of supported crypto symbols"}}}},"/api/v1/crypto/price/BTC-USD":{"get":{"operationId":"cryptoPrice","summary":"Crypto Realtime Price","description":"Realtime price for a crypto pair from Pyth. Free. Substitute the path tail with any valid symbol from /list (e.g. BTC-USD, ETH-USD, SOL-USD).","security":[],"responses":{"200":{"description":"Latest price with confidence interval"}}}},"/api/v1/crypto/history/BTC-USD":{"get":{"operationId":"cryptoHistory","summary":"Crypto OHLC History","description":"Historical OHLC bars for a crypto pair. TradingView resolution convention. Powered by Pyth Benchmarks. Free. Substitute the path tail with any valid symbol from /list.","security":[],"parameters":[{"name":"resolution","in":"query","schema":{"type":"string","enum":["1","5","15","60","240","D","W","M"],"default":"D"}},{"name":"from","in":"query","required":true,"schema":{"type":"integer","description":"Unix seconds"}},{"name":"to","in":"query","schema":{"type":"integer","description":"Unix seconds (defaults to now)"}}],"responses":{"200":{"description":"Array of OHLC bars"}}}},"/api/v1/fx/list":{"get":{"operationId":"fxList","summary":"List Supported FX Pairs","description":"Enumerate FX pairs available on the Pyth feed. Free.","security":[],"responses":{"200":{"description":"List of supported FX symbols"}}}},"/api/v1/fx/price/EUR-USD":{"get":{"operationId":"fxPrice","summary":"FX Realtime Price","description":"Realtime FX rate from Pyth. Free. Substitute the path tail with any valid pair from /list (e.g. EUR-USD, GBP-USD, JPY-USD).","security":[],"responses":{"200":{"description":"Latest FX rate"}}}},"/api/v1/commodity/list":{"get":{"operationId":"commodityList","summary":"List Supported Commodities","description":"Enumerate commodities available on the Pyth feed. Free.","security":[],"responses":{"200":{"description":"List of supported commodity symbols"}}}},"/api/v1/commodity/price/XAU-USD":{"get":{"operationId":"commodityPrice","summary":"Commodity Realtime Price","description":"Realtime commodity price from Pyth. Free. Substitute the path tail with any valid symbol from /list (e.g. XAU-USD gold, XAG-USD silver, XPT-USD platinum, WTI).","security":[],"responses":{"200":{"description":"Latest commodity price"}}}},"/api/v1/usstock/list":{"get":{"operationId":"usStockList","summary":"List US Stock Tickers","description":"Enumerate US equity tickers available on the Pyth feed. Free.","security":[],"responses":{"200":{"description":"List of supported US stock tickers"}}}},"/api/v1/stocks/us/list":{"get":{"operationId":"globalStockList","summary":"List Tickers in a Stock Market","description":"Enumerate tickers for a given market. Free. Substitute the `us` segment with any of: us, hk, jp, kr, gb, de, fr, nl, ie, lu, cn, ca.","security":[],"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":100,"maximum":2000}}],"responses":{"200":{"description":"List of tickers"}}}},"/api/v1/phone/lookup":{"post":{"operationId":"phoneLookup","summary":"Phone Carrier Lookup","description":"Look up carrier information and line type for a phone number (E.164). Powered by Twilio.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phoneNumber"],"properties":{"phoneNumber":{"type":"string","description":"Phone number in E.164 format."}}}}}},"responses":{"200":{"description":"Carrier + line-type info"},"402":{"description":"Payment Required"}}}},"/api/v1/phone/lookup/fraud":{"post":{"operationId":"phoneLookupFraud","summary":"Phone Fraud Signals Lookup","description":"Carrier info + SIM swap detection + call forwarding signals for a phone number. Powered by Twilio.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phoneNumber"],"properties":{"phoneNumber":{"type":"string","description":"Phone number in E.164 format."}}}}}},"responses":{"200":{"description":"Carrier + fraud signals"},"402":{"description":"Payment Required"}}}},"/api/v1/phone/numbers/buy":{"post":{"operationId":"phoneNumbersBuy","summary":"Provision a dedicated phone number (30 days)","description":"Buy a US or CA phone number bound to your wallet for 30 days. Number is auto-registered with Bland for outbound caller ID.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"5"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","description":"ISO country code: 'US' or 'CA'.","default":"US"},"areaCode":{"type":"string","description":"Preferred 3-digit area code."}}}}}},"responses":{"200":{"description":"Provisioned number"},"402":{"description":"Payment Required"}}}},"/api/v1/phone/numbers/renew":{"post":{"operationId":"phoneNumbersRenew","summary":"Renew a provisioned phone number (+30 days)","description":"Extend the lease on a wallet-owned phone number by 30 days.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"5"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phoneNumber"],"properties":{"phoneNumber":{"type":"string","description":"Your provisioned number in E.164 format."}}}}}},"responses":{"200":{"description":"Renewed expiry"},"402":{"description":"Payment Required"}}}},"/api/v1/phone/numbers/list":{"post":{"operationId":"phoneNumbersList","summary":"List wallet's active phone numbers","description":"Return all active phone numbers provisioned to the caller wallet. Wallet identity is derived from the x402 payment header.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"description":"No body required. Wallet is identified by the x402 payment header."}}}},"responses":{"200":{"description":"Numbers list"},"402":{"description":"Payment Required"}}}},"/api/v1/phone/numbers/release":{"post":{"operationId":"phoneNumbersRelease","summary":"Release a provisioned phone number","description":"Return a wallet-owned phone number to the Twilio pool. Free, but routed through x402 for wallet identity.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0"},"protocols":[{"x402":{}}],"partner":"Twilio"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phoneNumber"],"properties":{"phoneNumber":{"type":"string","description":"Your provisioned number in E.164 format."}}}}}},"responses":{"200":{"description":"Released"},"402":{"description":"Payment Required"}}}},"/api/v1/voice/call":{"post":{"operationId":"voiceCall","summary":"AI Outbound Voice Call (Bland.ai)","description":"Initiate an AI-powered outbound phone call. The agent calls the recipient and conducts a conversation based on the 'task' instructions. Powered by Bland.ai.","security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.54"},"protocols":[{"x402":{}}],"partner":"Bland.ai"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","task","from"],"properties":{"to":{"type":"string","description":"Destination phone number (E.164)."},"task":{"type":"string","description":"Natural language description of what the AI should do on the call (10–4000 chars)."},"from":{"type":"string","description":"Caller-ID number — must be wallet-owned. Buy one at POST /api/v1/phone/numbers/buy ($5/30 days)."},"voice":{"type":"string","description":"Voice preset or Bland.ai voice ID."},"max_duration":{"type":"integer","description":"Max minutes (1–30, default 5)."},"language":{"type":"string","description":"STT/TTS language (default en-US)."}}}}}},"responses":{"200":{"description":"Call queued"},"402":{"description":"Payment Required"}}}}}}