gateway
A blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
- 13.3k estrellas
- 1.4k forks
- 307 issues abiertos
- Lenguaje: TypeScript
- Licencia: MIT
- actualizado
Instalación
local · npxclaude mcp add gateway -- npx -y @portkey-ai/gateway{
"mcpServers": {
"gateway": {
"command": "npx",
"args": ["-y", "@portkey-ai/gateway"]
}
}
}{
"mcpServers": {
"gateway": {
"command": "npx",
"args": ["-y", "@portkey-ai/gateway"]
}
}
}- Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
- Replace any <placeholder> values with your API keys or paths.
- Restart Claude. The MCP server and its tools appear automatically.
Nota editorial
Portkey AI Gateway is an open-source TypeScript routing layer that sits between applications and over 250 LLM providers, exposing a single OpenAI-compatible API endpoint so developers can swap models without rewriting client code. It supports automatic retries, fallbacks, and load balancing across providers to reduce downtime, and includes more than 50 configurable guardrails for content safety and compliance. The gateway runs locally via a single npx command, weighs 122kb, and adds under one millisecond of latency. Its MCP Gateway feature adds enterprise-grade authentication and observability specifically for MCP server management, making it relevant to teams building Claude-powered agents through the Model Context Protocol. It also integrates with LangChain, LlamaIndex, and Autogen. The project claims to process over 10 billion tokens daily, which gives a sense of its production scale. Platform engineers, AI product teams, and developers who need provider redundancy or policy enforcement across multiple models are the primary beneficiaries.
Resumen de MCP Servers
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
Docs | Enterprise | Hosted Gateway | Changelog | API Reference
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.
[x] Blazing fast (<1ms latency) with a tiny footprint (122kb)
[x] Battle tested, with over 10B tokens processed everyday
[x] Enterprise-ready with enhanced security, scale, and custom deployments
What can you do with the AI Gateway?
Integrate with any LLM in under 2 minutes - Quickstart
Prevent downtimes through automatic retries and fallbacks
Scale AI apps with load balancing and conditional routing
Protect your AI deployments with guardrails
Go beyond text with multi-modal capabilities
Explore agentic workflow integrations
Manage MCP servers with enterprise auth & observability using MCP Gateway
Tip
Starring this repo helps more developers discover the AI Gateway 🙏🏻
Quickstart (2 mins)
1. Setup your AI Gateway
# Run the gateway locally (needs Node.js and npm)
npx @portkey-ai/gatewayThe Gateway is running on
http://localhost:8787/v1The 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.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
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 MCP servers receive verified requests
Access Control — Control which teams and users can access which servers and tools. Revoke access instantly
Observability — Every tool call logged with full context: who called what, parameters, response, latency
Identity Forwarding — Forward user identity (email, team, roles) to MCP servers automatically
Works with Claude Desktop, Cursor, VS Code, and any MCP-compatible client. Get started →
Core Features
Reliable Routing
Fallbacks: Fallback to another provider or model on failed requests using the LLM gateway. You can specify the errors on which to trigger the fallback. Improves reliability of your application.
Automatic Retries: Automatically retry failed requests up to 5 times. An exponential backoff strategy spaces out retry attempts to prevent network overload.
Lo que la gente pregunta sobre gateway
¿Qué es Portkey-AI/gateway?
Portkey-AI/gateway es mcp servers para el ecosistema de Claude AI. A blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API. Tiene 13.3k estrellas en GitHub y su última actualización registrada es del 2026-05-25.
¿Cómo se instala gateway?
Puedes instalar gateway clonando el repositorio (https://github.com/Portkey-AI/gateway) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar Portkey-AI/gateway?
Nuestro agente de seguridad ha analizado Portkey-AI/gateway y le ha asignado un Trust Score de 100/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.
¿Quién mantiene Portkey-AI/gateway?
Portkey-AI/gateway es mantenido por Portkey-AI. La última actividad registrada en GitHub es del 2026-05-25, con 307 issues abiertos.
¿Hay alternativas a gateway?
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega gateway en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Muestra su Trust Score en tu README
La insignia muestra el Trust Score y el veredicto actuales de este repositorio y enlaza a esta página. Sigue los datos del catálogo: nadie puede comprar ni editar la puntuación que enseña.
[](https://claudewave.com/en/repo/portkey-ai-gateway)<a href="https://claudewave.com/en/repo/portkey-ai-gateway"><img src="https://claudewave.com/api/badge/portkey-ai-gateway" alt="ClaudeWave Trust Score for Portkey-AI/gateway" width="320" height="64"></a>