cookbook/90_models/openrouter/chat.
Chat API
Chat
OpenRouter Chat API examples: basic agents, ordered model fallback, retries, structured output, and tool use.
Use OpenRouter’s Chat API to reach multiple models through one endpoint. Give an agent an ordered fallback list so a request that hits a rate limit, timeout, or overload retries on the next model.
For details, see examples in