Install instructions
| Language | Package | Install |
|---|---|---|
| TypeScript | @openrouter/sdk | npm install @openrouter/sdk |
| Python | openrouter | pip install openrouter |
| Go | go-sdk | go get github.com/OpenRouterTeam/go-sdk |
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
Quick example
Client SDKs vs Agent SDK
| Client SDKs | Agent SDK | |
|---|---|---|
| Focus | Lean API client — mirrors the REST API with full type safety | Agentic primitives — multi-turn loops, tools, stop conditions |
| Use when | You want direct model calls and manage orchestration yourself | You want built-in agent loops, tool execution, and state management |
| Conversation state | You manage it | Managed for you via callModel |
| Tool execution | You dispatch tool calls | Automatic with the tool() helper |
| Languages | TypeScript, Python, Go | TypeScript |
Next steps
- TypeScript SDK reference
- Python SDK reference
- Go SDK reference
- Agent SDK overview — for building agents with multi-turn loops and tools