What should an AI gateway control? Enterprise requirements and implementation paths

What should an AI gateway control? Enterprise requirements and implementation paths

One AI product can survive with an API key in the model SDK and a usage logger beside it. The operating model changes as the product count grows. The same cross-cutting code appears in many repositories, every team stores keys differently, and no two products agree on cost tags or prompt and response logging. Each new security rule triggers another round of application deployments.

An AI gateway becomes necessary not on the day a company adopts a model, but when it must manage model calls as one operating domain. A proxy in front of provider APIs is only the start. Identity, policy, cost, routing, and audit evidence must pass through the same enforcement path before the gateway becomes an enterprise control plane.

Enterprise AI gateway architecture enforcing identity, policy, cost, and routing between applications and model providers, with secret management and audit evidence
The gateway can enforce call policy, but data permissions, tool approval, and business decisions remain in the application. Central policy becomes real control only when direct provider access is closed.

Why direct calls break down at enterprise scale

Direct calls are efficient for experiments. In enterprise operations, every product recreates the same cross-cutting capabilities.

Operating symptomAccumulating riskGateway responsibilityApplication responsibility
Provider keys spread across applications, notebooks, and CIThe exposure radius grows and revocation slowsIsolate provider keys, issue identity-based short-lived access, revoke individual principalsForward business-user and service identity
Departments split cost from a month-end billOverspend appears late and allocation lacks evidenceAttach user, team, and project tags; enforce spend, rate, and token limitsConnect spend to a business outcome and owner
Every product builds its own logs, dashboard, and billing logicMetrics mean different things, blocking comparison and incident analysisProvide shared traces and measure latency, tokens, and cost for each model attemptMeasure final task success, quality, and user impact
Guardrails and model allowlists live in application codePolicy changes move slowly and exceptions lingerInspect inputs and outputs; enforce model and region policy; audit policy versionsEnforce data permissions, approve tool execution, validate business output
One provider incident becomes a product incidentRetry storms and provider dependence growApply timeouts, bounded retries, fallbacks, and circuit breakersProve that an alternate model still meets quality requirements

Centralizing keys does not finish the key-management problem. If an application can call a provider without the gateway, attackers and insiders can bypass every central policy. IAM, network egress, and provider organization policy must close the direct route together. The short-lived credentials and model and region restrictions in our Bedrock credential exposure and LLMjacking guide belong at this boundary.

At customer A, keys grew faster than projects

Customer A uses the public LLM APIs of OpenAI, Google Gemini, and Anthropic across internal AX projects. Each project initially obtained the provider keys it needed. As the project portfolio grew, the operating model reached its limit: create another key, record its owner, revoke keys for closed projects, and divide the provider bill. The organization could no longer manage keys at the speed teams could call models.

The customer is building a LiteLLM-based AI gateway to bring those AX projects onto one model-access path. The objective is larger than replacing several provider SDKs with one interface. Provider keys must leave applications, each project needs its own virtual key or workload identity, and the same control plane must operate model allowlists, usage limits, and logging fields.

Integration targetDirect calls by projectGateway transition criterion
Provider credentialsStore provider keys in application environment variables and CI secretsKeep provider keys only in the gateway secret store and never expose them to applications
Project accessShare a provider key within a team or issue another oneIssue and revoke virtual keys or workload identities by project and environment
Model policySet model, region, and max_tokens in each codebaseVersion model, region, token, rate, and budget policy centrally
Cost attributionReclassify each provider bill at month endAttach organization, project, environment, and workload to every logical request
Project closureLocate every key use and revoke it at each providerRevoke the virtual key and route first; rotate provider credentials independently

Moving existing keys behind a gateway does not complete the integration. Inventory current keys and callers first, migrate applications to virtual keys, then reject direct calls through network and provider policy. Without that final step, the old key path remains beside the new gateway.

Write enterprise requirements as six contracts

Copying a product feature list into an RFP gives every candidate a similar page of checkmarks. A stronger contract defines what happens when a control fails and what evidence must remain.

