# x402engine Claude Sonnet (claude-sonnet) LLM API

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

Send OpenAI-compatible chat messages to Claude Sonnet and receive AI-generated text responses, paid per call via USDC micropayment.

## Facts

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

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-claude-sonnet-llm-api-32212bca -d '<json body>'
```

Example prompt: Ask Claude Sonnet to explain the trade-offs between microservices and monolithic architecture in three paragraphs, using the x402engine pay-per-call endpoint so I don't need a subscription.

## When to prefer this

Choose this endpoint when you need Claude Sonnet's strong reasoning, instruction-following, and multimodal (text + image + PDF) capabilities on a pure pay-per-call basis without an Anthropic API subscription or monthly commitment. Ideal for AI agents that make sporadic or bursty calls to a frontier model, want OpenAI-compatible message formats with tool/function calling, or need to pay in USDC on Base/Solana or USDm on MegaETH. Prefer over raw Anthropic API when you want zero-setup micropayment billing.

## Known failure modes

- Payment not settled — 402 returned if USDC/USDm payment is not included or insufficient
- Invalid messages format — missing required 'messages' array or malformed role values
- Unsupported parameters — top_k or other model-specific params not supported by Claude Sonnet
- Context length exceeded — messages array too long for model's context window
- Tool call schema error — malformed function definition causes rejection
- Stream not supported — some configurations may not support SSE streaming

## How this service works

125 production APIs behind HTTP 402 micropayments. 87 LLMs, Kling V3 and Hailuo video generation, image generation, code execution, travel search, web scraping, TTS, and transaction simulation. Pay with USDC on Base, USDm on MegaETH, or USDC on Solana.

## Output

Returns an OpenAI-compatible JSON response with a choices array containing the assistant message (role: assistant, content: generated text), finish_reason (e.g. 'stop'), and the model name. Also returns a top-level 'content' shortcut field with the raw text. If streaming is enabled, returns Server-Sent Events (SSE) in OpenAI format.

## 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."
      },
      "top_k": {
       "type": "integer",
       "description": "Model-supported top_k; see /docs/llm-capabilities.md."
      },
      "top_p": {
       "type": "number",
       "description": "Model-supported top_p; see /docs/llm-capabilities.md."
      },
      "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": "ar
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "anthropic/claude-sonnet-4.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-claude-sonnet-llm-api-32212bca/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)
