AI Gateway for Private Infrastructure: Model Selection, API Routing, Usage Metering and GPU Capacity
An AI gateway on private GPUs needs to know which GPU servers, or nodes, have free memory before it sends a request. The gateway sits between applications and AI models and does four jobs: model selection, API routing, usage metering and GPU-capacity awareness.
AI gateway explainers from API-gateway vendors such as Tyk route requests on cost, latency and provider uptime. Those guides skip GPU capacity, because the vendor handles it for a rented API.
Audit a stack against the four jobs to find the missing layer. Start with capacity awareness, because gateways built for vendor APIs leave that job to the vendor.
TL;DR: A plain API gateway with a large language model (LLM) plugin can serve a stack that calls vendor APIs. Once a route points at company-owned GPUs, the AI gateway needs live cluster data, such as free GPU memory and queue depth, before it sends the request.
What an AI Gateway Controls
An AI gateway is the software between applications and models. It picks the model for each request, picks the endpoint that serves it, records usage and checks who can call each model.
We split that work into four jobs:
- Model selection: picks the model for a request, from a self-hosted model or a vendor API.
- API routing and failover: picks the endpoint and the next target when that endpoint fails.
- Usage metering: records which team or customer used what, and what it cost.
- GPU-capacity awareness: checks the cluster's free GPU memory and queue before the gateway routes a request.
| Gateway job | Live input it reads |
|---|---|
| Model selection | Where each model runs and its cost |
| API routing and failover | Endpoint health and latency |
| Usage metering | Tokens, requests and GPU-hours per team |
| GPU-capacity awareness | Free GPU memory, running jobs and network health |
The first three jobs work the same way for rented and owned backends. On owned GPUs, the gateway handles the fourth itself, because a vendor's service-level agreement (SLA) doesn't cover a company's own hardware.

AI Gateway vs API Gateway on Self-Hosted Models
Tyk's AI gateway explainer describes the category through request routing, authentication, policy enforcement, monitoring and observability, multi-model integration and cost management. That list reflects one vendor's view of its own product category.
The two gateway types differ most in how they handle failures on owned GPUs. The table below sets out our own reasoning on how each backend fails:
| Failure event | Vendor-API backend | Self-hosted backend |
|---|---|---|
| Backend unavailable | The vendor has an outage | A GPU is busy, out of memory or cut off by a network fault |
| Partial failure | The API answers or it fails | A node fits a small request and rejects a large one |
| Capacity | The vendor's SLA covers it | The cluster scheduler, which the gateway has to query |
| Cost of a bad routing decision | One failed request, retried | Queued work and jobs stopped mid-run |
Model Selection in an AI Gateway: Self-Hosted Model or Commercial API?
On private infrastructure, the AI gateway checks free capacity before model capability.
Companies build a GPU cluster because one GPU runs short of memory for large models. The gateway can pick a self-hosted model while the cluster has memory free for that model.
Mixed fleets can use a four-step selection rule:
- Classify the request: sort it as latency-critical, batch or cost-tolerant, which narrows the candidate models before routing.
- Check capability fit: proprietary models run on the vendor's side, and a company's fine-tuned models, retrained on its own data, run on its own GPUs.
- Check live capacity: confirm the cluster can serve this request size without stopping running work. When memory runs short, send the request to the API or a queue.
- Apply the economics: Zettabyte's H100 rent-vs-buy analysis puts the break-even for buying at roughly 18 months or more of continuous use. Until a company's GPUs stay that busy, sending overflow to a commercial API can cost less than buying more GPUs.

AI Gateway Failover When the Fallback Target Is an Owned Cluster
TrueFoundry's generative AI gateway checklist covers multi-model routing, intelligent fallback, prompt caching, guardrails (filters on model inputs and outputs), RBAC (role-based access control), observability, rate limiting, cost tracking, audit logs and deployment flexibility. Its routing items work for vendor and self-hosted backends.
On owned GPUs, a fallback target can be another node in the same cluster, a second GPU fleet on the same network or a commercial API when the cluster runs out of room.

