Tyk — Open Source API Gateway with Developer Portal
Tyk is a Go-based API gateway with plugins, rate limiting, OAuth2/OIDC, GraphQL federation, and a built-in developer portal — packaged as a single binary or full Kubernetes operator.
What it is
Tyk is a high-performance, open-source API gateway written in Go. It handles quota enforcement, rate limiting, authentication (OAuth2, OIDC, JWT, HMAC, mTLS), request/response transformations, analytics, and a developer portal. You can deploy it as a single binary, a Docker container, or a full Kubernetes operator.
Tyk is built for teams that need a self-hosted gateway without vendor lock-in. Platform engineers, DevOps teams, and API product managers use it to manage internal and external APIs at scale.
How it saves time or tokens
Instead of building rate limiting, auth middleware, and analytics from scratch, Tyk provides all of these as declarative configuration. A single API definition JSON file replaces hundreds of lines of custom middleware code. Hot-reloading means you push config changes without restarting the gateway process, reducing deployment risk.
For AI workloads, Tyk can sit in front of LLM API endpoints to enforce per-consumer rate limits and track token-level usage through its analytics pipeline.
How to use
- Clone the official Docker Compose stack and start Tyk with Redis:
git clone https://github.com/TykTechnologies/tyk-gateway-docker
cd tyk-gateway-docker
docker compose up -d
- Register an API by posting a definition JSON to the gateway admin endpoint.
- Hot-reload the configuration so the new API is live without downtime:
curl localhost:8080/tyk/reload/group \
-H 'x-tyk-authorization: YOUR_SECRET'
Example
A minimal API definition that proxies requests to an upstream service with rate limiting enabled:
{
'name': 'My API',
'api_id': 'my-api-1',
'proxy': {
'listen_path': '/my-api/',
'target_url': 'https://httpbin.org'
},
'rate_limit': {
'rate': 100,
'per': 60
},
'active': true
}
This routes all traffic on /my-api/ to httpbin.org with a cap of 100 requests per 60 seconds.
Related on TokRepo
- AI Gateway Providers -- Compare API gateways purpose-built for AI traffic routing and observability
- DevOps Automation Tools -- Infrastructure tools that pair well with API gateway deployments
Common pitfalls
- Forgetting to run
tyk/reload/groupafter config changes. Without the reload call, new API definitions are not picked up. - Using the default authorization secret in production. Always rotate the
x-tyk-authorizationheader value before exposing the admin API. - Skipping Redis persistence configuration. Tyk uses Redis for rate-limit counters and session storage; losing Redis data resets all quotas.
Frequently Asked Questions
Tyk supports OAuth2, OpenID Connect, JWT, HMAC signing, mutual TLS, and basic auth. You configure the auth method per API definition, and Tyk handles token validation, key management, and session enforcement at the gateway level without custom code.
Yes. Tyk provides an official Kubernetes operator that manages gateway instances, API definitions, and policies as custom resources. You can also deploy via Helm charts for a more traditional approach.
Both are open-source API gateways. Tyk is written in Go as a single binary with a built-in dashboard and developer portal. Kong is Lua/Nginx-based with a plugin architecture. Tyk includes analytics natively while Kong typically requires additional plugins or Kong Konnect.
Yes. Tyk can act as a GraphQL proxy with federation support, schema stitching, and per-field rate limiting. It can also convert REST APIs to GraphQL endpoints using its Universal Data Graph feature.
The open-source gateway handles core routing, rate limiting, auth, and plugins. The commercial version adds a dashboard UI, developer portal, and multi-data-center support. Many teams run the OSS gateway in production behind their own admin tooling.
Citations (3)
- Tyk GitHub— Tyk is a Go-based API gateway with plugins and rate limiting
- Tyk Documentation— Tyk supports OAuth2, OIDC, JWT, HMAC, and mTLS authentication
- Tyk Operator GitHub— Kubernetes operator for managing Tyk as custom resources
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.