Base URL:
https://ai.megallm.io for all Anthropic-compatible endpointsAvailable Endpoints
Messages
Create conversational messages with Claude models
Function Calling
Enable Claude to interact with external tools and functions
Quick Example
Supported Models
Features
Advanced Reasoning
Claude’s sophisticated reasoning capabilities for complex tasks.Large Context Window
Process up to 200K tokens for extensive document analysis.Tool Use
Native support for function calling and tool integration.Vision Capabilities
Analyze images and visual content alongside text.SDK Support
MegaLLM works with Anthropic-compatible SDKs:- Python:
anthropicofficial SDK - TypeScript/JavaScript:
@anthropic-ai/sdk - Go: Community SDKs
- Ruby:
anthropic-rb
Key Differences from OpenAI
Message Format
Anthropic uses a slightly different message format:Response Format
Tool Use Format
Migration Guide
Migrating from Anthropic to MegaLLM:Authentication
Use thex-api-key header for Anthropic format:
Rate Limits
Error Handling
MegaLLM returns Anthropic-compatible error responses:Advanced Features
Conversation History
Maintain context across multiple turns:Temperature and Sampling
Control response creativity:Use Cases
Document Analysis
Code Review
Best Practices
- Use System Prompts: Claude responds well to clear system instructions
- Leverage Context Window: Take advantage of the 200K token context for large documents
- Structured Prompts: Use clear formatting and numbered lists for complex requests
- Temperature Settings: Use lower temperatures (0-0.3) for factual tasks
- Model Selection: Choose Opus for complex reasoning, Sonnet for balance, Haiku for speed
Next Steps
- Explore Messages API for conversational AI
- Learn about Function Calling for tool use
- Implement Streaming for real-time responses

