{"uid":"cap_yazbVH6C-BfQmE3PAiNVP","slug":"locus-x402-claude-chat-api-b7589107","name":"Locus x402 Claude Chat API","description":"Locus public pay-per-use API","url":"https://anthropic.x402.stage.paywithlocus.com/anthropic/chat","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string"},"tools":{"type":"array","items":{}},"top_k":{"type":"number"},"top_p":{"type":"number"},"system":{"anyOf":[{"type":"string"},{"type":"array","items":{}}]},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"name":{"type":"string"},"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","required":["type"],"properties":{"text":{"type":"string"},"type":{"type":"string"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}},"additionalProperties":true}},"additionalProperties":true}},{"type":"null"}]},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}},"tool_call_id":{"type":"string"}},"additionalProperties":true}},"thinking":{"type":"object","additionalProperties":true},"max_tokens":{"type":"number"},"temperature":{"type":"number"},"tool_choice":{"type":"object","additionalProperties":true},"stop_sequences":{"type":"array","items":{"type":"string"}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_rH1NDKirRxQle3yI7hXOa","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-use metered chat completions endpoint proxying Anthropic Claude models (Opus 4, Sonnet 4, Haiku 4) via x402 micropayment protocol","exampleAgentPrompt":"Using the Locus x402 pay-per-call Claude endpoint, send this conversation to claude-sonnet-4-6 with a max of 1024 tokens: system prompt 'You are a helpful assistant', user message 'Explain quantum entanglement in two sentences'.","exampleUseCases":[{"title":"One-off Claude reasoning task","prompt":"Send this message to claude-opus-4-7 via the Locus x402 metered endpoint — system: 'You are a senior software engineer', user: 'Review this Python function and suggest improvements: def add(a,b): return a+b' — cap the response at 512 tokens."},{"title":"Agentic tool-calling workflow","prompt":"Call the Locus x402 Claude API with claude-sonnet-4-6, pass my tool definition for 'search_web' with input schema {query: string}, set tool_choice to auto, and send the user message: 'Find the latest news about renewable energy breakthroughs.'"},{"title":"Extended thinking for complex analysis","prompt":"Use the Locus x402 Claude endpoint with claude-opus-4-7, enable extended thinking with a 10000-token budget, and ask: 'What are the strongest arguments for and against universal basic income? Reason carefully before answering.' Limit output to 2000 tokens."}],"resultDescription":"Returns an Anthropic-compatible chat completion response object containing the assistant's reply message, stop reason, usage statistics (input/output tokens billed), and any tool call payloads if tools were invoked. Extended thinking responses include thinking token blocks billed at the output token rate.","failureModes":["Payment failure or insufficient USDC balance via x402 protocol returns 402 Payment Required","Unsupported model ID returns 400 Bad Request","Exceeding model token limits (128k Opus, 64k Sonnet/Haiku) causes truncation or error","Malformed messages array structure returns validation error","Rate limiting or upstream Anthropic outage returns 503 or 500","Invalid tool definition schema causes tool-calling errors"],"whenToPreferThis":"Choose this endpoint when you need on-demand, pay-per-call access to Anthropic Claude models without a subscription or prepaid API key — especially in agentic contexts where usage is sporadic or cost must be directly tied to each call. Ideal when your agent runtime supports the x402 micropayment protocol and you want to access Opus-class reasoning or extended thinking without committing to a monthly plan. Prefer this over the direct Anthropic API when you lack API credentials or need USDC-denominated billing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T17:53:10.175Z","isFirstParty":false}