{"uid":"cap_OHyVO0gwXiG4j53MhCiHV","slug":"agent402-pro-messages-pay-per-call-ai-inference-via-x402-a90c2046","name":"Agent402 Pro Messages — Pay-Per-Call AI Inference via x402","description":"Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1/pro and pay $0.10 per call in USDC, no API key, no signup. Same models, caps and price as this tier's /chat/completions route; any model here is served through the Messages wire (Claude natively, others translated). Up to 48,000 input chars and 4096 output tokens; streaming supported.","url":"https://agent402.tools/v1/pro/messages","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"zdr":{"type":"boolean","description":"Optional - zero-data-retention providers only"},"model":{"type":"string","description":"Model id (OpenRouter naming, e.g. anthropic/claude-sonnet-5) - allowlisted per tier; omit (or \"auto\") on the auto tier"},"tools":{"type":"array","description":"Optional client tools {name, description, input_schema}; server/built-in tools are not served"},"stream":{"type":"boolean","description":"Anthropic SSE (message_start … message_stop)"},"system":{"type":"string","description":"Optional system prompt (string or text blocks)"},"messages":{"type":"array","description":"Anthropic messages: {role: user|assistant, content: string | [text|image|tool_use|tool_result blocks]}"},"thinking":{"type":"object","description":"Optional {type:\"enabled\", budget_tokens} | {type:\"adaptive\"} | {type:\"disabled\"} - thinking tokens are output tokens"},"max_tokens":{"type":"integer","description":"Required by the Messages API; clamped to the tier's output cap"}}},"responseSchema":{"type":"json","example":{"id":"msg_…","role":"assistant","type":"message","model":"anthropic/claude-sonnet-5","usage":{"input_tokens":14,"output_tokens":18},"content":[{"text":"x402 is an HTTP-native way for agents to pay per request with USDC.","type":"text"}],"stop_reason":"end_turn"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","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.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6IrzJ5r2tzFgwxPJP1fcW","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs an Anthropic-compatible Messages API call (Claude models) paid per-request in USDC via x402, with no signup or API keys required — the wallet is the identity.","exampleAgentPrompt":"Send a message to Claude Sonnet 4 asking it to explain how x402 payments work — use the pay-per-call inference endpoint, stream the response, and cap output at 512 tokens.","exampleUseCases":[{"title":"Wallet-authenticated agent reasoning","prompt":"I want my AI agent to call Claude to reason through a multi-step problem without me setting up any API keys — just pay per call from the wallet. Use anthropic/claude-sonnet-5, set max_tokens to 1024, and pass my system prompt about being a financial analyst."},{"title":"Zero-data-retention LLM call","prompt":"Run a Claude inference call with zero-data-retention providers only — I'm processing sensitive documents and can't have the provider store anything. Use the zdr flag, model auto, max_tokens 2048, and stream the response back."},{"title":"Tool-augmented agent with x402 billing","prompt":"My agent needs to call Claude with a custom tool definition for web search — pass the tool schema in the tools array, use anthropic/claude-opus-4, max_tokens 4096, and have the response stream back so I can show the thinking steps as they arrive."}],"resultDescription":"An Anthropic Messages API-compatible JSON object containing the assistant role response, content blocks (text and/or tool_use), the model name, stop_reason (end_turn, tool_use, max_tokens, etc.), and token usage counts for input and output. When streaming is enabled, returns Anthropic SSE events (message_start through message_stop).","failureModes":["Payment failure (402) if wallet has insufficient USDC or x402 handshake fails","Model not allowlisted for the tier — returns error indicating model restriction","max_tokens exceeds tier output cap — clamped silently or rejected","Malformed messages array (missing role or content) causes 400 validation error","Unsupported model ID string causes routing failure","Stream connection drop mid-response leaves partial SSE event buffer","ZDR flag set but no ZDR-compliant provider available for requested model"],"whenToPreferThis":"Choose this endpoint when you need Claude inference paid micropayment-style (USDC per call) without any account signup, API key management, or subscription — ideal for AI agents that self-fund via crypto wallets, workflows requiring zero-data-retention compliance, or developers building x402-native agentic pipelines. Prefer over standard Anthropic or OpenRouter direct access when wallet-as-identity authentication and on-chain per-call billing are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:55:12.475Z","isFirstParty":false}