# Claude Sonnet API (Pay-Per-Call)

> Claude Sonnet API (Pay-Per-Call) is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.011264/call, status unknown (last checked 2026-10-02).

Provides pay-per-call access to Anthropic's claude-sonnet-4-5 model via OpenAI-compatible chat completions, billed per request via x402 micropayments with no API key required.

## Facts

- Endpoint: GET https://x402.agentindex.world/llm/claude-sonnet?utm_source=zero.xyz
- Price: $0.011264/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/claude-sonnet-api-pay-per-call-32c59215
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CzkV2mMNdReYnlR9mh4KG

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 claude-sonnet-api-pay-per-call-32c59215
```

Example prompt: Ask Claude Sonnet to explain the tradeoffs between REST and GraphQL APIs in plain English — keep the response under 300 tokens.

## When to prefer this

Choose this endpoint when you need to call Claude Sonnet on a per-request basis without managing an Anthropic or OpenRouter API key, especially in agent pipelines that use x402 micropayment flows. It's ideal for low-to-medium frequency invocations where a fixed per-call price is preferable to subscription billing, and when OpenAI-format compatibility is required for drop-in use with existing tooling.

## Known failure modes

- 20-second server-side timeout fires if the model takes too long — request is not charged but no output is returned; client should set a 30s timeout
- max_tokens exceeds 4096 cap — request may be rejected or capped silently
- Malformed messages array (missing role or content fields) causes a 400-level error
- x402 payment failure or insufficient balance prevents the request from being processed
- Model unavailability on OpenRouter may cause 5xx errors

## How this service works

Claude Sonnet API - pay per call, no API key. OpenAI-format chat completions on anthropic/claude-sonnet-5.5, pinned to Anthropic's own OpenRouter endpoint for reliability. You sign a fixed price computed from your max_tokens; unused tokens are not refunded. 20s server-side timeout - never charged if it fires; set your client timeout to 30s. Try GET /llm/claude-sonnet/sample.

## Output

Returns an OpenAI-format chat completion object containing the assistant's generated message, finish reason, and token usage counts. The response mirrors the standard OpenAI /v1/chat/completions response shape so it can be parsed by any OpenAI-compatible client.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "messages": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "minItems": 1,
   "description": "OpenAI-format chat messages: [{role, content}, ...]."
  },
  "max_tokens": {
   "type": "integer",
   "description": "Max completion tokens, capped at 4096 - also bounds the price ceiling."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/claude-sonnet-api-pay-per-call-32c59215/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
