TurboClaude Rust SDK
Rust SDK for Anthropic's Claude API with support for multi-cloud providers (AWS Bedrock, Google Vertex AI), agent framework, and tool system.
Features
Supported Providers
- Anthropic (official API)
- AWS Bedrock
- Google Vertex AI
API Coverage
- Messages API with streaming
- Batch processing
- Tool use and function calling
- Structured outputs (beta) with type-safe JSON parsing
- Prompt caching
- Document and PDF analysis
- Vision capabilities
- Token counting
- Models API
Agent Framework
- Agent client and configuration
- Message hooks and interception
- Permission system
- Message routing
- Skills integration
Tools & Extensions
- Custom tool definitions
- Computer use (beta)
- Bash execution (beta)
- Web search (beta)
- Code execution (beta)
Advanced Features
- Real-time streaming
- Prompt caching for cost reduction
- Persistent memory (beta)
- Extended thinking (beta)
Quick Start
use Client;
use ;
async
Structured Outputs (Beta)
Get type-safe JSON responses that match a predefined schema:
use JsonSchema;
use ;
use ;
use models;
async
Requirements:
- Enable the
schemafeature in Cargo.toml - Use the structured outputs model:
CLAUDE_SONNET_4_5_20250929_STRUCTURED_OUTPUTS - Derive
Serialize,Deserialize, andJsonSchemafor your output type
See examples/structured_outputs.rs for more examples.
Multi-Cloud Usage
AWS Bedrock
use ;
use Arc;
let provider = new;
let client = from_provider;
// Use same client API!
Google Vertex AI
use ;
use Arc;
let provider = new;
let client = from_provider;
// Use same client API!
Features & Flags
Enable optional functionality via Cargo features:
[]
= { = "0.2", = ["bedrock", "vertex", "schema"] }
Available features:
env: Load API key from environment variables (default)bedrock: AWS Bedrock provider supportvertex: Google Vertex AI provider supportschema: JSON schema generation for toolsmcp: Model Context Protocol integrationtrace: Tracing/logging supportfull: All features except blocking
Architecture
TurboClaude is built on a modular architecture:
- turboclaude: Main SDK with multi-cloud providers
- turboclaude-transport: HTTP and subprocess transport
- turboclaude-protocol: Protocol types and messages
- turboclaude-core: Core abstractions and traits
- turboclaudeagent: Agent framework with hooks/permissions
- turboclaude-skills: Skills system for dynamic capabilities
- turboclaude-mcp: Model Context Protocol integration
Examples
Check the examples/ directory for:
basic.rs- Simple message sendingstreaming.rs- Real-time streamingtools.rs- Tool use and function callingstructured_outputs.rs- Type-safe JSON parsing (requiresschemafeature)bedrock_basic.rs- AWS Bedrock usagevertex_basic.rs- Google Vertex AI usage- And more...
Run examples with:
Testing
# Run all tests
# Run with output
# Run specific test
Documentation
- Full API documentation:
cargo doc --open - Architecture guide: See module-level documentation
- Implementation details: Check individual crate READMEs
Performance
TurboClaude is optimized for production:
- Zero-copy message handling
- Streaming support to reduce memory
- Configurable timeouts and retries
- Connection pooling via reqwest
Status
v0.1.0 - All tests passing. See main README for test results.
License
MIT/Apache-2.0
Contributing
Contributions welcome! Please see CONTRIBUTING.md (when created).
Support
For issues and feature requests, see the GitHub repository.
Part of the TurboClaude Rust Ecosystem