JavaScript/TypeScript SDK
Install the Anthropic SDK:Using Different Claude Models
Switch between different Claude models:Vision Capabilities
Use Claude’s vision capabilities with images:Streaming Responses
Stream responses for real-time output:Python SDK
Install the Anthropic Python SDK:Tool Use (Function Calling) (WIP)
Use Claude’s tool calling capabilities:Streaming with Python
Advanced Features
System Messages
Use system messages to set Claude’s behavior:Multi-turn Conversations
Handle multi-turn conversations:Structured Output
Use Claude for structured data generation:Error Handling
Handle errors gracefully:Rate Limiting
Implement rate limiting and retry logic:Best Practices
1. Optimize Token Usage
2. Use Appropriate Models
3. Implement Caching
Integration Examples
Chatbot Implementation
Document Analysis
Migration from Anthropic Direct
When migrating from Anthropic’s direct API to Electron Hub:- Change the base URL to
https://api.electronhub.ai/v1 - Update your API key to use your Electron Hub key (starts with
ek-) - No code changes needed - All parameters and responses remain the same
- Access to more models - You can also use OpenAI, Google, and other models
- Unified billing - All model usage is billed through Electron Hub
- Enhanced features - Access to additional capabilities like web search
https://playground.electronhub.ai/console.