Home / API docs / LLM Inference API
Inference

LLM Inference API

POST /api/llm $0.01 per call USDC on Base · x402

LLM INFERENCE for keyless agents — POST {prompt, system?} and get Claude Haiku's answer: summarize, classify, extract, rewrite, translate, draft. No API key, no account, no subscription — the x402 payment IS the auth. One flat price per call. Caps: 8,000-char prompt, 2,000-char system, ~1,000-token response (stop_reason tells you if you hit it). Powered by Claude Haiku 4.5.

Parameters

NameInDescription
promptbodyrequiredThe task/question, up to 8,000 chars
systembodyOptional system prompt (persona, format rules), up to 2,000 chars

Example request

curl -X POST "https://api.webbersites.com/api/llm" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Classify this support ticket as billing, bug, or feature request: 'I was charged twice this month.'","system":"Answer with a single word."}'
# first call returns 402 + payment requirements; an x402 client pays and retries automatically

Example response

{
    "response": "billing",
    "model": "claude-haiku-4-5",
    "stop_reason": "end_turn",
    "usage": {
        "input_tokens": 41,
        "output_tokens": 4
    }
}
MCP tool: post_llm — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.

How payment works

There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.