Control domainMinimum requirementAcceptance-test question
Identity and secretsOIDC/SSO and workload identity, short-lived virtual keys, external Vault or KMS references, individual revocationWhen a person or service is revoked, can the company block only that principal within minutes without rotating the provider key?
Tenancy and costOrganization, department, and project isolation; attribution tags; request, token, and spend limits; alerts and suspensionDoes the cost of every actual provider call, including retries and fallbacks, roll up to one business request?
Policy and guardrailsModel and region allowlists, input and output inspection, PII treatment, policy-version and exception auditCan operators separate block, mask, and observe-only modes and identify who changed the policy?
Routing and reliabilityTimeouts, bounded retries, fallbacks, load balancing, circuit breakers, idempotency signalsUnder 429s, 5xx errors, latency, and partial responses, does the service degrade through the approved path without duplicate execution?
Observability and auditSeparate logical requests from provider attempts; trace token, TTFT, cache-hit, and policy results; export telemetryCan operators analyze cost and incidents without prompt bodies, then enable content capture only when approved?
Platform operationsFault isolation between control and data planes, HA and DR, supply-chain validation, upgrade and rollbackWhen the database, cache, or control plane fails, which controls fail open and which fail closed?

The NIST Generative AI Profile recommends inventorying third parties that can access organizational content and continually assessing approved providers and both commercial and open-source components.1 A gateway can enforce and record that supply chain. It cannot create the accountability structure that NIST expects.

The OWASP 2025 LLM risks show the same boundary. Gateway rate and token limits reduce Unbounded Consumption, while PII inspection and logging policy reduce Sensitive Information Disclosure. Prompt Injection, Improper Output Handling, and Excessive Agency also require application-level data permissions and tool design.2

Working on something similar?Request a technical review

A cost limit is a real-time brake, not the invoice

Gateway cost is usually an estimate derived from the model name, input and output tokens, and a price table. The provider bill also reflects provisioned throughput, cached tokens, batch discounts, region, and negotiated rates. Use the real-time limit as a circuit breaker against overspend, then reconcile it with provider billing data at financial close.

In the linked LiteLLM test, a key with a $0.5 budget was blocked after usage reached $0.607. The limit evaluated accumulated spend when the request arrived, so in-flight work produced the overage.3 Claude Apps Gateway likewise states that Spend Limits are list-price estimates rather than invoices. The requirement is not simply “has a budget feature.” It is the acceptable overage, refresh interval, concurrent-request behavior, and variance from the provider bill.4

Define the attribution grain before implementation. User-only attribution cannot explain background jobs. API-key-only attribution cannot separate many functions sharing one key. Showback and chargeback need at least organization, department, project, environment, application, user or workload, model, and logical request.

Bedrock credential theft is a gateway failure test

The incident in our Bedrock credential exposure and LLMjacking guide began with stolen AWS credentials that had InvokeModel permission. The attacker created no new resources and shifted model-API spend to the victim account. An AI gateway does not erase that attack automatically. If stolen credentials can call Bedrock directly, the traffic bypasses gateway authentication, budgets, and logs.

Reducing the blast radius starts with changing the access path.

Attack pointBefore a gatewayPreventive boundary including the gateway
Credential exposureDevelopers and applications hold Bedrock API keys or IAM access keysOnly the gateway runtime calls Bedrock with an IAM role and short-lived STS credentials
Direct-call bypassAny key with InvokeModel permission can call from any pathIAM, SCP, and VPC endpoint policy deny InvokeModel except from the approved gateway role
Spend accelerationCalls continue until account and regional quotas are exhaustedEnforce RPM, TPM, spend, and max_tokens limits per workload, plus model and region allowlists
Delayed detectionReview usage after CloudTrail and billing data accumulateSeparate logical requests from provider attempts and alert on abnormal token and call volume in real time
Containment and revocationLocate and rotate the provider credential globallyRevoke the suspect virtual key or workload first, then rotate upstream credentials separately
Financial backstopDepend on the month-end billPlace AWS Budgets and Cost Anomaly Detection behind real-time gateway limits as delayed backstops

The gateway runtime's IAM role becomes a high-value target. Limit that role to required models, regions, and actions, and separate credentials for development, staging, and production. Design for a gateway compromise by separating secret-read, policy-change, and invocation authority. Before release, test whether a Bedrock call that bypasses the gateway is rejected and whether revoking one virtual key leaves other projects running.

Judge observability by traceability, not captured content volume

When every AI product implements observability and billing independently, even “request count” loses a common meaning. One product counts user requests; another counts every retry and fallback. A gateway should separate the user-facing logical request from each actual provider attempt. That distinction puts success rate, cost, and fallback ratio into one interpretable flow.

OpenTelemetry's GenAI semantic conventions define shared attributes such as operation, provider, requested and response model, and input and output tokens. Prompts, responses, and tool arguments are sensitive and potentially large, so content capture is opt-in rather than the default.5 A safer operating baseline is metrics-only, with content enabled only for approved use cases and a limited retention window.

