Overview
The Portkey AI Gateway provides unified access to multi-modal capabilities across providers, allowing you to work with:- Vision: Image understanding and analysis
- Audio: Text-to-speech and speech-to-text
- Image Generation: Creating images from text prompts
- Document Analysis: PDF, CSV, and document processing
Vision (Image Understanding)
Supported Providers
- OpenAI (GPT-4o, GPT-4o-mini, GPT-4 Turbo with Vision)
- Anthropic (Claude 3.5 Sonnet, Claude 3 Opus/Sonnet/Haiku)
- Google (Gemini 1.5 Pro/Flash, Gemini 2.0 Flash)
- Azure OpenAI
- Vertex AI
- Bedrock (Claude models)
Usage
Base64 Images
You can also pass images as base64-encoded data:Multi-Provider Vision with Fallback
The Gateway automatically transforms image content formats between providers, ensuring compatibility across OpenAI, Anthropic, Google, and AWS Bedrock.
Audio
Text-to-Speech (TTS)
Supported Providers
- OpenAI (tts-1, tts-1-hd)
- Azure OpenAI
- ElevenLabs (via custom integration)
Speech-to-Text (Transcription)
Supported Providers
- OpenAI (whisper-1)
- Azure OpenAI
- Groq (whisper-large-v3)
- Deepgram (via custom integration)
Translation
Translate audio to English:Image Generation
Supported Providers
- OpenAI (DALL-E 2, DALL-E 3)
- Azure OpenAI
- Stability AI (Stable Diffusion)
- Together AI
- Segmind
- Replicate
Stability AI Example
Fallback Between Image Providers
Document Processing
Many vision models support document understanding:PDF Analysis
Supported Document Types
- PDF documents
- CSV files
- Images (JPEG, PNG, GIF, WebP)
- Spreadsheets (provider-dependent)
Multi-Modal Routing Strategies
Cost Optimization
Route to cost-effective models for simple tasks:Load Balancing for High Volume
Provider-Specific Features
OpenAI Vision Detail Levels
Anthropic PDF Support
Claude models support direct PDF processing:Best Practices
Optimize Image Sizes
Optimize Image Sizes
Resize images before sending to reduce latency and costs. Most models work well with images under 2MB.
Use Appropriate Detail Levels
Use Appropriate Detail Levels
For OpenAI models, use
detail: "low" for simple tasks and detail: "high" for complex analysis to balance cost and accuracy.Cache Multi-Modal Requests
Cache Multi-Modal Requests
Enable caching for repeated multi-modal requests to reduce costs significantly.
Handle Timeouts Appropriately
Handle Timeouts Appropriately
Multi-modal requests take longer. Set higher timeouts (30-60s) for vision and audio processing.
Test Across Providers
Test Across Providers
Different providers excel at different multi-modal tasks. Test to find the best fit for your use case.
Monitor Costs
Monitor Costs
Multi-modal requests are more expensive. Monitor usage and set up cost alerts in the Gateway dashboard.
Common Use Cases
Image Analysis
- Product catalog analysis
- Medical image interpretation
- Document OCR and extraction
- Visual quality control
Audio Processing
- Meeting transcriptions
- Podcast summaries
- Voice command processing
- Multi-language translation
Image Generation
- Marketing content creation
- Product visualization
- UI/UX mockups
- Creative artwork
Related Features
Streaming
Stream multi-modal responses
Fallbacks
Fallback between vision providers
Caching
Cache expensive multi-modal requests
Providers
Explore all supported providers