Overview
Visca AI Gateway provides native support for the Anthropic Messages API, allowing you to use Claude models with their native format while benefiting from gateway features like routing, caching, and analytics.Endpoint
Basic Usage
Supported Models
All Claude models available:claude-3-5-sonnet-20241022(latest, recommended)claude-3-5-haiku-20241022claude-3-opus-20240229claude-3-sonnet-20240229claude-3-haiku-20240307
Streaming
Stream responses for real-time output:System Messages
Claude uses a separatesystem parameter:
Vision
Send images with Claude 3 models:Prompt Caching
Enable prompt caching to save costs on repeated content:Tool Use (Function Calling)
Define tools for Claude to use:Gateway Features
The Anthropic endpoint supports all gateway features:Routing
Request Metadata
Cost Tracking
All requests through the Anthropic endpoint are tracked in analytics with accurate cost attribution.Differences from Native Anthropic API
| Feature | Native Anthropic | Via Gateway |
|---|---|---|
| Endpoint | https://api.anthropic.com | https://gateway.visca.ai |
| API Key | Anthropic API key | Visca gateway key |
| Analytics | Limited | Full dashboard |
| Routing | Single provider | Multi-provider fallback |
| Caching | Prompt caching | + Response caching |
| Rate Limits | Anthropic limits | Configurable limits |
Best Practices
Use System Messages
Define behavior with system parameter, not in first user message
Enable Caching
Cache large system prompts and documents to reduce costs by 90%
Stream When Possible
Use streaming for better user experience on long responses
Handle Tool Use
Implement proper tool use loops for agentic workflows
Error Handling
Migration from Direct Anthropic
1
Change Base URL
Update
base_url to https://gateway.visca.ai/v12
Update API Key
Use your Visca gateway API key instead of Anthropic key
3
Test Requests
Verify all requests work as expected
4
Enable Features
Add routing, metadata, and analytics as needed