For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Providers
Configure agentgateway for first-class, OpenAI-compatible, and self-hosted LLM providers
Learn how to configure agentgateway for a particular LLM providerProviderA service that provides LLM capabilities, such as OpenAI, Anthropic, or Azure. Agentgateway supports multiple LLM providers and can route to different providers based on configuration..
First-class providers
Use the dedicated provider pages when agentgateway already knows the upstream base URL and request format. This list includes Anthropic, OpenAI, and many more!
Custom providers
Use Custom providers only for providers that do not have a first-class shortcut, such as Perplexity, vLLM, LM Studio, or another service that exposes a compatible API format.
Authentication
For simplified llm configuration, upstream provider authentication is configured per model via llm.models[] (typically params.apiKey for API-key providers, and auth for cloud-native flows). In routing-based configurations, use policies.backendAuth on a route instead.
API key
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
llm:
models:
- name: "*"
provider: openAI
params:
apiKey: "$OPENAI_API_KEY"Use auth.key.location only when a provider needs the credential somewhere other than its default location. For example, Azure often uses api-key:
llm:
models:
- name: "*"
provider: custom
auth:
key:
value: "$API_KEY"
location:
header:
name: api-keyCredential passthrough
To forward the validated incoming JWT to the upstream provider, use passthrough:
llm:
models:
- name: "*"
provider: openAI
auth:
passthrough: {}Cloud provider auth
- Google Cloud:
auth.gcpuses Application Default Credentials (ADC) and can fetch an access token or ID token (depending on thetypeyou select). - AWS:
auth.awssigns upstream requests with SigV4 using standard AWS credentials (for example, environment variables, an instance profile, or a shared config profile). - Azure:
auth.azureuses Entra ID.auth.azure.implicituses the Azure SDK’sDefaultAzureCredentialto discover credentials automatically.
These are the default auth mechanisms for the corresponding built-in providers, so you usually only need to override them when you need custom credential handling.
llm:
models:
- name: "*"
provider: vertex
auth:
gcp:
type: accessToken
- name: "*"
provider: bedrock
auth:
aws: {}
- name: "*"
provider: azure
auth:
azure:
implicit: {}Standalone upstream TLS
Use llm.models[].tls to configure advanced TLS when connecting to an upstream provider.
When using built in providers, default TLS settings are used.
When using custom a baseUrl, the https:// scheme will automatically use TLS.
However, if you need advanced configurations such as client certificates or customized verification steps, you may set fields such as root for a trusted CA bundle, hostname and subjectAltNames for upstream identity checks, cert and key for client certificates.
OpenAI
Configuration and setup for OpenAI LLM provider
Amazon Bedrock
Configuration and setup for Amazon Bedrock provider
Anthropic
Configuration and setup for Anthropic Claude provider
Azure
Configuration and setup for Azure AI services provider
Gemini
Configuration and setup for Google Gemini provider
Ollama
Configure agentgateway to route LLM traffic to Ollama for local model inference
Vertex AI
Configuration and setup for Google Cloud Vertex AI provider
Baseten
Configuration and setup for Baseten LLM provider
Cerebras
Configuration and setup for Cerebras LLM provider
Cohere
Configuration and setup for Cohere LLM provider
DeepInfra
Configuration and setup for DeepInfra LLM provider
DeepSeek
Configuration and setup for DeepSeek LLM provider
Fireworks AI
Configuration and setup for Fireworks AI LLM provider
Groq
Configuration and setup for Groq LLM provider
Hugging Face
Configuration and setup for Hugging Face LLM provider
Mistral
Configuration and setup for Mistral LLM provider
OpenRouter
Configuration and setup for OpenRouter LLM provider
Together AI
Configuration and setup for Together AI LLM provider
xAI
Configuration and setup for xAI (Grok) LLM provider
Multiple LLM providers
Configure load balancing across multiple LLM providers.
Custom
Configure agentgateway for providers without built-in support that implement the OpenAI API format.