{"uid":"cap_Ftw77tJNOOVA4dqId9isc","slug":"openrouter-via-locus-x402-95749a2e","name":"OpenRouter via Locus x402","description":"Unified LLM gateway — one OpenAI-compatible API routing to hundreds of models from Anthropic, OpenAI, Google, Meta, and more.","url":"https://openrouter.x402.paywithlocus.com/openrouter/chat?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string"},"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}},"max_tokens":{"type":"number"},"temperature":{"type":"number"}}},"responseSchema":{"type":"json","example":{"data":{},"payment":{"scheme":"exact","settledUsdc":"0.001000","authorizedMaxUsdc":"0.001000"},"request":{"id":"00000000-0000-4000-8000-000000000000","statusUrl":"/requests/00000000-0000-4000-8000-000000000000"},"success":true}},"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_wGRwVLth4xwEFJQ2T5A45","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":"Routes chat completion requests to hundreds of LLMs (Anthropic, OpenAI, Google, Meta, and more) through a single OpenAI-compatible API endpoint with micropayment billing via x402.","exampleAgentPrompt":"Using the OpenRouter gateway, send this conversation to anthropic/claude-sonnet-5 with a max of 1024 output tokens: system prompt 'You are a helpful assistant', user message 'Explain quantum entanglement in two sentences'.","exampleUseCases":[{"title":"Multi-model comparison for research","prompt":"Send the same prompt — 'Summarize the pros and cons of nuclear energy in 3 bullet points' — to both google/gemini-2.5-flash and openai/gpt-oss-120b via the OpenRouter gateway, with max 512 tokens each, so I can compare the outputs."},{"title":"Customer support agent with Claude","prompt":"My support bot needs to reply to a customer message. Route it through OpenRouter to anthropic/claude-haiku-4.5 with max 300 tokens and a system prompt that says 'You are a friendly customer support agent for a SaaS product': user message is 'How do I reset my password?'"},{"title":"Cost-controlled creative writing task","prompt":"Use the OpenRouter gateway to generate a short 200-word horror story using meta/llama-3-70b-instruct, set temperature to 0.9 and cap it at 400 output tokens so I keep the cost predictable."}],"resultDescription":"Returns a JSON object containing the LLM chat completion response nested under 'data', along with payment metadata showing settled and authorized USDC amounts, a unique request ID, and a status URL for tracking the request. The 'data' field follows the standard OpenAI chat completion response format.","failureModes":["Invalid or unsupported model ID returns an error — use provider-prefixed IDs like 'anthropic/claude-sonnet-5'","Missing max_tokens field causes rejection since it's required for x402 payment authorization ceilings","Insufficient USDC balance or failed x402 payment authorization blocks the request","Malformed messages array (wrong role values or missing content) returns a validation error","Exceeding the model's context window with the messages array causes a context length error","Network timeout if the upstream model provider is slow or unavailable"],"whenToPreferThis":"Choose this endpoint when you need access to multiple LLM providers through a single OpenAI-compatible interface without managing separate API keys, especially when pay-per-call micropayment billing via x402 is preferred over subscription plans. Ideal for agents that need to dynamically route to different models (e.g. cheapest for simple tasks, most capable for complex ones) or compare outputs across providers. Prefer this over direct provider APIs when you want unified billing in USDC and a single integration point.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T00:33:15.928Z","isFirstParty":false,"canonicalSlug":"openrouter-via-locus-x402-95749a2e"}