AI Gateway v2
AI Gateway v2 is a component of Stacklok Enterprise.
AI Gateway v2 is a self-hosted control point between AI clients and large language model (LLM) providers. It authenticates each caller, routes the request to the provider that serves the model, and applies identity, budget, data protection, and audit policies on the way through.
AI Gateway v2 forwards request and response bodies unchanged. Clients use the provider's own API, such as OpenAI Chat Completions, the OpenAI Responses API, Anthropic Messages, or the Gemini API, and the gateway serves each model on the APIs its provider speaks.
What you can do
- Set cost budgets for users and groups.
- Limit which models each user or group can call, and show each caller only the models they can use.
- Screen requests for prompt injection, payment card data, and personally identifiable information (PII).
- Record structured audit events and forward them to a security information and event management (SIEM) system.
- Authenticate callers with your identity provider or with virtual API keys, while provider credentials stay in the gateway.
- Export traces and metrics to an OpenTelemetry collector, attributed to the users and groups that sent the traffic.
How configuration works
You configure AI Gateway v2 through Helm values under the ai-gateway-v2 key of
the platform chart. The chart renders the values into a configuration file in a
ConfigMap and mounts provider credentials from Kubernetes Secrets.
A configuration or credential change takes effect through a pod rollout. The rollout keeps the previous pods serving until the new pods are ready, so a broken configuration never removes serving capacity. AI Gateway v2 has no custom resources and no management API.
Manage budgets in the console or through the Enterprise Manager API. See Manage budgets and Budgets and pricing.
How AI Gateway v2 relates to the AI Gateway
AI Gateway v2 and the Envoy-based AI Gateway are two implementations of the same product. They share the console, budgets, pricing, directory, and virtual API keys, but each has its own configuration. A platform runs one of them, except during a migration window. To move from the AI Gateway to AI Gateway v2, see Migrate from the AI Gateway.
Before you start
Install AI Gateway v2 before applying the examples in this section. See Configure AI Gateway v2.
Examples on these pages show values relative to the platform chart's values file
and use <NAMESPACE> for the namespace the platform is installed into and
<RELEASE_NAME> for the Helm release name. In prose, value paths are relative
to the ai-gateway-v2 key.
For the client-facing endpoints, credential headers, and error responses, see the endpoints reference.
Contents
AI Gateway v2
Govern and control access to large language model providers with a self-hosted, single-binary enterprise gateway configured through Helm.
Model providers
Connect OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, Google AI Studio, and OpenRouter to AI Gateway v2, and rotate their credentials.
Model routing
Map model names onto providers, limit which models each user or group can call, and understand retries and timeouts on AI Gateway v2.
Budgets and pricing
Cap AI Gateway v2 model spend per user or group in USD, publish a pricing catalog, and see how refused requests reach the client.
Budgets
Create and edit AI Gateway v2 group and user budgets in the console, set organization defaults, and order group budgets.
Prompt injection screening
Screen AI Gateway v2 prompts for injection attacks with AWS Bedrock Guardrails, including the monitor-to-enforce rollout, IAM setup, and cost.
PCI/PII controls
Scan prompts for credit cards, national identifiers, and other sensitive data with Presidio, and block, redact, or log what AI Gateway v2 finds.
Audit logs
Enable AI Gateway v2 audit events for model interactions and rejected sign-ins, then ship them to Splunk, Elastic, Kafka, or Loki.
Telemetry
Export AI Gateway v2 traces and metrics over OpenTelemetry or Prometheus, and attribute model traffic to the users and groups that sent it.
Migrate from AI Gateway
Move model traffic from the Envoy-based AI Gateway to AI Gateway v2, with a side-by-side window, a configuration map, and a cutover checklist.
Reference
1 item