# Agent402 Auto Messages - Pay-Per-Call LLM Inference via x402

> Agent402 Auto Messages - Pay-Per-Call LLM Inference via x402 is a paid API for AI agents from agent402.tools, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Runs an Anthropic-compatible chat completion (Messages API) against 500+ pay-per-call AI tools, billed at $0.01 USDC per call via the x402 payment protocol — no signup or API key required.

## Facts

- Endpoint: POST https://agent402.tools/v1/auto/messages
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-auto-messages-pay-per-call-llm-inference-via-x402-6e4849b2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tqXqr-SQRiICtAxfLRekW

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-auto-messages-pay-per-call-llm-inference-via-x402-6e4849b2 -d '<json body>'
```

Example prompt: Send this message to Claude Sonnet 5 through Agent402 — 'Explain what the x402 payment protocol is in two sentences' — with a max of 200 output tokens, paying per call with my USDC wallet.

## When to prefer this

Choose this endpoint when you need Anthropic-compatible LLM inference without creating an account or managing API keys — authentication is handled entirely by a crypto wallet paying $0.01 USDC per call via x402. It is especially suited for AI agents that need to pay programmatically, require zero-data-retention providers, or want to access 500+ built-in pay-per-call tools bundled with the inference layer. Prefer alternatives (direct Anthropic or OpenAI APIs) when you already have API keys, need guaranteed SLAs, or require models outside the Agent402 allowlist.

## Known failure modes

- 402 Payment Required if the x402 payment header is missing or the USDC balance is insufficient
- 400 Bad Request if messages array is missing or malformed
- 400 if max_tokens is missing (required by Anthropic Messages API)
- Model not allowlisted for tier if a disallowed model ID is specified
- Context length exceeded if messages exceed the model's context window
- Rate limiting or capacity errors from the upstream model provider
- Stream connection drop for long SSE responses

## 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/auto and pay $0.01 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 16,000 input chars and 1024 output tokens; streaming supported.

## Output

Returns an Anthropic Messages API-compatible JSON object containing the assistant role, one or more content blocks (text or tool_use), the model used, stop reason (end_turn, tool_use, max_tokens, etc.), and a usage object with input and output token counts. When streaming is enabled, returns Anthropic SSE events (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-auto-messages-pay-per-call-llm-inference-via-x402-6e4849b2/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)
