[](https://crates.io/crates/openrouter-sdk)
[](https://docs.rs/openrouter-sdk)
[](LICENSE)
[](https://github.com/zaoinc/openrouter-sdk)
The **official Rust interface** for [OpenRouter.ai](https://openrouter.ai), providing:
⚡ **Blazing fast** LLM inference with Rust's zero-cost abstractions
🔒 **Type-safe** interactions with all OpenRouter models
🌐 **Multi-modal** support (text + images)
📡 **Streaming** responses for real-time applications
```bash
cargo add openrouter-sdk
Quick Start
- Get your OpenRouter API key
- Add the dependency:
[]
= "0.1"
= { = "1.0", = ["full"] }
- Basic usage:
use ;
async
Key Features
🔄 Model Agnostic
// Works with any OpenRouter model
let models = vec!;
🖼️ Multi-Modal Support
Multi
🌊 Streaming Responses
let mut stream = client.chat_stream.await?;
while let Some = stream.next.await
Advanced Usage
Custom Configuration
let client = new
.with_base_url // For proxies
.with_timeout;
Error Handling
match client.chat.await
|
Contributing
We welcome contributions! Please see:
License
MIT © ZAO Inc.