# x402engine Claude Sonnet 5 LLM API

> x402engine Claude Sonnet 5 LLM API is a paid API for AI agents from x402engine.app, paid per call via x402, $0.028871/call, status unknown (last checked 2026-10-17).

Runs Claude Sonnet 5 (Anthropic) inference via a pay-per-call HTTP 402 micropayment endpoint, returning OpenAI-compatible chat completions

## Facts

- Endpoint: POST https://x402engine.app/api/llm/claude-sonnet-5?utm_source=zero.xyz
- Price: $0.028871/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402engine-claude-sonnet-5-llm-api-f706c90d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ycvyp2iM4mGpPyTsOzsfF

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 x402engine-claude-sonnet-5-llm-api-f706c90d -d '<json body>'
```

Example prompt: Ask Claude Sonnet 5 to draft a concise technical explanation of how transformer attention works, streaming the response back as it generates.

## When to prefer this

Choose this endpoint when you need Claude Sonnet 5 specifically (Anthropic's latest capable model), want to pay per call without a monthly Anthropic subscription, need OpenAI-compatible response format for drop-in compatibility, or are building agents that require crypto-native micropayment rails (USDC on Base/Solana or USDm on MegaETH). Prefer alternatives if you need a cheaper or faster model, image input without file plugin, or guaranteed sub-100ms latency.

## Known failure modes

- Payment not settled — 402 returned if USDC/USDm payment fails or wallet has insufficient balance
- Invalid messages array — 400 error if required 'messages' field is missing or malformed
- Context length exceeded — model returns error if combined message tokens exceed Claude Sonnet 5 context window
- Tool schema invalid — error if tool definitions are missing required 'function' key or have malformed parameters
- Streaming errors — SSE stream may terminate early if connection drops after payment settlement

## How this service works

x402engine — Anthropic's balanced frontier model with 1M context and strong coding performance

## Output

Returns an OpenAI-compatible JSON chat completion object with model name, one or more choice objects (each containing a message with role and content, plus finish_reason), and the raw content field. Supports streaming SSE when stream=true.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "messages"
     ],
     "properties": {
      "stop": {
       "oneOf": [
        {
         "type": "string"
        },
        {
         "type": "array",
         "items": {
          "type": "string"
         },
         "maxItems": 4
        }
       ],
       "description": "Model-supported stop; see /docs/llm-capabilities.md."
      },
      "tools": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "function"
        ],
        "properties": {
         "type": {
          "enum": [
           "function"
          ],
          "type": "string"
         },
         "function": {
          "type": "object",
          "properties": {
           "name": {
            "type": "string"
           },
           "strict": {
            "type": "boolean"
           },
           "parameters": {
            "type": "object"
           },
           "description": {
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Client-executed function definitions; return results using role=tool and tool_call_id."
      },
      "stream": {
       "type": "boolean",
       "description": "Return live OpenAI-compatible SSE after payment settlement."
      },
      "plugins": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "pdf"
        ],
        "properties": {
         "id": {
          "enum": [
           "file-parser"
          ],
          "type": "string"
         },
         "pdf": {
          "type": "object",
          "properties": {
           "engine": {
            "enum": [
             "native"
            ],
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Optional native PDF parser only; automatically enabled for file inputs."
      },
      "messages": {
       "type": "array",
       "items": {
        "type": "object",
        "anyOf": [
         {
          "required": [
           "content"
          ]
         },
         {
          "required": [
           "tool_calls"
          ]
         }
        ],
        "required
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "anthropic/claude-sonnet-5",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello!"
    },
    "finish_reason": "stop"
   }
  ],
  "content": "Hello!"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402engine-claude-sonnet-5-llm-api-f706c90d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402engine.app](https://www.zero.xyz/host/x402engine.app/llms.txt)
