Kong — Cloud-Native API and AI Gateway
Kong Gateway is a scalable, open-source API gateway and microservice proxy built on top of NGINX with pluggable policy enforcement for authentication, rate limiting, observability, and AI traffic.
What it is
Kong Gateway is a scalable, open-source API gateway and microservice proxy built on top of NGINX. It provides pluggable policy enforcement for authentication, rate limiting, observability, and AI traffic management. Kong sits between API consumers and your backend services, handling cross-cutting concerns centrally.
Kong targets platform teams and API architects who need a unified gateway for managing API traffic. It supports REST, GraphQL, gRPC, and WebSocket protocols, and can be deployed on Kubernetes, Docker, or bare metal.
How it saves time or tokens
Without an API gateway, each microservice implements its own authentication, rate limiting, and logging. Kong centralizes these concerns with a plugin architecture. Enable a plugin once and it applies to all routes. The AI gateway features route LLM traffic, manage API keys across providers, and apply rate limits per consumer, reducing the boilerplate in AI application backends.
How to use
- Start Kong in DB-less mode:
docker run -d --name kong \
-e KONG_DATABASE=off \
-e KONG_DECLARATIVE_CONFIG=/kong.yml \
-v $PWD/kong.yml:/kong.yml \
-p 8000:8000 -p 8001:8001 \
kong:latest
- Add a service and route via the admin API:
curl -X POST http://localhost:8001/services \
-d name=my-api -d url=http://backend:3000
curl -X POST http://localhost:8001/services/my-api/routes \
-d 'paths[]=/api'
- Enable plugins:
# Rate limiting
curl -X POST http://localhost:8001/services/my-api/plugins \
-d name=rate-limiting -d config.minute=100
# API key authentication
curl -X POST http://localhost:8001/services/my-api/plugins \
-d name=key-auth
Example
# kong.yml - Declarative configuration
_format_version: '3.0'
services:
- name: my-api
url: http://backend:3000
routes:
- name: api-route
paths:
- /api
plugins:
- name: rate-limiting
config:
minute: 100
policy: local
- name: key-auth
- name: prometheus
Related on TokRepo
- AI Gateway Providers — Compare API gateway solutions for AI traffic
- AI Tools for API — API management and development tools
This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.
For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.
Common pitfalls
- DB-less mode is simpler but requires restarting Kong to apply config changes; use a database (PostgreSQL) for dynamic configuration via the admin API.
- The admin API (port 8001) should not be exposed to the public internet; restrict access with firewall rules or use Kong's admin API authentication.
- Plugin execution order matters for request processing; understand the plugin priority system when combining multiple plugins on the same route.
Frequently Asked Questions
Kong OSS is the open-source version with core gateway features and community plugins. Kong Enterprise adds a management UI (Kong Manager), role-based access control, advanced analytics, and commercial support.
Yes. Kong has AI-specific plugins for routing LLM API traffic, managing provider API keys, applying token-based rate limits, and logging AI request/response pairs. These plugins work with OpenAI, Anthropic, and other providers.
Yes. Kong provides an official Kubernetes Ingress Controller that deploys Kong as a Kubernetes-native API gateway. It supports CRDs for configuring services, routes, and plugins.
Kong supports HTTP, HTTPS, HTTP/2, gRPC, WebSocket, and TCP/TLS proxying. It can handle REST APIs, GraphQL endpoints, and streaming connections.
The open-source Kong Gateway is free under the Apache 2.0 license. Kong Enterprise requires a commercial license but includes additional features and support.
Citations (3)
- Kong GitHub— Kong Gateway is built on NGINX with pluggable plugin architecture
- Kong Documentation— Kong supports REST, GraphQL, gRPC, and WebSocket protocols
- Kong Official Site— Kong is open-source under Apache 2.0 license
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.