{"uid":"cap_Apmnx8u6hMR0PZwFFqLC1","slug":"agent402-tools-metered-anthropic-messages-api-dd9f4a51","name":"Agent402.tools Metered Anthropic Messages API","description":"The Anthropic Messages wire priced from the request itself: the 402 quotes this exact body, from $0.001, with upto buyers settling actual usage under the quote. Use it when an agent built on the Anthropic SDK, or Claude Code, needs any supported model paid per call with no account.","url":"https://agent402.tools/v1/metered/messages?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"zdr":{"type":"boolean"},"model":{"type":"string"},"tools":{"type":"array"},"effort":{"type":"string"},"stream":{"type":"boolean"},"system":{"type":"string"},"messages":{"type":"array"},"thinking":{"type":"object"},"max_tokens":{"type":"integer"}}},"responseSchema":{"type":"json","example":{"note":"full example in /openapi.json","truncated":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.187875","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.99","reviews":0,"stars":null,"state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.187875/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HaXhygPH580WcNf4FVCZt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Forwards requests to the Anthropic Messages API with per-call billing via x402 micropayments, priced at 1.15× model list price (input+output tokens) with a $2 cap","exampleAgentPrompt":"Send a Claude Sonnet message asking 'What is x402 and how does it work?' with a max of 256 output tokens, billed per request using USDC micropayments — quote me the exact cost before settling.","exampleUseCases":[{"title":"Agentic LLM calls without subscription","prompt":"I want my agent to call Claude Sonnet for each user query without committing to a monthly API plan — just charge USDC per request based on actual tokens used, capped at $2 per call."},{"title":"Tool-augmented reasoning on demand","prompt":"Run a Claude claude-3-5-sonnet call with my custom search tool definition and a system prompt saying 'You are a research assistant' — the message is 'Summarize recent AI safety developments', max 512 tokens, pay per call."},{"title":"Streaming Claude inference with micropayment","prompt":"Stream a response from Claude on the metered endpoint for the message 'Draft a 3-paragraph product description for a reusable water bottle', using streaming SSE, max 400 tokens, and settle the cost in USDC automatically."}],"resultDescription":"Returns an Anthropic Messages API response object containing the assistant's content blocks (text, tool_use, etc.), the model used, token usage counts (input and output), a stop_reason, and a unique message ID — identical to the native Anthropic API response format.","failureModes":["402 Payment Required if x402 payment header is missing or insufficient","400 Bad Request if model ID is not on the allowlist for the selected tier","400 if max_tokens exceeds the tier output cap","Model unavailable if requested model is temporarily offline","Payment settlement failure if USDC balance or card authorization is insufficient","Timeout or streaming interruption on very long generation requests"],"whenToPreferThis":"Choose this endpoint when you need pay-as-you-go access to Claude models with no monthly subscription, when your agent must settle inference costs in USDC via x402 micropayments, or when you want exact token-cost transparency (BPE-counted, 1.15× list price) with a per-call cap. Prefer it over direct Anthropic API when operating in agentic finance pipelines where on-chain payment settlement is required, or when you want to avoid credit card billing and instead pay per inference call programmatically.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":140,"lastUsedAt":"2026-10-02T22:59:17.632Z","lastSuccessfullyRanAt":"2026-10-02T22:59:17.632Z","lastHealthCheckAt":"2026-11-03T05:58:55.828Z","isFirstParty":false,"canonicalSlug":"agent402-tools-metered-anthropic-messages-api-dd9f4a51"}