{"uid":"cap_5AWoZ_a7Gg4Ao8f_xUno5","slug":"agent402-anthropic-messages-api-x402-nano-tier-9435a15b","name":"Agent402 Anthropic Messages API (x402, nano tier)","description":"Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1/nano and pay $0.003 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 12,000 input chars and 768 output tokens; streaming supported.","url":"https://agent402.tools/v1/nano/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.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KrYPpF_ODnvBneUcCT7Cw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Proxy the Anthropic Messages API (Claude models) over x402 micropayment at $0.003 USDC per call, requiring no API key or signup","exampleAgentPrompt":"Ask Claude sonnet to summarize this article in three bullet points — pay per call using my USDC wallet, no API key needed, with a 1024 token output limit.","exampleUseCases":[{"title":"Keyless Claude for autonomous agent","prompt":"I'm building an agent pipeline that needs to call Claude without managing API keys — can you send the message 'Analyze the risk factors in this contract text' to anthropic/claude-sonnet-5 with a 2048 token cap and pay $0.003 USDC per call from my wallet?"},{"title":"Streaming Claude response in real time","prompt":"Stream a Claude response to my user's question 'What are the top 5 causes of the French Revolution?' using the nano tier with SSE streaming enabled and max 512 tokens."},{"title":"Claude with custom tools and thinking","prompt":"Call Claude with a tool definition for a web search function and enable extended thinking with a 5000 token budget — the user message is 'Research the latest battery technology breakthroughs and cite your sources', capped at 4096 output tokens."}],"resultDescription":"Returns a full Anthropic Messages API response object including assistant content blocks (text, tool_use, or thinking), stop reason, model used, and token usage counts. When stream=true, returns Anthropic-compatible SSE events from message_start through message_stop.","failureModes":["402 Payment Required if x402 payment header is missing or wallet has insufficient USDC","Model not allowlisted on nano tier returns an error","max_tokens clamped silently to tier output cap","Invalid message format (missing role or content) returns 400","Network timeout on long generations with large max_tokens","ZDR flag set but model provider does not support zero-data-retention"],"whenToPreferThis":"Choose this endpoint when you need Claude inference without an Anthropic API key or account, want pure pay-per-call pricing at $0.003 USDC with no monthly commitment, or are building an autonomous agent that self-funds its own LLM calls via x402 micropayments. Prefer it over the OpenAI-compatible /chat/completions sibling when your code already uses the Anthropic SDK or Messages API format with multi-turn messages, tool use, or extended thinking blocks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:05.147Z","isFirstParty":false}