A semantic cache is both a cost feature and a data-isolation feature. If tenant, permission, model, system prompt, or policy version is absent from the cache key, one user can receive another tenant's answer or an answer produced under an old policy. Define exclusions first for sensitive questions, time-dependent answers, and tool-execution results.

A Claude-specific gateway and an enterprise AI gateway have different scopes

Claude Apps Gateway is not a bad product; it has a clearly bounded job. It fits organizations deploying Claude Code and Claude Desktop internally while enforcing OIDC sign-in, managed settings, user and group spend caps, and OTLP telemetry. With Bedrock upstream, provider credentials do not need to reside on developer machines.4

That scope is too narrow to define an enterprise AI gateway. Its center is Claude client policy, not a general service plane for OpenAI-compatible APIs, multiple model providers, centrally operated prompts and guardrails, and non-interactive workloads. Developers with separate AWS credentials may also call Bedrock directly. Deploying the gateway alone does not close the bypass.

An MCP gateway is another boundary. An AI gateway governs model-inference calls. An MCP gateway handles tool discovery, tool authorization, and protocol routing. Agentic systems may need both. Our MCP and AgentCore state and authorization boundary guide explains why treating them as one product obscures the design.

Compare four adoption paths with the same questions

PathBest-fit conditionsWhat it providesWhat to contract and test
Claude Apps GatewayPrivate-network Claude Code and Desktop with BedrockOIDC, client policy, user and group caps, OTLPClaude-specific scope, no admin UI, non-interactive workloads, enforcement mode during database errors, blocked direct AWS access
Self-managed LiteLLMStrong data sovereignty, custom policy, capable platform teamMulti-provider API, virtual keys and budgets, flexible storage and telemetryPostgreSQL, Redis, and HA operations; licensing for SSO and advanced permissions; supply-chain patching; policy UI and support SLA
Portkey EnterpriseA company needs to standardize many providers quickly without building its own control planeOrganization and workspace RBAC, SSO, budgets and rate limits, routing, guardrails, logs, and analyticsActual data path in SaaS, hybrid, and air-gapped modes; commercial licensing; control-plane loss; configuration export; exit plan
AI extensions to an existing APIMStandard API operations such as Kong are mature and AI-specific needs are limitedExisting authentication, WAF, developer portal, and operating processGaps in token cost and model-attempt metrics, prompt and response policy, semantic caching, and per-model fallback

AWS's Multi-Provider Generative AI Gateway Guidance places CloudFront, WAF, and ALB in front of LiteLLM, then adds RDS, Redis, Secrets Manager, and S3. It exposes Bedrock and external providers through an OpenAI-style interface.6 The important pattern is not the AWS resource list. It is the separation of ingress, stateless data plane, policy store, secret store, and evidence sink.

What to verify when evaluating Portkey

Portkey cannot be reduced to “SaaS weakens data sovereignty” or “the gateway is open source, therefore everything is self-hosted.” Its official enterprise documentation separates Portkey-managed SaaS, hybrid deployment with the data plane in the customer's VPC, and air-gapped deployment of all components.7

In hybrid mode, the gateway that processes prompts and responses runs in the customer's environment. The log store can run there or in Portkey Cloud. Portkey operates the control plane containing the management UI and configuration, while the data plane periodically synchronizes policies, keys, and provider configuration. A strict no-egress requirement points to air-gapped deployment rather than hybrid. Provider secrets can also remain in AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault while the control plane stores only references.8

Evaluate Portkey against the other candidates by checking four points.

  • Does the company have several model providers and AI products and need one UI and API for team-level policy and cost?
  • Does rapid access to SSO, RBAC, audit, versioned prompts and configuration, and guardrail operations matter more than owning the gateway engine?
  • Can security requirements be matched to a commercially supported SaaS, hybrid, or air-gapped deployment?
  • Will a named owner operate the gateway as a shared platform rather than another product?

A self-managed LiteLLM stack is more natural when the company must own the control plane, deeply modify the policy engine, and has a platform team prepared to run databases, caches, telemetry, and upgrades. If the actual scope is limited to internal Claude Code deployment, Claude Apps Gateway is the smaller and more precise answer.

If Portkey remains a candidate, its proof of concept should leave six points in the contract and test record rather than merely demonstrate its screens.

  1. Storage location and egress for prompts, responses, traces, aggregate metrics, configuration, and secret references in each deployment mode.
  2. Per-feature fail-open or fail-closed behavior when the control plane, cache, or log store is unavailable, plus the validity period of the last known good configuration.
  3. Licensing boundaries for SSO, organization and workspace RBAC, audit logs, budgets, and guardrails.
  4. Provider-price updates, custom pricing, billing reconciliation, and budget behavior for in-flight requests.
  5. Export formats for configuration, prompts, and logs; API compatibility and termination procedure for a move to another gateway.
  6. Image provenance, CVE response, upgrade and rollback, support hours, and SLA.

