AI model API gateway
Amazon API Gateway has a clear lead for rate limiting and caching LLM API requests to control costs and improve performance.
It depends
For internal LLM APIs needing an open-source gateway, LiteLLM is the usual answer.
Brands AI mentions
Manages public-facing model APIs with authentication, customer quotas, and traffic policies.
Adds token-aware rate limiting and semantic caching for AI traffic.
Also mentioned rarely: Portkey AI, Kong · konghq.com, Google Cloud Apigee, Cloudflare API Shield, Tyk, Zuplo, AWS, Azure API Management, Envoy Gateway, Envoy Proxy, Bifrost by Maxim AI, Langfuse, Amazon Cognito, Kong · kongusa.com, Kong Enterprise, AWS WAF, Kong Developer, Kong Konnect, Braintrust, Google Cloud API Gateway, Envoy AI Gateway, Traefik Hub, Istio, Traefik, OpenAI, Amazon Bedrock, Nginx, Unkey, Helicone, Anthropic, Google Cloud Platform, Auth0, Microsoft, Amazon Elastic Container Service (Amazon ECS), AWS Identity and Access Management (IAM), NVIDIA Triton Inference Server, Microsoft Azure, Cloudflare Polish, Lunar, Curity, Google Cloud Endpoints, Okta, TrueFoundry
- Amazon API GatewayChatGPTChatGPT 95%Google AI ModeGoogle AI Mode 40%
- Kong GatewayChatGPTChatGPT 63%Google AI ModeGoogle AI Mode 38%
- Kong AI GatewayChatGPTChatGPT 13%Google AI ModeGoogle AI Mode 53%
- Cloudflare AI GatewayChatGPTChatGPT 20%Google AI ModeGoogle AI Mode 45%
- CloudflareChatGPTChatGPT 50%Google AI ModeGoogle AI Mode 13%
Pages AI cites most for this topic
Third-party sites shaping AI recommendations here
- Top API Gateways for AI Applications and Agentic Workflows (2026 Developer Guide) - DEV Community (opens in a new tab)16%
dev.to · Names Tyk, Kong Gateway, Google Cloud Apigee
Questions and answers
Google AI ModeNov 19, 2026
Securing a public-facing model API (especially for LLMs or ML endpoints) requires more than traditional IP- or request-count-based controls. Because compute and cost scale with tokens rather than just HTTP hits, the "best" choice
depends on your current tech stack and whether you are serving standard microservices or AI models.Top API Gateway Contenders
- Kong AI Gateway
- Best for: Organizations already familiar with or running Kong for general API management.
- Authentication: API keys, JWT, mTLS, and OIDC integrations.
- Rate Limiting: Supports standard request-rate limits plus AI-specific policies like token-based rate limiting.
- Pros: Mature ecosystem, robust plugin library, handles mixed traffic (traditional REST/gRPC + AI models seamlessly).
- Cons: Advanced AI model policies can require specific licensing tiers.
- Azure API Management (APMI) / AI Gateway
- Best for: Teams deeply embedded in the Microsoft Azure / Azure AI Foundry ecosystem.
- Authentication: Native Azure Active Directory (Entra ID), OAuth via credential manager, and API keys.
- Rate Limiting: Built-in token limits and quota management.
- Pros: Deep enterprise integration, semantic caching, and out-of-the-box policy enforcement.
- Cons: Feature availability varies heavily by tier.
- Envoy Gateway
- Best for: Kubernetes-native environments and high-performance cloud-native stacks.
- Authentication: JWT, OAuth2, and external authorization services via
SecurityPolicyextensions. - Rate Limiting: Global and local rate limiting (can be extended or coupled with token-aware logic).
- Pros: Ultra-low latency, open-source core, massive scalability in K8s clusters.
- Cons: Steeper configuration learning curve compared to managed gateways.
- Dedicated AI-Native Gateways (e.g., Portkey, Langfuse, or Cloudflare AI Gateway)
- Best for: Lightweight proxy needs focused heavily on LLM observability, caching, fallback routing, and per-user token quotas.
- Authentication: Custom token management, BYO-key, or JWT verification.
- Rate Limiting: Native per-user/per-organization token bucket and cost-budget limits.
- Pros: Drop-in setup for LLM providers (OpenAI, Anthropic, Bedrock), built-in prompt analytics, and cost tracking.
- Cons: Less suited if your endpoint is a custom PyTorch/Triton/ONNX model served via raw REST/gRPC rather than an LLM.
Key Requirements for Model APIs
When evaluating your choice, prioritize these features over standard web gateway features:
- Token-Aware Rate Limiting: Traditional HTTP request limits will let a single malicious or buggy client drain your LLM/GPU budget via massive context-window prompts. Ensure the gateway can inspect or estimate token counts.
- Authentication at the Edge: Validate JWTs, OAuth2, or HMAC signatures before requests ever hit your model serving infrastructure.
- Timeouts and Streaming Support: If your model uses Server-Sent Events (SSE) for token streaming, verify that the gateway doesn't buffer chunks or prematurely kill long-lived connections.
To help narrow down the ideal fit, tell me:
- Is your model a traditional ML/Deep Learning endpoint (Triton, PyTorch, custom container) or a Large Language Model / Generative API?
- Where is it hosted (e.g., AWS, Azure, GCP, Kubernetes, or bare metal)?
- Do you need token-based cost tracking or just basic request-rate throttling?
ChatGPTNov 19, 2026
For a public-facing model API, I recommend putting an API gateway in front of your model-serving infrastructure rather than implementing authentication and rate limiting directly in the model server.
The right choice depends on whether you're running in the cloud, Kubernetes, or on your own infrastructure.
For an AI/LLM API, the gateway should handle more than basic request throttling. Ideally, it should support API-key authentication, per-customer quotas, burst limits, request-size limits, and usage tracking.
API gateways worth considering
1. Kong Gateway — Best general-purpose choice
(My recommendation)
- API-key authentication and consumer management.
- Per-consumer and per-route rate limiting.
- Redis-backed distributed rate limiting.
- Advanced rate-limit algorithms and traffic controls.
- Self-hosted or managed deployment options.
Particularly suitable if you want control over your infrastructure and expect multiple model API customers.
Sources:
2. Amazon API Gateway — Best for AWS-native infrastructure
- Fully managed gateway.
- Usage plans, API keys, quotas and throttling.
- Integration with IAM, Cognito and Lambda authorizers.
- Convenient if your model endpoint runs on AWS.
Important: AWS explicitly warns that API keys and usage-plan quotas aren't sufficient as authentication or hard cost-control mechanisms.
Sources:
3. Cloudflare API Shield — Best for edge protection
- JWT validation.
- Rate-limiting rules.
- API schema validation.
- Protection close to the public-facing endpoint.
Particularly useful when you want to protect an API before traffic reaches your infrastructure. Note that its JWT validation feature requires the Enterprise API Shield add-on.
Sources:
My recommended architecture for a model API
For a public-facing LLM inference endpoint, I'd use this structure:
Public API clients
Applications, developers, customer integrations
Cloudflare / WAF
DDoS protection, edge filtering, IP restrictions
Kong API Gateway
Authentication, quotas, rate limiting, request validation
Model-serving API
vLLM, TGI, Triton, or custom inference server
GPU inference infrastructure
Security controls I'd implement
Control Suggested implementation Authentication API keys or OAuth2/JWT Per-customer limits Consumer-based rate limits Burst protection Token bucket / sliding window IP protection WAF and IP-based limits Request size Maximum body and input token limits Cost protection Per-customer token and spending quotas Monitoring Request logs, usage metrics and alerts Network security Keep inference servers private; only expose the gateway One particularly important consideration for LLM APIs: Request-based rate limiting alone isn't enough. A customer making 10 requests with 100,000 input tokens each can consume significantly more GPU resources than someone making 100 short requests.
Use gateway-level request limits alongside application-level input/output token accounting and hard spending limits.
Final recommendation
I'd choose based on your deployment:
- Kong Gateway: If you want a flexible, self-hosted gateway with strong API management.
- AWS API Gateway: If you're already using AWS and prefer minimal infrastructure operations.
- Cloudflare + Kong: If you want both edge-level protection and detailed per-customer API controls.
For Kong, I'd start with:
- Key Auth or JWT authentication.
- Consumer-based rate limiting.
- Redis-backed shared counters if running multiple gateway instances.
- Request-size and input-token limits.
- Application-level token accounting and customer spending quotas.
See Kong's implementation guide.
One question to narrow it down
Where is your model API currently deployed?
1. Deployment environment
Kubernetes / self-hosted
AWS
Google Cloud
Azure
Bare-metal GPU servers
2. Preferred authentication
API keys for customers
OAuth2 / JWT
Both
3. Expected usage
Development / internal use
Production / multiple customers
High-volume public API
[Get my recommended architecture]
Pages cited in this answer 11
- developer.konghq.comGateway rate limiting | Kong Docs
- developer.konghq.comKey Auth - Plugin | Kong Docs
- developer.konghq.comRate limiting strategies - Kong Gateway | Kong Docs
- konghq.comKong Gateway: API Connectivity Foundation for AI | Kong Inc.
- docs.aws.amazon.comUsage plans and API keys for REST APIs in API Gateway - Amazon API Gateway
- aws.amazon.comAmazon API Gateway FAQs | API Management | Amazon Web Services
- aws.amazon.comAmazon API Gateway | API Management | Amazon Web Services
- developers.cloudflare.comJSON Web Tokens validation · Cloudflare API Shield docs
- developers.cloudflare.comGet started with API Shield · Cloudflare API Shield docs
- cloudflare.comCloudflare API Shield - Secure and Monitor APIs
- developer.konghq.comHow to: Rate limit a Consumer with Kong Gateway | Kong Docs
- Kong AI Gateway
Google AI ModeNov 10, 2026
Public-facing AI and model endpoints require specialized handling because traditional request-count rate limiting isn’t enough—you need to account for token consumption (prompt vs. completion), latency , and model-specific auth (such as
virtual keys or usage budgets).The top API gateway options span general-purpose cloud gateways, open-source AI gateways, and enterprise-grade platforms.
1. Top API Gateway & AI Gateway Options
2. Key Capabilities for Model Endpoints
When exposing public-facing model endpoints, look for these specific features that go beyond standard HTTP reverse-proxy logic:
- Token-Aware Rate Limiting: Standard gateways count HTTP requests. Model gateways (like Kong’s AI Rate Limiting or Azure’s token-limit policy) count Tokens-Per-Minute (TPM) or Prompt/Completion breakdowns to prevent a single user from draining your budget or saturating GPU clusters.
- Virtual Key Management: Issuing proxy/virtual keys to external clients lets you enforce spending caps (e.g., "$10 max limit per client key") without exposing your root OpenAI/Anthropic/Bedrock API keys.
- Authentication & Federation: Integration with standard identity providers via OIDC / OAuth2 (Okta, Microsoft Entra ID) or mTLS for service-to-service calls.
- Guardrails & PII Redaction: On-the-fly request/response inspection to strip Personally Identifiable Information (PII) or block jailbreak prompts before they reach the model.
- Fallback & Circuit Breaking: Automatic rerouting to a secondary model or provider if the primary LLM endpoint throws rate-limit errors (429) or latency spikes.
To see a technical breakdown of how these components work under the hood, you can watch this visual overview:
Watch this deep dive into how API gateways handle request routing, authentication, and rate limiting in production systems:
19:46API Gateway Deep Dive: Routing, Auth, Rate Limiting, CachingYouTube · Shubh Patel · ...7.4K views · 3 months ago
Are you building this on a specific cloud provider (like AWS, Azure, or GCP) or looking for a self-hosted open-source stack ? Let me know your rough traffic scale and I can narrow down the best fit.
ChatGPTNov 10, 2026
For public-facing model endpoints (LLM inference APIs, embedding services, and hosted ML models), I would prioritize an API gateway that provides strong authentication, per-consumer rate limiting, quota enforcement, and protection against abuse.
The strongest options fall into three groups:
- Managed API gateways: AWS API Gateway, Google Cloud API Gateway, Azure API Management.
- API infrastructure gateways: Kong, Tyk, Gravitee.
- Edge and application security platforms: Cloudflare API Shield/API Gateway, Apigee.
One important distinction: protecting an endpoint requires more than API-key validation. For model APIs, you also want token-based usage limits, request-size controls, concurrency limits, and protection against expensive inference abuse.
1. API gateway comparison
Platform Authentication Rate limiting and quotas Best fit Kong Gateway OAuth2, OIDC, JWT, API keys, mTLS Per-consumer, per-route, Redis-backed distributed limits; specialized AI rate limiting Flexible model-serving infrastructure Google Apigee OAuth2, API keys, access tokens Spike arrest, quotas, LLM token quotas Enterprise API products Azure API Management JWT validation, OAuth2, Entra ID, subscription keys Per-key limits, quotas, concurrency and LLM token limits Azure and enterprise deployments AWS API Gateway IAM, Cognito, JWT, Lambda authorizers Request throttling, per-client usage plans and quotas AWS-native deployments Cloudflare API Shield JWT validation, mTLS Rate limiting, schema validation, abuse detection Public internet-facing endpoints Google Cloud API Gateway JWT and Google authentication API quotas Lightweight GCP deployments Strongest candidates
1. Kong Gateway — best overall flexibility
(My top pick for flexible AI infrastructure)
- Supports authentication plugins that validate clients before requests reach model-serving infrastructure.
- Supports per-consumer and per-route rate limits.
- Redis-backed rate limiting helps maintain shared limits across gateway instances.
- Has specialized AI rate-limiting capabilities.
Particularly interesting for LLM deployments is its AI-specific rate-limiting functionality.
Documentation:
2. Google Apigee — best for enterprise API monetization and governance
- OAuth2 and API-key-based client management.
- Distributed quotas and traffic spike protection.
- Dedicated
LLMTokenQuotaandPromptTokenLimitpolicies. - Useful analytics and developer-facing API management.
Its token-aware policies are especially valuable when inference costs vary significantly by prompt and completion size.
Documentation:
3. Azure API Management — best for sophisticated usage policies
- JWT validation and integration with Microsoft Entra ID.
- Per-key rate limiting and renewable quotas.
- Concurrency controls.
- Dedicated LLM token usage limiting policy.
This is a particularly strong candidate if you need different usage tiers for customers, organizations, and API products.
Documentation:
4. AWS API Gateway — best for AWS-native simplicity
- JWT authorizers for HTTP APIs.
- Cognito and IAM integration.
- Usage plans with API keys, quotas and throttling.
- Integration with AWS WAF.
An important caveat: AWS explicitly describes usage-plan throttling and quotas as best-effort targets, not hard enforcement. Don't rely on them alone for inference cost protection.
Documentation:
5. Cloudflare API Shield — best for edge security
- JWT validation.
- Mutual TLS authentication.
- API schema validation.
- API abuse detection and rate limiting.
It is particularly useful as an outer security layer before traffic reaches your inference gateway.
Documentation:
-
2. What matters specifically for model endpoints
Traditional API gateways usually count requests. That is insufficient for model-serving workloads.
Consider these five enforcement layers:
Control Example Why it matters Authentication OAuth2, JWT, API keys Prevent unauthorized inference Request rate 30 requests/minute Prevent request floods Token budget 100K tokens/day Control inference expenditure Concurrency 5 simultaneous generations Protect GPU capacity Payload limits Maximum prompt size Prevent oversized requests I would also implement:
- Tenant isolation: Separate quotas and usage accounting for each customer.
- Model-specific policies: Different limits for expensive models and lightweight models.
- Streaming protection: Limit generation duration and concurrent streaming connections.
- Cost enforcement: Stop requests when an account reaches its spending allowance.
- Audit logging: Track customer, model, token consumption, latency and status.
Apigee and Azure have particularly interesting native LLM token controls. Kong is also compelling for teams that want to customize their AI gateway infrastructure.
3. Recommended architecture
For a production public-facing model API, I'd use this architecture:
Public clients
Applications, SDKs, customer integrations
Edge security / WAF
DDoS protection, bot filtering, IP controls
API gateway
JWT validation, API keys, authentication, request throttling
Usage and policy enforcement
Tenant quotas, token budgets, concurrency, model permissions
Model router
Routing and fallback
Usage metering
Actual token accounting
Model-serving infrastructure
vLLM, Triton, hosted LLMs, GPU inference clusters
One architectural detail: enforce estimated token budgets before inference, then reconcile against actual prompt and completion tokens afterward. This avoids relying on request-count throttling to control model expenditure.
4. My recommendation
I'd shortlist these three:
Priority Platform Reason 1 Kong Flexible, extensible, AI-focused controls 2 Apigee Strong native LLM token quotas 3 Azure APIM Strong enterprise identity and usage policies For a high-volume model API, I would lean toward Kong with Redis-backed distributed rate limiting and a separate usage-metering service. For a managed enterprise platform, I'd evaluate Apigee first.
5. A question that would narrow the choice
What kind of public-facing model endpoints are you building?
Deployment environment
Self-hosted models (vLLM, TGI, Triton)
Managed cloud models (OpenAI, Bedrock, Vertex AI)
Hybrid model-serving architecture
Most important requirement
Per-customer token quotas and cost controls
Strong authentication and tenant isolation
High throughput and GPU concurrency protection
All of the above
Expected deployment scale
Prototype / early-stage API
Production, moderate traffic
High-volume, multi-tenant production
[Get a tailored architecture recommendation]
Pages cited in this answer 11
- developer.konghq.comAuthentication | Kong Docs
- developer.konghq.comRate Limiting - Plugin | Kong Docs
- developer.konghq.comGateway rate limiting | Kong Docs
- docs.cloud.google.comRate-limiting | Apigee | Google Cloud Documentation
- docs.cloud.google.comSpikeArrest policy | Apigee | Google Cloud Documentation
- learn.microsoft.comAPI Authentication and Authorization - Overview - Azure API Management | Microsoft Learn
- learn.microsoft.comAzure API Management Policy Reference | Microsoft Learn
- docs.aws.amazon.comControl access to HTTP APIs with JWT authorizers in API Gateway - Amazon API Gateway
- docs.aws.amazon.comUsage plans and API keys for REST APIs in API Gateway - Amazon API Gateway
- docs.aws.amazon.comThrottle requests to your REST APIs for better throughput in API Gateway - Amazon API Gateway
- developers.cloudflare.comGet started with API Shield · Cloudflare API Shield docs
Google AI ModeNov 28, 2026
When exposing public AI model endpoints, you need a gateway that goes beyond traditional HTTP rate-limiting and auth—it must understand things like
[Highlight start] token usage, model-specific throttling, fallback routing, and streaming responses (SSE) [Highlight end].The top options span traditional infrastructure gateways adapted for AI, specialized LLM/AI gateways, and cloud-native solutions:
1. Traditional API Gateways (AI-Enhanced)
- Kong AI Gateway
- Best for: High-throughput, low-latency enterprise production where you already use Kong for standard REST/GraphQL traffic.
- Strengths: Built on NGINX/OpenResty, Kong offers native AI plugins (AI Proxy, AI Auth, AI Rate Limiting) that track token consumption rather than just raw requests. Independent benchmarks show it significantly outperforms Python- or Node-based proxy wrappers in raw latency.
- Apache APISIX
- Best for: Open-source, cloud-native Kubernetes environments needing dynamic routing and custom plugins.
- Strengths: Powered by etcd and Lua/OpenResty, APISIX supports high-performance traffic management, fine-grained consumer key authentication, and custom rate-limiting policies per model or tenant.
2. Specialized AI & LLM Gateways
- LiteLLM (Proxy Server)
- Best for: Rapid deployment, multi-model translation (OpenAI-format to Anthropic, Bedrock, vLLM, etc.), and Python-centric or startup-to-scale-up teams.
- Strengths: Provides a drop-in OpenAI-compatible proxy server with built-in virtual keys, spend tracking, per-key/per-model rate limits, and team-based budgets out of the box.
- Portkey
- Best for: Observability, semantic caching, automated fallbacks, and fine-grained access control.
- Strengths: Offers a robust open-source and managed control plane with virtual keys, real-time logging, guardrails, and detailed rate-limiting policies tailored for LLM workloads.
- Bifrost
- Best for: Enterprises requiring ultra-low-latency, air-gapped, or on-premise governance across unified LLM, agent, and MCP gateways.
- Strengths: Designed for minimal overhead (very low latency per request) with strict enterprise policy enforcement and multi-environment routing.
3. Cloud-Native & Hyperscaler Gateways
- Cloudflare AI Gateway
- Best for: Teams already running on Cloudflare Workers who want zero-maintenance analytics, caching, and basic rate limiting.
- Strengths: Super easy to toggle on in front of providers like OpenAI, Anthropic, or Workers AI, though restricted by Cloudflare's network topology and privacy posture.
- Azure AI Gateway (Azure API Management)
- Best for: Organizations locked into the Microsoft/Azure ecosystem using Azure AI Foundry.
- Strengths: Native policy enforcement, token-aware throttling, and enterprise-grade identity integration via Entra ID.
Quick Comparison Matrix
Gateway Type Key Strength Rate Limiting Granularity Kong AI Gateway Traditional / Infrastructure Extreme speed & scale Per-token, per-consumer, per-model LiteLLM Proxy Specialized LLM Gateway OpenAI-format translation & budgets Per-virtual-key, spend limits, RPM/TPM Portkey Specialized AI Gateway Observability, caching & guardrails Per-key, semantic caching, fallbacks Cloudflare AI Gateway Cloud-native Edge Zero-config setup & analytics Request/cache/cost controls To help narrow down the best fit, tell me:
- Are you self-hosting your own models (e.g., via vLLM, TGI, or Ollama ) or proxying third-party APIs (OpenAI, Anthropic)?
- Do you need rate limiting based on raw requests (RPM), tokens per minute (TPM) , or dollar spend limits?
ChatGPTNov 28, 2026
For public AI model endpoints, I’d look for an API gateway that provides more than traditional API authentication and rate limiting. AI inference endpoints have additional requirements: expensive requests, variable token consumption, burst traffic, API key abuse, and potentially large payloads.
I would compare gateways across five capabilities:
- Authentication: API keys, OAuth 2.0/OIDC, JWT validation, and service-to-service identity.
- Rate limiting: Per-user, per-API-key, per-IP, and per-model limits.
- AI-aware quotas: Token-based limits, request budgets, and usage tracking.
- Security: WAF integration, request-size limits, IP restrictions, and abuse protection.
- Observability: Per-customer usage, latency, error rates, and cost attribution.
Top API gateway options
1. Kong AI Gateway
(Strong all-around option)
- API key and consumer authentication.
- OAuth and other authentication strategies.
- Per-consumer and advanced rate limiting.
- AI token consumption controls and cost tracking.
- Multi-provider routing, retries, and observability.
Best for: Production AI APIs with multiple customers, models, or providers.
Documentation: Kong AI Gateway ·
2. Cloudflare AI Gateway
(Strong managed option)
- Gateway authentication.
- Configurable fixed-window and sliding-window rate limits.
- Logging, caching, and analytics.
- Unified API for OpenAI, Anthropic, Google, and other providers.
- Cloudflare edge infrastructure.
Best for: Teams wanting a managed service without operating gateway infrastructure.
One consideration: its documented rate limiting is request-based, so implement additional token-budget enforcement if you need per-customer inference cost controls.
Documentation: REST API · Rate limiting ·
3. Apache APISIX
(Strong open-source option)
- API key and other authentication plugins.
- Consumer-based rate limiting.
- AI proxy and multi-provider routing.
- Token-based rate limiting.
- Extensible plugin architecture.
Best for: Self-hosted infrastructure, Kubernetes deployments, and teams wanting control over gateway behavior.
Particularly interesting because its AI rate-limiting plugin supports token-based consumption limits.
Documentation: APISIX AI Gateway ·
4. Amazon API Gateway
- API keys and usage plans.
- Per-client throttling and quotas.
- IAM, Lambda authorizers, and JWT authorization through supported configurations.
- AWS WAF integration.
- Integration with Lambda, ECS, and other AWS services.
Best for: AI endpoints already hosted in AWS.
Important distinction: its standard usage plans meter requests, not actual LLM token consumption. You may need a separate quota service.
5. Envoy Gateway / Envoy Proxy
- JWT authentication.
- External authorization integrations.
- Local and global rate limiting.
- Kubernetes Gateway API integration.
- Flexible traffic management.
Best for: Platform engineering teams that want a programmable, Kubernetes-native gateway.
Consider this when you already operate Envoy infrastructure and are comfortable assembling the AI-specific controls yourself.
6. Google Apigee
- OAuth 2.0 and API key verification.
- Spike arrest and quota policies.
- API products and developer access management.
- Analytics and enterprise governance.
Best for: Enterprise API programs where AI endpoints are part of a broader API product portfolio.
You may need custom policies or backend metering for token-based AI quotas.
Feature comparison
Gateway API authentication Request limits Token-based limits Deployment Kong Excellent Yes Yes Self-hosted / managed Cloudflare Yes Yes Additional controls needed Managed APISIX Excellent Yes Yes Self-hosted AWS API Gateway Excellent Yes Custom implementation Managed Envoy Gateway Yes Yes Custom implementation Self-hosted Apigee Excellent Yes Yes Managed / hybrid One particularly interesting alternative is Apigee: its LLMTokenQuota and PromptTokenLimit policies explicitly support token-based usage controls.
AWS has an important caveat: usage-plan quotas and throttles are best-effort, not guaranteed hard ceilings. AWS explicitly advises against relying on them alone for cost control.
My recommendation
For public AI model endpoints, I'd narrow the shortlist to:
- Kong: If you want a dedicated AI gateway with authentication, token metering, and multi-model routing.
- Cloudflare: If you want minimal infrastructure management and edge protection.
- APISIX: If you want open-source control and token-aware rate limiting.
- Apigee: If enterprise API governance and token quotas are priorities.
Recommended architecture
Regardless of gateway, I'd use this request flow:
Public API clients
Developer applications / SDKs
API Gateway
Authentication · WAF · IP throttling
Usage & quota enforcement
Per-customer limits · Token budgets · Model entitlements
AI inference service
Model routing · GPU inference · Streaming
A particularly important design decision: don't rely exclusively on request-count rate limiting. One customer making 10 requests could consume more GPU resources than another customer making 1,000 requests.
I'd implement:
- Requests per second per API key.
- Concurrent inference limits per customer.
- Input and output token budgets.
- Maximum context and generation lengths.
- Monthly customer spending limits.
- Global GPU capacity protection.
A few questions to narrow down the best choice
The right gateway depends quite a bit on your infrastructure and business model.
1. Where are your models hosted?
- Kubernetes / self-hosted GPUs
- AWS
- GCP / Azure
- Multiple cloud providers
2. What authentication model do you need?
- API keys issued to customers
- OAuth2 / JWT
- Both
3. What's your deployment preference?
- Open source / self-hosted
- Fully managed SaaS
- Either
4. Do you need token-based billing and quotas?
- Yes, per-customer token budgets
- Yes, usage-based billing
- Just request-based rate limiting
With those answers, I can narrow this down to the best two or three gateways and suggest a concrete production architecture.
Pages cited in this answer 11
- developer.konghq.comKong AI Gateway | Kong Docs
- developer.konghq.comRate Limiting Advanced - Policy | Kong Docs
- developers.cloudflare.comREST API · Cloudflare AI Gateway docs
- developers.cloudflare.comRate limiting · Cloudflare AI Gateway docs
- developers.cloudflare.comAuthenticated Gateway · Cloudflare AI Gateway docs
- apisix.apache.orgOpen-Source AI Gateway for LLMs and AI Agents | Apache APISIX
- apisix.apache.orgai-rate-limiting | Apache APISIX
- docs.cloud.google.comRate-limiting | Apigee | Google Cloud Documentation
- docs.cloud.google.comQuota policy | Apigee | Google Cloud Documentation
- docs.aws.amazon.comUsage plans and API keys for REST APIs in API Gateway - Amazon API Gateway
- docs.aws.amazon.comThrottle requests to your REST APIs for better throughput in API Gateway - Amazon API Gateway
- Kong AI Gateway
We want to implement rate limiting and caching for our internal LLM API. What's the best open-source API gateway for this?
Summary
LiteLLM is the usual answer for an open-source gateway handling rate limits and caching on an internal LLM API. The answers also point to its self-hosted flexibility, budget controls, and caching features.
Top head-to-head comparisons
Since Jul 5Data through Nov 28, 2026Based on 80 AI answers
For agents: this page as Markdown, https://parse.gl/topics/llm-rate-limiting-and-caching.md. JSON, MCP · free for the last 90 days, checks from $0.01
This page
Read and search
Connect
npx -y parse-gl check <domain>Copy the CLI commandAn agent can save work before signup: POST https://agent.parse.gl/v1/workspaces
What it costs
Prices: https://parse.gl/pricing.md
Map of the site: https://parse.gl/llms.txt