Skip to main content
OpenRouter provides access to models from OpenAI, Anthropic, Google, Meta, and more through a single API.

Setup

Basic Usage

String Shorthand

Parameters

str
required
Model identifier from the OpenRouter model list.
str
OpenRouter API key. Defaults to OPENROUTER_API_KEY.
float
Sampling temperature.
int
Maximum output tokens.

Imports