{"uid":"cap_z-Fjr3IfcOOba52BbSAiT","slug":"withzero-openrouter-chat-completions-via-zeroclick-0ff58fb6","name":"WithZero OpenRouter Chat Completions via ZeroClick","description":"Call any OpenRouter chat model with metered, at-cost billing.","url":"https://agents.withzero.xyz/api/v1/openrouter/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Say hello in one sentence."}],"max_tokens":64},"required":["model","messages","max_tokens","stream"],"properties":{"seed":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Random seed for deterministic outputs (support varies by model)."},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Stop sequence(s): generation halts when any is produced."},"model":{"type":"string","minLength":1,"description":"OpenRouter model ID, e.g. \"openai/gpt-4o-mini\", \"anthropic/claude-haiku-4-5\", \"google/gemini-flash-1.5\". Use GET /api/v1/models to list all available models with pricing."},"route":{"type":"string","description":"OpenRouter routing strategy, e.g. \"fallback\". Requires an explicit `models` list so every candidate model can be priced."},"tools":{"type":"array","items":{},"description":"OpenAI-format tool definitions for function calling."},"top_k":{"type":"integer","maximum":9007199254740991,"minimum":0,"description":"Top-k sampling: limit to the k most likely next tokens."},"top_p":{"type":"number","maximum":1,"minimum":0,"description":"Nucleus sampling probability mass 0–1. Alternative to temperature."},"models":{"type":"array","items":{"type":"string"},"description":"Fallback model list for OpenRouter auto-routing. Tried in order if the primary model is unavailable. The price reservation is taken at the most expensive rates across model + models, since any of them may serve the call; the difference is refunded on the metered route."},"stream":{"type":"boolean","const":false,"default":false,"description":"Must be false — streaming is not supported in v1."},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"name":{"type":"string","description":"Optional display name for the message author"},"role":{"enum":["system","user","assistant","tool"],"type":"string","description":"Message role: system (instructions), user (human turn), assistant (model turn), or tool (tool result)"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Message text content, or null for tool-call-only assistant turns"},"tool_calls":{"type":"array","items":{},"description":"For role=assistant: tool calls the model is making"},"tool_call_id":{"type":"string","description":"For role=tool: the tool_call_id this result responds to"}},"additionalProperties":false},"minItems":1,"description":"Conversation history as an array of {role, content} objects. At minimum one user message is required."},"reasoning":{"type":"object","properties":{"effort":{"enum":["none","minimal","low","medium","high","xhigh"],"type":"string","description":"Reasoning effort level. Mutually exclusive with max_tokens."},"enabled":{"type":"boolean","description":"Enable reasoning at the default (medium) effort."},"exclude":{"type":"boolean","description":"Generate reasoning but omit it from the response."},"max_tokens":{"type":"integer","maximum":9007199254740991,"description":"Explicit reasoning token budget.","exclusiveMinimum":0}},"description":"OpenRouter reasoning config for thinking models. Reasoning tokens bill as output tokens and are added to the price reservation.","additionalProperties":false},"logit_bias":{"type":"object","description":"Token ID → bias (-100 to 100) to adjust generation likelihood.","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"max_tokens":{"type":"integer","default":4096,"maximum":9007199254740991,"description":"Maximum output tokens. Controls your spend ceiling — the price reservation is input estimate x input_rate + (max_tokens + reasoning budget) x output_rate. The fixed route rejects requests reserving above its cap; use the metered route for large values.","exclusiveMinimum":0},"transforms":{"type":"array","items":{"type":"string"},"description":"OpenRouter prompt transforms, e.g. [\"middle-out\"] for context compression."},"temperature":{"type":"number","maximum":2,"minimum":0,"description":"Sampling temperature 0–2. Higher = more random. Defaults to model default (usually ~1.0)."},"tool_choice":{"description":"Tool selection strategy: \"auto\", \"none\", \"required\", or a specific tool name."},"response_format":{"type":"object","required":["type"],"properties":{"type":{"type":"string"}},"description":"Output format, e.g. {\"type\":\"json_object\"} to force JSON output.","additionalProperties":false},"presence_penalty":{"type":"number","description":"Penalise tokens that have appeared at all in the context (-2 to 2)."},"frequency_penalty":{"type":"number","description":"Penalise tokens proportional to how often they already appear (-2 to 2)."},"repetition_penalty":{"type":"number","description":"Repetition penalty multiplier (1.0 = no penalty). Some models only."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["id","object","created","model","choices","billing"],"properties":{"id":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"cost":{"type":"number"},"total_tokens":{"type":"number"},"prompt_tokens":{"type":"number"},"completion_tokens":{"type":"number"}},"additionalProperties":false},"object":{"type":"string"},"billing":{"type":"object","required":["promptTokens","completionTokens","reservedUsdcMicro","settledUsdcMicro","actualUsdcMicro","costBasis"],"properties":{"costBasis":{"enum":["openrouter","rates","estimated"],"type":"string","description":"Where actualUsdcMicro came from: OpenRouter usage accounting > cached per-token rates > character estimate"},"promptTokens":{"type":"number","description":"Actual input tokens consumed"},"actualUsdcMicro":{"type":"string","description":"Best-known actual cost of the call in micro-USDC. On the fixed route this is informational — the charge is settledUsdcMicro."},"completionTokens":{"type":"number","description":"Actual output tokens generated"},"settledUsdcMicro":{"type":"string","description":"Micro-USDC actually charged to the buyer. Fixed route: the up-front worst-case estimate (= reservedUsdcMicro). Metered route: actual usage (= actualUsdcMicro)."},"reservedUsdcMicro":{"type":"string","description":"Worst-case micro-USDC committed before the call"}},"additionalProperties":false},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"number"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"tool_calls":{"type":"array","items":{}}},"additionalProperties":false},"logprobs":{},"finish_reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"created":{"type":"number"},"system_fingerprint":{"type":"string"}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"5","displayCostAsset":"USD","priceDynamic":true,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":3,"rating":{"score":"0.67","successRate":"0.77","reviews":3,"stars":"3.7","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":{"amountUsd":"5.00","asset":"USDC"},"pricing":{"kind":"session","summary":"$5/call","primary":{"kind":"session","protocol":"mpp","network":"tempo","amountUsd":"5","per":"call","confidence":"exact","depositUsd":"5.00"},"accepted":[{"kind":"session","protocol":"mpp","network":"tempo","amountUsd":"5","per":"call","confidence":"exact","depositUsd":"5.00"},{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"5","per":"call","confidence":"exact"},{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_599kST2bQWmM3aTzdzouf","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"session","costAmount":"5","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":5000000,"planRef":null},{"uid":"pm_A5uOq7HCOscmmh2jznX4b","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"5","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_k2yPGjgtbxjB_c7__v3Ji","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"5","costPer":"request","priority":0,"asset":"usd","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Proxies chat completion requests to OpenRouter's LLM API via ZeroClick's pay-per-use payment and identity layer, requiring no vendor accounts or API keys.","exampleAgentPrompt":"Using the WithZero OpenRouter proxy, send a chat completion request asking 'What are the top three benefits of quantum computing?' and pay for it automatically with USDC — no API key needed.","exampleUseCases":[{"title":"Agent autonomously queries an LLM","prompt":"I need you to call the WithZero OpenRouter chat endpoint and ask it to summarize the latest trends in renewable energy in three bullet points — handle the USDC payment automatically."},{"title":"LLM inference without vendor account","prompt":"Can you run a chat completion via the WithZero OpenRouter proxy to generate a professional bio for a software engineer named Alex Chen with 10 years of experience in distributed systems? Pay per use, no account setup needed."},{"title":"Agentic creative writing task","prompt":"Use the WithZero OpenRouter gateway to generate a short story opening paragraph about a detective in a rainy cyberpunk city — pay the USDC fee automatically and return me the generated text."}],"resultDescription":"Returns a standard OpenRouter/OpenAI-compatible chat completion response object containing the model's generated message(s), token usage statistics, model name, finish reason, and any additional metadata returned by the underlying model provider.","failureModes":["Insufficient USDC balance causes payment failure and 402 response","Malformed request body (invalid JSON or missing required fields) returns 400 error","Underlying OpenRouter API unavailability causes 502 or 503 errors","Unsupported model name passed in body results in error from OpenRouter","Rate limiting or quota exhaustion on the underlying provider side","Network timeout if the LLM response takes too long"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to call an LLM via OpenRouter without setting up vendor accounts or managing API keys, and wants autonomous USDC-based pay-per-use billing. Ideal for agents operating in agentic pipelines where acquiring credentials is impractical or undesirable. Prefer over direct OpenRouter access when the agent uses ZeroClick's identity and payment infrastructure.","instructions":null,"reviewSummary":"WithZero via ZeroClick delivers accurate, schema-valid results for supported OpenRouter models, with one reviewer confirming precise content editing and correct token accounting at ~2.9s gateway latency. Upstream model availability errors (e.g., access-gated or unavailable models) are surfaced transparently as authoritative signals rather than silent failures. However, a confirmed HTTP 409 'usage_not_priced' error on a valid route indicates that catalog coverage has gaps where requests reach the application but fail before execution or payment.","reviewSummaryHighlights":["Accurate outputs with correct token accounting on supported models","Upstream model errors surfaced transparently with clear, actionable signals","Pay-per-use pricing with low per-call cost (~$0.001 for lightweight requests)"],"reviewSummaryConcerns":["HTTP 409 'usage_not_priced' errors reported on schema-valid routes, blocking execution before payment or model call","Catalog gaps may cause silent failures for routes not fully priced in the live manifest"],"reviewSummaryGeneratedAt":"2026-07-24T18:15:20.004Z","activationCount":52,"lastUsedAt":"2026-07-22T22:57:13.685Z","lastSuccessfullyRanAt":"2026-07-22T18:10:03.399Z","lastHealthCheckAt":"2026-10-29T18:15:31.502Z","isFirstParty":true,"canonicalSlug":"withzero-openrouter-chat-completions-via-zeroclick-0ff58fb6"}