This feature is available on all Portkey plans.
Portkey Follows OpenAI Spec
Portkey API is powered by its battle-tested open-source AI Gateway, which converts all incoming requests to the OpenAI signature and returns OpenAI-compliant responses.Switching Providers is a Breeze
Integrating Local or Private Models
Portkey can also route to and observe your locally or privately hosted LLMs, as long as the model is compliant with one of the 15+ providers supported by Portkey and the URL is exposed publicly. Simply specify thecustom_host
parameter along with the provider
name, and Portkey will handle the communication with your local model.
Note:When using
custom_host
, include the version identifier (e.g., /v1
) in the URL. Portkey will append the actual endpoint path (/chat/completions
, /completions
, or /embeddings
) automatically. (For Ollama models, this works differently. Check here)Powerful Routing and Fallback Strategies
With Portkey you can implement sophisticated routing and fallback strategies. Route requests to different providers based on various criteria, loadbalance them, set up retries or fallbacks to alternative models in case of failures or resource constraints. Here’s an example config where we set up a fallback from OpenAI to a locally hosted Llama3 on Ollama:Using the Anthropic’s /messages Route
Access models on Anthropic, Bedrock and Vertex AI through Anthropic’s native/messages
endpoint using Portkey’s SDK or Anthropic’s SDK.
This route only works with Claude models on Anthropic, Bedrock and Vertex AI. For other models, use the standard OpenAI compliant endpoint.
Multimodality
Portkey integrates with multimodal models through the same unified API and supports vision, audio, image generation, and more capabilities across providers. Multimodal CapabilitiesSupported Endpoints
Portkey’s Universal API supports a comprehensive range of endpoints across all major AI capabilities. Each endpoint follows the OpenAI specification while working seamlessly with 15+ providers.Not all providers support every endpoint. Check our provider compatibility matrix to see which endpoints are available for each provider.
Core Endpoints
- Chat Completions - An OpenAI compatible unified endpoint for generating responses with support for streaming, function calling, and multi-modal inputs across providers 50+ providers like OpenAI, Anthropic, Vertex AI, Bedrock, and more
- Responses - An OpenAI compatible unified endpoint for generating responses with support for OpenAI models exclusively on responses API
- Messages - An Anthropic-compatible unified endpoint for generating responses with support for streaming, function calling, and multi-modal inputs across providers like Anthropic, Vertex AI, Bedrock, and more.
- Images - Generate, edit, and create variations of images using models like DALL-E, Stable Diffusion, and others
- Audio - Convert speech to text (transcription) and text to speech across multiple languages
Advanced Capabilities
- Fine-tuning - Customize models on your specific datasets
- Batch Processing - Process large volumes of requests efficiently
- Files - Upload and manage files for fine-tuning and batch operations
- Moderations - Check content for safety and compliance
Additional Endpoints
- Gateway to other APIs - Gateway to other APIs
- Assistants - OpenAI assistants with persistent threads and file handling
- Completions - Legacy text completion endpoint for backward compatibility