Client SDKs
Lightweight, type-safe clients for the OpenRouter API
The Client SDKs give you a thin, type-safe layer over the OpenRouter REST API. It handles authentication, request validation, and response typing so you can call any of 300+ models with a single function call — no boilerplate, no provider-specific quirks.
Install instructions
All three SDKs are auto-generated from the OpenRouter OpenAPI spec, so new models, parameters, and endpoints appear immediately after each API release.
When to use the Client SDKs
Choose the Client SDKs when you need direct, efficient access to model inference and want to manage your own application logic:
- Single-turn completions — send a prompt, get a response
- Streaming responses — real-time token-by-token output
- Embeddings, video, and rerank — generate vector representations, create videos, and rerank results
- API key and credit management — programmatic control over your account
- Custom orchestration — you handle conversation loops, tool dispatch, and state yourself
The Client SDKs are intentionally lean. It mirrors the OpenRouter API surface 1:1 with full type safety, so there is no abstraction to fight when you need fine-grained control.
If you want higher-level primitives for building agents — multi-turn loops, tool definitions, stop conditions, and conversation state management — see the Agent SDK instead.
Quick example
Client SDKs vs Agent SDK
Next steps
- TypeScript SDK reference
- Python SDK reference
- Go SDK reference
- Agent SDK overview — for building agents with multi-turn loops and tools