{"uid":"cap_5NTBhuDOkaoAa2_LWbLVX","slug":"agent402-premium-ai-messages-x402-pay-per-call-llm-inference-ec95ce7a","name":"Agent402 Premium AI Messages (x402 Pay-Per-Call LLM Inference)","description":"Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1/premium and pay $0.50 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 200,000 input chars and 8192 output tokens; streaming supported.","url":"https://agent402.tools/v1/premium/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.5","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.5/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AafUN8DT2TF6vMeK23qFr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.5","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Proxies Anthropic-compatible chat completion requests to frontier LLMs, billed per call in USDC via x402 with no API key required","exampleAgentPrompt":"Ask Claude Sonnet 5 via x402 pay-per-call to explain how proof-of-work consensus works — use the auto model tier, allow up to 1024 output tokens, and stream the response.","exampleUseCases":[{"title":"Autonomous agent self-funding LLM calls","prompt":"I want my AI agent to call Claude Sonnet directly and pay for each inference with USDC from its wallet — no API keys, just send the messages array and let x402 handle the billing. Use anthropic/claude-sonnet-5 with max_tokens 512."},{"title":"Zero-data-retention compliance query","prompt":"Run this legal document summary through Claude with zero-data-retention mode enabled so none of my text is stored anywhere — send it as the user message, use anthropic/claude-sonnet-5, and cap output at 2048 tokens."},{"title":"Extended thinking for complex reasoning","prompt":"I need Claude to deeply reason through this math proof step by step — enable extended thinking with a budget of 5000 tokens, use the auto model, and give me a max of 4096 output tokens for the response."}],"resultDescription":"Returns an Anthropic-format message object containing the assistant role, one or more content blocks (text and/or tool_use), the stop_reason (end_turn, tool_use, max_tokens, etc.), the resolved model name, and input/output token counts. When streaming is enabled, delivers Anthropic SSE events (message_start through message_stop).","failureModes":["402 Payment Required if wallet has insufficient USDC balance","Model ID not allowlisted for the caller's tier returns an error","max_tokens exceeds tier output cap and gets clamped or rejected","Malformed messages array (wrong role sequence) causes 400 bad request","Zero-data-retention requested but no ZDR-compliant provider available for the selected model","Streaming connection dropped mid-response leaves partial SSE stream","Tool schema validation failure if client-supplied tools have invalid input_schema"],"whenToPreferThis":"Choose this endpoint when you need LLM inference (especially Claude-family models) without managing API keys or subscriptions — ideal for AI agents that self-fund via a USDC wallet, scenarios requiring anonymous or pseudonymous access (wallet-as-identity), compliance use cases needing zero-data-retention, or when building on the x402 / MPP payment standard. Prefer alternatives (direct Anthropic API, OpenAI) if you already have managed credentials, need non-Claude models not on the allowlist, or cannot handle x402 payment flows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:16:15.345Z","isFirstParty":false}