quantum-sdk
Rust client SDK for the Quantum AI API.
Quick Start
use Client;
async
Features
- 110+ endpoints across 10 AI providers and 45+ models
- Async/await with Tokio runtime
- Streaming via
ChatStreamwith SSE parsing - Strongly typed request/response structs
- Agent orchestration with SSE event streams
- GPU/CPU compute rental
- Batch processing (50% discount)
- Zero-copy deserialization with serde
Examples
Chat Completion
use ;
let client = new;
let response = client.chat_request.await?;
println!;
Streaming
use ;
use StreamExt;
let client = new;
let mut stream = client.chat_stream.await?;
while let Some = stream.next.await
Image Generation
let images = client.generate_image.await?;
for image in &images.images
Text-to-Speech
let audio = client.speak.await?;
println!;
Web Search
let results = client.web_search.await?;
for result in &results.results
Agent Orchestration
use StreamExt;
let mut stream = client.agent_run.await?;
while let Some = stream.next.await
All Endpoints
| Category | Endpoints | Description |
|---|---|---|
| Chat | 2 | Text generation + session chat |
| Agent | 2 | Multi-step orchestration + missions |
| Images | 2 | Generation + editing |
| Video | 7 | Generation, studio, translation, avatars |
| Audio | 13 | TTS, STT, music, dialogue, dubbing, voice design |
| Voices | 5 | Clone, list, delete, library, design |
| Embeddings | 1 | Text embeddings |
| RAG | 4 | Vertex AI + SurrealDB search |
| Documents | 3 | Extract, chunk, process |
| Search | 3 | Web search, context, answers |
| Scanner | 11 | Code scanning, type queries, diffs |
| Scraper | 2 | Doc scraping + screenshots |
| Jobs | 3 | Async job management |
| Compute | 7 | GPU/CPU rental |
| Keys | 3 | API key management |
| Account | 3 | Balance, usage, summary |
| Credits | 6 | Packs, tiers, lifetime, purchase |
| Batch | 4 | 50% discount batch processing |
| Realtime | 3 | Voice sessions |
| Models | 2 | Model list + pricing |
Authentication
Pass your API key when creating the client:
let client = new;
The SDK sends it as the X-API-Key header. Both qai_... (primary) and qai_k_... (scoped) keys are supported. You can also use Authorization: Bearer <key>.
Get your API key at cosmicduck.dev.
Pricing
See api.quantumencoding.ai/pricing for current rates.
The Lifetime tier offers 0% margin at-cost pricing via a one-time payment.
Other SDKs
All SDKs are at v0.4.0 with type parity verified by scanner.
| Language | Package | Install |
|---|---|---|
| Rust | quantum-sdk | cargo add quantum-sdk |
| Go | quantum-sdk | go get github.com/quantum-encoding/quantum-sdk |
| TypeScript | @quantum-encoding/quantum-sdk | npm i @quantum-encoding/quantum-sdk |
| Python | quantum-sdk | pip install quantum-sdk |
| Swift | QuantumSDK | Swift Package Manager |
| Kotlin | quantum-sdk | Gradle dependency |
MCP server: npx @quantum-encoding/ai-conductor-mcp
API Reference
- Interactive docs: api.quantumencoding.ai/docs
- OpenAPI spec: api.quantumencoding.ai/openapi.yaml
- LLM context: api.quantumencoding.ai/llms.txt
License
MIT