Skip to main content

Overview

The Portkey AI Gateway uses provider-specific headers for authentication. You provide your API keys for the AI providers you want to use via HTTP headers.

Provider Headers

Authentication is handled through HTTP headers that specify the provider and API key:

Basic Authentication

string
required
The AI provider to use (e.g., openai, anthropic, azure-openai, google)
string
required
Your API key for the specified provider

Example: OpenAI

Example: Anthropic

Azure OpenAI Headers

Azure OpenAI requires additional headers:
string
required
Set to azure-openai
string
required
Your Azure OpenAI API key
string
required
Your Azure resource name
string
required
Your Azure deployment ID
string
API version (defaults to latest)

Config-Based Authentication

You can also pass authentication via the config header:
string
JSON string containing provider and authentication details

Virtual Keys

Virtual keys are available in the hosted and enterprise versions of Portkey.
Instead of passing provider API keys directly, you can use virtual keys:

Supported Providers

The gateway supports authentication for 45+ providers including:
  • openai - OpenAI
  • anthropic - Anthropic
  • azure-openai - Azure OpenAI
  • google - Google Gemini
  • bedrock - AWS Bedrock
  • cohere - Cohere
  • mistral - Mistral AI
  • together-ai - Together AI
  • anyscale - Anyscale
  • perplexity - Perplexity
  • groq - Groq
  • ollama - Ollama
See the Providers documentation for the complete list.