Roll out in the order of observe, enforce, and make default

Start by inventorying every provider call and key. Record owner, environment, data classification, provider, model, authentication method, monthly usage, and existing logging and guardrails rather than product name alone. Build the NIST-recommended list of approved providers and third parties at the same time.

Next, insert the gateway in observe mode. Compare it with direct-call results while measuring user and workload attribution, logical requests and provider attempts, cost-estimation variance, and added latency. First prove that operators can answer production questions without content logging.

Move identity and secrets before stricter policy. Remove provider root keys from applications, then apply short-lived access and tenant policy. Run budgets and guardrails in alert-only mode to measure false positives and overage before blocking. Do not enable a fallback merely because it returns an answer. The alternate model must pass a quality regression test.

Finally, close direct provider access in network and IAM policy and make the gateway the default path. Pass the following failure tests.

Failure testPassing evidence
Revoke a user or workloadOnly that principal is blocked within the specified time, without rotating the provider key
Reach budget during concurrent requestsMaximum overage and block timing are documented and reconciled with the provider bill
Receive 429, 5xx, or timeoutThe request moves to an approved path without a retry storm or duplicate business action
Disconnect the control plane, database, or cachePer-policy fail-open and fail-closed behavior matches the design and leaves an audit event
Ask the same question across tenantsCaches and logs do not mix; permissions and policy versions affect the key
Attempt to bypass the gatewayNetwork, IAM, or provider policy rejects the call and produces a security alert
Disable content loggingTokens, latency, cost, and policy results still support operating analysis

This sequence applies the observability, cost-limit, and rollback evidence in our six gates from AI PoC to production to a shared platform.

The goal is one accountability system, not one pipe

The enterprise AI gateway's goal is not a polished dashboard containing every AI request. The organization must explain who used which model under which policy, how much it cost, what was blocked on failure, and where traffic moved.

A self-managed LiteLLM build, Portkey Enterprise, and Claude Apps Gateway are different answers. Data sovereignty, control-plane ownership, provider diversity, operating capability, and deployment speed change the choice. If the company never tests direct-call bypass, billing reconciliation, log privacy, cache isolation, and fail-open or fail-closed behavior, centralization becomes a new single point of failure rather than control.


We design AI gateway identity, network, and high-availability architecture through Cloud & Infrastructure, and model policy, guardrails, evaluation, and departmental operating models through AX Consulting.

References

Sources & notes8ExpandCollapse

Footnotes

  1. NIST, Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, NIST AI 600-1. We used its recommendations for third-party and provider inventories, supply-chain assessment, continuous monitoring, and incident response.

  2. OWASP GenAI Security Project, 2025 Top 10 Risk & Mitigations for LLMs and Gen AI Apps. The control boundaries draw on Prompt Injection, Sensitive Information Disclosure, Improper Output Handling, Excessive Agency, and Unbounded Consumption.

  3. Hikotty, Testing the AWS LiteLLM AI Gateway implementation with Claude Code, 2026-07-23. The article covers multi-model calls, virtual keys, budget-limit overage, the admin UI, and SSO boundaries.

  4. Hikotty, A field report on deploying Claude Apps Gateway for Amazon Bedrock, 2026-07-20. The article tests OIDC, Spend Limits, OTLP, private-network requirements, and operating constraints. 2

  5. OpenTelemetry, Semantic conventions for generative AI metrics and GenAI observability. We used the common operation, provider, model, and token attributes and the content opt-in principle.

  6. AWS, Guidance for Multi-Provider Generative AI Gateway on AWS. A reference architecture separating LiteLLM, WAF and ALB, ECS or EKS, RDS, Redis, Secrets Manager, and S3.

  7. Portkey, Enterprise Architecture and Enterprise Offering. We checked managed, hybrid, and air-gapped deployment, data and control plane separation, RBAC, SSO, budgets, guardrails, and audit.

  8. Portkey, Secret References, Budget and Rate Limits, and Organization Guardrails. We checked external secret-manager references and organization-level cost and guardrail enforcement.

Explore the delivery service behind this topic.

Cloud & Infrastructure AX Consulting

Put this work into practice.

An engineer reviews your environment and constraints first, then uses a 30-minute technical conversation when it helps define the execution scope.

Already trusted by teams across finance · healthcare · media · public
Request a technical review