# Agent402 Anthropic Messages API (x402, nano tier)

> Agent402 Anthropic Messages API (x402, nano tier) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Proxy the Anthropic Messages API (Claude models) over x402 micropayment at $0.003 USDC per call, requiring no API key or signup

## Facts

- Endpoint: POST https://agent402.tools/v1/nano/messages
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-anthropic-messages-api-x402-nano-tier-9435a15b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5AWoZ_a7Gg4Ao8f_xUno5

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-anthropic-messages-api-x402-nano-tier-9435a15b -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-anthropic-messages-api-x402-nano-tier-9435a15b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
