Portkey AI Gateway is a free, open source ai development platforms project written in TypeScript and released under MIT. It has 13,022 GitHub stars, 1,305 forks and 262 open issues, and was last pushed 4 months ago. On this registry it ranks #46 of 61 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 48 stars over the last 6 tracked days.

Portkey AI Gateway — Complete production stack for AI teams

What is Portkey AI Gateway?

What it is

Portkey AI Gateway is an open-source TypeScript project that routes AI application requests through one API to many language, vision, audio, and image models. It belongs to the AI development platform ecosystem and is described as an AI gateway, LLM gateway, and generative AI gateway. The project is licensed under MIT, and its topics include llmops, langchain, mcp, mcp-client, and mcp-gateway.

The problem it addresses is the operational work of calling many model providers from one application. Teams need to route requests, handle failures, apply routing rules, view local logs, and use guardrails. The README presents the gateway as a way to integrate with any LLM quickly, route traffic through retries, fallbacks, load balancing, conditional routing, and guardrails, and manage MCP servers through MCP Gateway.

Key capabilities

  • It routes requests through one API to 1,600+ LLMs and 50+ AI guardrails, according to the repository description.
  • It supports language, vision, audio, and image model traffic, and the README mentions multi-modal capabilities.
  • It provides automatic retries and fallbacks to reduce downtime when provider requests fail.
  • It supports load balancing and conditional routing so traffic can be distributed or directed by rules.
  • It connects with JavaScript, Python, REST, OpenAI SDKs, LangChain, LlamaIndex, Autogen, and CrewAI.
  • It includes MCP support in its topics and README, with MCP Gateway described for managing MCP servers with enterprise authentication and observability.

Who uses it and how

  • AI application teams use it as a central request layer for chat completions, including examples that call a model such as gpt-4o-mini through an OpenAI-compatible client.
  • Teams building with LangChain, LlamaIndex, Autogen, or CrewAI can place the gateway between application code and model providers.
  • Developers who need local visibility can run the gateway and inspect logs in the Gateway Console at a local URL.
  • Operators can deploy the gateway through Portkey Cloud, Docker, Node.js, Cloudflare, Replit, or other deployment guides listed in the README.

Getting started

The typical local start command is npx @portkey-ai/gateway, which runs the gateway on http://localhost:8787/v1 and the console on http://localhost:8787/public/. The README also lists Docker, Node.js, Cloudflare, Replit, and Portkey Cloud as deployment options, and Python users can install the portkey-ai package.

When to use it — and when not to

It fits teams that want an open-source gateway for multi-provider LLM routing, retries, fallbacks, guardrails, and local logs under an MIT license. The README also points to hosted and enterprise paths, so teams may need to choose between self-hosting and managed features. The repository metadata lists 262 open issues, a 2.0 pre-release branch, and 0 contributors, which may require additional review before production use.

project readme (upstream, from github) — read inline

English | 中文 | 日本語

[!IMPORTANT] :rocket: Gateway 2.0 (Pre-Release) Portkey's core enterprise gateway is merging into open-source with our 2.0 release. You can try the pre-release branch here. Read more about what's next for Portkey in our Series A announcement.

🆕 Portkey Models - Open-source LLM pricing for 2,300+ models across 40+ providers. Explore →

AI Gateway

Route to 250+ LLMs with 1 fast & friendly API
Portkey AI Gateway Demo showing LLM routing capabilities

Docs | Enterprise | Hosted Gateway | Changelog | API Reference

License Discord Twitter npm version Better Stack Badge

Deploy to AWS EC2 Ask DeepWiki


The AI Gateway is designed for fast, reliable & secure routing to 1600+ language, vision, audio, and image models. It is a lightweight, open-source, and enterprise-ready solution that allows you to integrate with any language model in under 2 minutes.

  • Blazing fast (
What can you do with the AI Gateway?



[!TIP] Starring this repo helps more developers discover the AI Gateway 🙏🏻

star-2



Quickstart (2 mins)

1. Setup your AI Gateway

# Run the gateway locally (needs Node.js and npm)
npx @portkey-ai/gateway

The Gateway is running on http://localhost:8787/v1

The Gateway Console is running on http://localhost:8787/public/

Deployment guides:   Portkey Cloud (Recommended)   Docker   Node.js   Cloudflare   Replit   Others...

2. Make your first request

# pip install -qU portkey-ai

from portkey_ai import Portkey

# OpenAI compatible client
client = Portkey(
    provider="openai", # or 'anthropic', 'bedrock', 'groq', etc
    Authorization="sk-***" # the provider API key
)

# Make a request through your AI Gateway
client.chat.completions.create(
    messages=[{"role": "user", "content": "What's the weather like?"}],
    model="gpt-4o-mini"
)

Supported Libraries:   JS   Python   REST   OpenAI SDKs   Langchain   LlamaIndex   Autogen   CrewAI   More..

On the Gateway Console (http://localhost:8787/public/) you can see all of your local logs in one place.

3. Routing & Guardrails

Configs in the LLM gateway allow you to create routing rules, add reliability and setup guardrails.

config = {
  "retry": {"attempts": 5},

  "output_guardrails": [{
    "default.contains": {"operator": "none", "words": ["Apple"]},
    "deny": True
  }]
}

# Attach the config to the client
client = client.with_options(config=config)

client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Reply randomly with Apple or Bat"}]
)

# This would always response with "Bat" as the guardrail denies all replies containing "Apple". The retry config would retry 5 times before giving up.
Request flow through Portkey's AI gateway with retries and guardrails

You can do a lot more stuff with configs in your AI gateway. Jump to examples →


Enterprise Version (Private deployments)

AWS   Azure   GCP   OpenShift   Kubernetes

The LLM Gateway's enterprise version offers advanced capabilities for org management, governance, security and more out of the box. View Feature Comparison →

The enterprise deployment architecture for supported platforms is available here - Enterprise Private Cloud Deployments

Book an enterprise AI gateway demo


MCP Gateway

MCP Gateway provides a centralized control plane for managing MCP (Model Context Protocol) servers across your organization.

  • Authentication — Single auth layer at the gateway. Users authenticate once; your

readme truncated — read the full docs on github

Frequently asked questions

Is Portkey AI Gateway free to use?

Portkey AI Gateway is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does Portkey AI Gateway do?

Complete production stack for AI teams

What is Portkey AI Gateway written in?

Portkey AI Gateway is primarily written in TypeScript. Its source is publicly available at https://github.com/portkey-ai/gateway, and it has 13,022 GitHub stars.