The gateway has to see and reach each of those targets, so routing depends on the network that links the GPUs. zFABRIC, our network for GPU clusters, connects mixed GPU and accelerator types over standard Ethernet, so failover can move work to a different hardware generation.
Three failover patterns work differently on private infrastructure:
- A second vendor API: the default for a SaaS deployment, and on owned GPUs a way to absorb burst traffic at per-token prices when the cluster runs out of room.
- Another node in the same cluster: the default on owned GPUs, which works when the gateway knows each node's free capacity.
- Queue and retry: protects running jobs on owned GPUs, at the cost of a longer wait for the user.
Usage Metering in an AI Gateway: Billing Customers or Charging Back Internal Teams
On owned GPUs, metering starts from the company's own costs. A gateway built for SaaS counts tokens and multiplies them by the vendor's published price.
Owned GPUs come without a published price. Their cost includes depreciation, power, staff and the GPU time one team takes from another.
| Metering question | Vendor-API backend | Owned-GPU backend |
|---|---|---|
| Unit of use | Tokens or requests | Tokens, requests, GPU-hours or reserved time |
| Price per unit | The vendor's list price | A rate built from the company's cost and utilization |
| Who gets charged | An API key or workspace | A team or customer tied to cluster resources |
| Purpose of the number | Paying the vendor's bill | Internal chargeback or customer billing |
The owned-GPU column needs cluster software that meters use, bills it, controls access and separates each customer's work. zPLATFORM, the user and commercial layer of our zSUITE software, provides metering, billing, per-customer controls, identity management and integrated observability.
Token counts miss one failure on private infrastructure: one team's batch jobs use capacity another team paid to reserve. Two requests with the same token count can hold very different amounts of GPU memory and time.
GPU Capacity: What an AI Gateway Reads Before It Routes a Request
Capacity-aware routing means the AI gateway checks the cluster's state before it sends a request. It reads four live inputs:
- Free GPU memory per node: shows whether a request with a long prompt fits on that node.
- Job run times: show which nodes will free up soon and which jobs the scheduler may stop to make room.
- Network health: a slow link raises latency and can rule out splitting one model across several nodes.
- Queue depth: sends requests the cluster can't take to the commercial API, so they don't wait behind batch work.
The gateway reads these inputs from the cluster's control plane, the software that schedules and monitors work. zWARE, our GPU control plane, runs a hardened Kubernetes distribution with an AI-aware scheduler and tracks GPU, network and power health in real time.

A gateway without capacity data works for one model on one node. Once several models and teams share a fleet, it picks servers without knowing their load and can slow the jobs already running.
We couldn't find a published threshold for this, so it rests on our own judgment.
AI Gateway Governance Checklist for Private GPUs
The governance part of an AI gateway changes little on owned GPUs. TrueFoundry's checklist gives a baseline: RBAC, observability, rate limiting, cost tracking, audit logs and guardrails.
Solo.io's AI gateway explainer adds key management: the gateway holds provider API keys, so developers work without provider credentials. Its prompt guards also block injection attacks and leaked secrets.
Two items change on private infrastructure:
- RBAC: for a vendor backend, access control stops at the API. On owned GPUs it decides which teams reach which nodes, models and reserved capacity.
- Audit logs: for a vendor backend, logs record who called which model. On owned GPUs they also record where each request went, how busy the node was and why the gateway queued or rejected it, which gives both sides evidence in a chargeback dispute.
Rate limiting, guardrails and the remaining checklist items work the same way on both backends.
Does a Private Stack Need an AI Gateway or a Plain API Gateway?
A stack that routes to owned GPUs needs an AI gateway, and a stack that calls vendor APIs can run on a plain API gateway. Use the audit below to check which case fits a given stack:
| Gateway job | Where it often lives today | Question to ask |
|---|---|---|
| Model selection | A config file or plugin listing models | Does selection depend on live cluster state? |
| API routing and failover | Retries that move to the next vendor | Can it fail over to another node in the cluster? |
| Usage metering | Token counts per API key | Can it charge GPU-hours and reserved capacity to teams? |
| GPU-capacity awareness | Often missing, because the vendor's SLA covered it | Does it read free GPU memory and job state before routing? |
A stack that answers yes to the four questions already does a private AI gateway's work. If the gateway can't read GPU memory and job state, the next layer to build is capacity awareness.
zPLATFORM covers the metering, identity and billing described above, and zWARE tracks the cluster state a capacity-aware gateway reads. Model routing, fallback and prompt caching come from a separate gateway product, so judge each candidate against the audit table.
AI Gateway FAQ
Is an LLM gateway different from an AI gateway?
An LLM gateway routes to large language models (LLMs), and AI gateway is the broader term that covers other model types too. Vendors define the two terms differently, so check each product's definition.
Does an AI gateway replace Kubernetes or a GPU scheduler?
An AI gateway works alongside Kubernetes and the GPU scheduler and reads the scheduler's state. The scheduler decides where jobs run and which jobs stop for others, and the gateway picks each request's destination and policy.
Can one AI gateway route to both a self-hosted model and a commercial API?
Yes, one AI gateway can route to both. It needs multi-model routing, separate metering for each backend and a capacity check on the self-hosted side, so overflow goes to the commercial API by design.
