openai.OpenRouterClient$stream
OpenRouter's chat-completions gateway.
Reference version
Signature
class openai.OpenRouterClient$streamOpenRouter's chat-completions gateway.
A plain bearer-auth chat-completions endpoint at
https://openrouter.ai/api/v1, keyed by OPENROUTER_API_KEY. Model ids are
namespaced by upstream provider ("openai/gpt-4o-mini",
"anthropic/claude-3.5-sonnet", …).
App-attribution headers are not a special option: pass them through the
ordinary headers field —
headers = {"HTTP-Referer": "https://myapp.com", "X-Title": "My App"}.
OpenRouter-specific body fields (provider, route, transforms) go
through request_body.
Source:<builtin>/openai/openrouter.bamlbytes 0–0
Fields
model
string | nullapi_key
ai.Credential$stream | nullbase_url
ai.Credential$stream | nullrequest_body
baml.json.json$stream | nullheaders
map<string, string> | nullquery_params
map<string, string> | nulltemperature
float | nullmax_tokens
int | nulltop_p
float | nullstop
string[] | nullseed
int | nullcapture_wire
bool | null