AI Gateway
The AI Gateway gives your clients one OpenAI-compatible endpoint for large language models, with the same clients, profiles, audit trail and role model as the API Gateway. You decide which models exist, which providers serve them, what happens when a provider fails, what may be sent in a prompt and how much each client may spend.
It is a separate capability from the API Gateway: it has its own section in the management UI (AI Gateway), its own endpoint (/llm by default) and its own logs. Access is still granted on Clients and Profiles.
What you configure
| Screen | What it holds |
|---|---|
| Providers | Connections to OpenAI, Anthropic, Azure OpenAI, Gemini, Groq, OpenRouter, Ollama or any OpenAI-compatible server. API keys live in Credentials. |
| Models | The model names clients call, where each routes (deployments), the routing strategy, fallback, context rules, guardrail profile, logging and pricing. |
| Guardrails | Personal data masking or blocking, blocked patterns, prompt size limits and external connectors (Presidio, Lakera, Azure AI Content Safety, OpenAI moderation, webhooks, Zerq workflows), with a test panel. |
| AI Budgets | Token, request, concurrency and spend limits you attach to clients, and alert webhooks. |
| Spend | Cost by client, model, profile or provider with CSV export, and live budget meters per client. |
| Playground | Chat with any model through the full pipeline. |
| AI Logs and Overview | Every request with tokens, cost, latency, fallbacks and guardrail actions; usage charts. |
| Settings | Kill switch, default guardrail profile, default logging, request size limit, budget alert webhook, the AI log retention in effect (read-only) and the Langfuse exporter. AI metrics, traces and log streaming use the platform's monitoring. |
Request flow
Getting started
- Add a provider under AI Gateway › Providers. Store its API key as a Credential of type API key first, then pick it. Use Test to check the connection.
- Create a model under AI Gateway › Models: give it the name clients will send (for example
gpt-4oorchat-default) and add one or more deployments. - Grant models to a client: edit the client and tick models (or a tag, or All models) in the AI Gateway section. Optionally attach an AI budget and a default model.
- Turn on AI for a profile: edit the profile and switch on AI access. Optionally limit it to a subset of the client's models and set a token cap.
- Issue an AI key from the profile's AI key button and point an OpenAI SDK at
https://<gateway>/llm/v1. See Access and AI keys.
The Overview page shows a checklist of these steps until the first request is served.
Roles
| Action | Role |
|---|---|
| View providers, models, guardrails, budgets, settings, AI logs and usage | Viewer |
| Create, edit and delete AI configuration; test providers; use the Playground; issue and revoke AI keys | Modifier |
| Delete AI log entries | Admin |
All AI configuration changes and AI key operations are recorded in Audit Logs. AI keys are never returned after they are issued.
Server settings
| Variable | Default | Meaning |
|---|---|---|
LLM_GATEWAY_ENABLED | true | Mounts the model API. When false, the management screens still work but no model traffic is served. |
LLM_GATEWAY_PATH | /llm | Path prefix of the model API. Must not be /, under /api, or the same as MCP_PATH. |
AI Gateway metrics are served on the platform's METRICS_ADDR listener and AI requests are traced with OTEL_EXPORTER_OTLP_ENDPOINT; see Observability.
The Serve model requests switch under AI Gateway › Settings stops all model traffic immediately (clients receive 503 gateway_disabled) without a restart.