DEV.co
AI Frameworks · Portkey-AI

gateway

Portkey Gateway is an open-source API routing layer that unifies access to 1,600+ language models, vision models, and AI services through a single standardized interface. It includes built-in reliability features (retries, fallbacks, load balancing) and content guardrails to secure AI deployments.

Source: GitHub — github.com/Portkey-AI/gateway
12.4k
GitHub stars
1.2k
Forks
TypeScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryPortkey-AI/gateway
OwnerPortkey-AI
Primary languageTypeScript
LicenseMIT — OSI-approved
Stars12.4k
Forks1.2k
Open issues215
Latest releasev1.15.2 (2026-01-12)
Last updated2026-05-25
Sourcehttps://github.com/Portkey-AI/gateway

What gateway is

TypeScript-based gateway running on Node.js, Cloudflare Workers, or Docker that translates requests to provider-specific APIs (OpenAI, Anthropic, Bedrock, Groq, etc.) with sub-millisecond latency. Supports config-driven routing rules, output filtering, and observability dashboards; enterprise version adds org management and custom deployments.

Quickstart

Get the gateway source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/Portkey-AI/gateway.gitcd gateway# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-LLM Cost Optimization

Route requests across cheaper alternative models (e.g., Groq, open-source) during peak load while keeping premium APIs as fallbacks, reducing LLM spend by 40-60%.

Reliability & Downtime Prevention

Automatically retry failed requests or switch providers when an LLM API is degraded, ensuring upstream applications see minimal interruption.

Content Safety & Compliance

Enforce output guardrails (filter PII, block unsafe content, validate response format) before responses reach end-users, meeting regulatory requirements.

Implementation considerations

  • Quickstart is genuinely simple (npx command), but production deployments require choice of hosting (Portkey Cloud, self-hosted Docker, Kubernetes, AWS EC2 template). Plan for observability and monitoring of the gateway itself.
  • Config-based routing and guardrails are code-free but require understanding of schema; test guardrail logic thoroughly before production (false positives/negatives can break workflows).
  • Gateway 2.0 is pre-release; production workloads should validate stability and breaking changes. Current stable version (v1.15.2) is from Jan 2026.
  • API key management: you must provide provider credentials to the gateway (env vars or config). Ensure secure storage and rotation practices.
  • No native caching, rate-limiting, or cost metering shown in README; verify enterprise version includes these if needed.

When to avoid it — and what to weigh

  • Ultra-Low Latency Constraints (<5ms p99) — While advertised as <1ms, real-world latency includes network hops and serialization. If sub-5ms is hard requirement, benchmark against your provider directly.
  • Proprietary/Closed-Source Model Access Only — Gateway focuses on OpenAI-compatible or well-documented APIs; custom internal models or closed APIs may require additional integration work.
  • Airgapped/Offline Environments — Gateway requires outbound connectivity to route requests to external LLM providers; no offline-first or edge-compute story evident.
  • Simple Use Cases (Single Provider, No Failover) — If you use one LLM provider with no reliability or cost concerns, direct SDK usage is simpler and has lower operational overhead.

License & commercial use

MIT License (permissive, OSI-approved). Covers source code; commercial use is allowed under standard MIT terms (no warranty, no liability).

MIT permits commercial use, modification, and distribution with minimal restrictions. However, Portkey also offers a hosted commercial service and enterprise version with advanced features. Evaluate whether self-hosted open-source meets your governance needs or if managed service is preferred. Review Portkey's commercial terms separately for hosted offering.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Gateway handles API keys and authentication tokens in transit and at rest. No explicit security audit, vulnerability disclosure process, or threat model described. Key considerations: (1) Credentials are passed through the gateway—ensure TLS, no logging of sensitive data; (2) Guardrails are defensive but not cryptographic; (3) Enterprise version may include enhanced auth/RBAC; (4) Self-hosted deployments depend on your infrastructure security. Recommend security review before production use with sensitive data.

Alternatives to consider

LiteLLM (Python OSS routing layer)

Python-first, simpler config model, lower operational overhead if you're a Python shop; lacks some enterprise features and browser console.

OpenRouter / Together.ai (Managed routing services)

Fully managed, no self-hosting, built-in cost tracking and paywall; less control and higher per-request fees, no guardrails.

Direct SDK integration with fallback logic

No extra layer, fewer moving parts, full control; requires custom retry/failover code in your application, harder to scale.

Software development agency

Build on gateway with DEV.co software developers

Get started with Portkey Gateway in 2 minutes. Unified API, automatic failover, and cost optimization across all LLM providers.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

gateway FAQ

Can I use Portkey Gateway with my own fine-tuned LLM?
If your model is accessible via an OpenAI-compatible API, yes. Otherwise, gateway requires integration work. Check docs for supported providers.
What happens if a guardrail blocks a response?
Config determines behavior: deny (reject response, optionally retry), or allow with warning. Blocked responses can be logged for audit.
Is there a cost to using the open-source version?
MIT-licensed code is free. Self-hosting costs depend on infrastructure. Portkey Cloud (managed service) has separate pricing.
How does load balancing work across providers?
Config allows weighted routing rules (e.g., 70% Groq, 30% OpenAI) or conditional logic (e.g., if provider X fails, use Y). Exact algorithm not detailed in README.

Software development & web development with DEV.co

Need help beyond evaluating gateway? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and ai frameworks integrations — and maintain them long-term.

Route Your AI Traffic Smarter

Get started with Portkey Gateway in 2 minutes. Unified API, automatic failover, and cost optimization across all LLM providers.