# Agent402.tools Metered Anthropic Messages API

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

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

## Facts

- Endpoint: POST https://agent402.tools/v1/metered/messages
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-metered-anthropic-messages-api-dd9f4a51
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Apmnx8u6hMR0PZwFFqLC1

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-tools-metered-anthropic-messages-api-dd9f4a51 -d '<json body>'
```

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

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Anthropic Messages API billed per request from what the call costs: the 402 quotes exact-BPE input (system + messages + tools) plus your max_tokens at the model's list price, times 1.15, from $0.001 up to a $2 per-call cap. Point the Anthropic SDK (or any Messages-format client) at base_url https://agent402.tools/v1/metered. Any model from the flat tiers (GET /v1/models). Pay the quote over x402 exact, or authorize it as a ceiling over upto, credits or card and settle actual usage.

## Output

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.

## 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-tools-metered-anthropic-messages-api-dd9f4a51/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)
