Documentation Index
Fetch the complete documentation index at: https://mintlify.com/portkey-AI/gateway/llms.txt
Use this file to discover all available pages before exploring further.
Deployment Options
The AI Gateway can be deployed in multiple ways to suit your infrastructure needs:NPM/Bun
Quick local development
Docker
Containerized deployment
Node.js Server
Self-hosted production server
Cloudflare Workers
Edge deployment
Kubernetes
Scalable orchestration
Cloud Providers
AWS, Azure, GCP
For a fully managed solution without infrastructure concerns, consider Portkey’s hosted gateway which processes billions of tokens daily in production.
Quick Start (npx)
The fastest way to get started:Verify it's running
The gateway starts on port 8787:You should see:
- API:
http://localhost:8787/v1 - Console:
http://localhost:8787/public/
AI Gateway says hey!Make your first request
Now follow the quickstart guide to make your first API call.
Docker
Deploy using Docker for containerized production environments.Run with Docker
Pull and run the latest image from Docker Hub:
The gateway is now running at
http://localhost:8787Docker Compose
For multi-container setups with Redis caching:The Docker image is built from the Dockerfile which uses a multi-stage build for optimal size.
Node.js Server
Run the gateway as a standalone Node.js application.Running as a Service
Create a systemd service file for production:/etc/systemd/system/portkey-gateway.service
Cloudflare Workers
Deploy to Cloudflare’s edge network for low-latency global distribution.Configure Wrangler
Make sure you have the Wrangler CLI installed and authenticated:
Cloudflare Workers have request limits on the free tier. Consider upgrading for production use.
Kubernetes
Deploy to Kubernetes for production-grade orchestration.AWS EC2
Quick deployment to AWS EC2 using CloudFormation.Configure parameters
Set:
- VPC ID
- Subnet ID
- Instance Type (t2.micro for testing, t3.small for production)
Launch stack
CloudFormation will:
- Launch an EC2 instance
- Install Docker
- Run the gateway container
- Configure security groups (port 8787)
Other Platforms
Replit
Deploy with one click:Zeabur
Use the template:Azure, GCP, OpenShift
For enterprise deployments on:- Azure
- Google Cloud Platform
- Red Hat OpenShift
- Other cloud providers
Configuration
Environment Variables
Common configuration options:| Variable | Description | Default |
|---|---|---|
PORT | Server port | 8787 |
REDIS_CONNECTION_STRING | Redis URL for caching | - |
NODE_ENV | Environment mode | development |
Configuration File
Createconf.json for advanced settings:
conf_sample.json in the repository for all available options.
Verification
After installation, verify your deployment:Next Steps
Make Your First Request
Follow the quickstart to make your first API call
Configure Routing
Learn about routing, fallbacks, and load balancing
Add Guardrails
Protect your AI apps with input/output validation
Production Deployment
Best practices for production deployments
Need help? Join our Discord community or check the GitHub repository.