stream: true for Server-Sent Events.
Model id with provider prefix, e.g.
anthropic/claude-sonnet-4.6, openai/gpt-5.2.OpenAI-style chat messages:
[{ role, content }]. Either messages or prompt is required.Plain-text prompt (alternative to
messages).Optional fallback chain — OpenRouter tries these in order if earlier models are unavailable.
OpenRouter provider routing preferences (
order, only, ignore, sort, allow_fallbacks, data_collection, …).Stream the response as SSE. The final chunk carries the
usage (incl. cost).Sampling temperature (0–2).
top_p, max_tokens, stop, seed, tools, tool_choice, response_format, etc. are also forwarded.usage.cost × markup (see Credits). Charged after completion (after the final SSE chunk for streams).
Prefer to keep your existing OpenAI/OpenRouter SDK? Point its
baseURL at
https://api.usenaive.ai/v1/proxy/openrouter and authenticate with your Naive
api key — a transparent, drop-in passthrough. See
Use Naive instead of OpenRouter.