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 OpenAI-compatible providers.
OpenAI-compatible fallback
Use OpenAI-compatible only for providers that do not have a first-class shortcut, such as Perplexity, vLLM, LM Studio, or another service that exposes the OpenAI API format.
Override the upstream base URL
When you need a custom upstream endpoint, set params.baseUrl on the model instead of older host or path override fields.
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
llm:
models:
- name: "*"
provider: openAI
auth:
key:
value: "$PERPLEXITY_API_KEY"
params:
baseUrl: "https://api.perplexity.ai"
tls: {}Authentication
For simplified llm configuration, upstream provider authentication is configured per model via llm.models[].auth. 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
auth:
key:
value: "$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: azure
auth:
key:
value: "$AZURE_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 TLS when connecting to an upstream provider. You might use this configuration to trust a private CA when using a self-hosted HTTPS endpoint. Common fields include root for a trusted CA bundle, hostname and subjectAltNames for upstream identity checks, cert and key for client certificates, and keyExchangeGroups for TLS negotiation. In agentgateway versions prior to 1.3, this model-level setting was called backendTLS.
OpenAI
Configuration and setup for OpenAI LLM provider
OpenAI-compatible providers
Configure agentgateway for providers without built-in support that implement the OpenAI API format.
Ollama
Configure agentgateway to route LLM traffic to Ollama for local model inference
Vertex AI
Configuration and setup for Google Cloud Vertex AI provider
Gemini
Configuration and setup for Google Gemini 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
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.