Stream, extract, and process the same response concurrently. No need to choose upfront.
Streaming works out of the box. Custom events and transforms without the boilerplate.
Tools run separately from model calls. Clean boundaries, no tangled logic.
Tools can modify the next request. Build complex agents as small, testable pieces.
Lightweight and modular. Small API that grows with you, no rewrites required.
Works with existing AI SDKs. Migrate incrementally with full type safety.
Get started in minutes. TypeScript and Python SDKs available now.
Build AI agents with type-safe tools, multi-turn execution, and stop conditions. Install @openrouter/agent and start building autonomous workflows.
One function to call any model. Get text, stream responses, or extract structured data from a single call.
Define tools with Zod schemas and automatic execution. Full TypeScript inference for inputs, outputs, and events.
Build agentic loops with automatic tool execution. Tools can modify the next request for complex workflows.
Control agent execution with built-in helpers: stop by step count, tool calls, cost limits, or custom logic.
Add human-in-the-loop approval gates before tool execution for safe, controlled agent behavior.
Works with AI coding assistants like Claude Code, Cursor, and Copilot via installable agent skills.
For chat completion primitives without the agent toolkit, install @openrouter/sdk directly. Auto-generated from the OpenAPI spec with full type safety.
npm i @openrouter/sdk
Add the SDK to your project. TypeScript and Python available today.
Access 300+ models through one interface. Stream, extract, or batch results.
Go from prototype to production. The same API works at any scale.