{"slug":"agent402-tools-v1-messages-c11b65","title":"Anthropic Messages API over x402","host":"agent402.tools","method":"POST","resource":"https://agent402.tools/v1/messages","category":"code","description":"Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1 and pay $0.02 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 w","price_listed":0.02,"price_asked":0.02,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":953,"reported_calls_30d":2,"reported_payers_30d":1,"networks":["algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=","eip155:10","eip155:1329","eip155:137","eip155:143","eip155:42161","eip155:42220","eip155:43114","eip155:4663","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","stellar:pubnet"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"max_tokens":256,"messages":[{"content":"Summarize x402 in one sentence.","role":"user"}],"model":"anthropic/claude-haiku-4.5"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"effort":{"description":"Optional depth control for Claude 4.7+ (Opus 5, Sonnet 5, Fable 5.1): low | medium | high | xhigh | max, validated against the model's own list (GET /v1/models). Not accepted on Haiku 4.5 and older, which take thinking.budget_tokens instead","type":"string"},"max_tokens":{"description":"Required by the Messages API; clamped to the tier's output cap","type":"integer"},"messages":{"description":"Anthropic messages: {role: user|assistant, content: string | [text|image|tool_use|tool_result blocks]}","type":"array"},"model":{"description":"Model id (OpenRouter naming, e.g. anthropic/claude-sonnet-5) - allowlisted per tier; omit (or \"auto\") on the auto tier","type":"string"},"stream":{"description":"Anthropic SSE (message_start … message_stop)","type":"boolean"},"system":{"description":"Optional system prompt (string or text blocks)","type":"string"},"thinking":{"description":"Optional {type:\"enabled\", budget_tokens} | {type:\"adaptive\"} | {type:\"disabled\"} - thinking tokens are output tokens. On Claude 4.7+ (Opus 5, Sonnet 5, Fable 5.1) thinking is adaptive and `effort` is the depth control; a budget_tokens value is advisory there","type":"object"},"tools":{"description":"Optional client tools {name, description, input_schema}; server/built-in tools are not served","type":"array"},"zdr":{"description":"Optional - zero-data-retention providers only","type":"boolean"}},"required":["max_tokens","messages"]},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"content":{"items":{"properties":{"text":{"type":"string"},"type":{"type":"string"}},"type":"object"},"type":"array"},"id":{"type":"string"},"model":{"type":"string"},"role":{"type":"string"},"stop_reason":{"type":"string"},"type":{"type":"string"},"usage":{"properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"}},"type":"object"}},"required":["id","type","role","model","content","stop_reason","usage"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.02,"price_match":true,"latency_ms":953,"error":null}],"description_full":"Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1 and pay $0.02 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). Depth: `effort` (low..max) on Claude 4.7+, thinking.budget_tokens on older Claude. Up to 32,000 input chars and 2048 output tokens; streaming supported.","last_updated":"2026-09-22T11:53:38.734Z","schemes":["exact","upto"]}