Skip to main content

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​

ScreenWhat it holds
ProvidersConnections to OpenAI, Anthropic, Azure OpenAI, Gemini, Groq, OpenRouter, Ollama or any OpenAI-compatible server. API keys live in Credentials.
ModelsThe model names clients call, where each routes (deployments), the routing strategy, fallback, context rules, guardrail profile, logging and pricing.
GuardrailsPersonal 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 BudgetsToken, request, concurrency and spend limits you attach to clients, and alert webhooks.
SpendCost by client, model, profile or provider with CSV export, and live budget meters per client.
PlaygroundChat with any model through the full pipeline.
AI Logs and OverviewEvery request with tokens, cost, latency, fallbacks and guardrail actions; usage charts.
SettingsKill 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​

  1. 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.
  2. Create a model under AI Gateway › Models: give it the name clients will send (for example gpt-4o or chat-default) and add one or more deployments.
  3. 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.
  4. 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.
  5. 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​

ActionRole
View providers, models, guardrails, budgets, settings, AI logs and usageViewer
Create, edit and delete AI configuration; test providers; use the Playground; issue and revoke AI keysModifier
Delete AI log entriesAdmin

All AI configuration changes and AI key operations are recorded in Audit Logs. AI keys are never returned after they are issued.

Server settings​

VariableDefaultMeaning
LLM_GATEWAY_ENABLEDtrueMounts the model API. When false, the management screens still work but no model traffic is served.
LLM_GATEWAY_PATH/llmPath 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.