> ## 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.

# Welcome to Portkey AI Gateway

> A blazing fast AI Gateway routing to 250+ LLMs with sub-1ms latency

<img src="https://cfassets.portkey.ai/sdk.gif" alt="Portkey AI Gateway Demo" />

## What is Portkey AI Gateway?

The **AI Gateway** is an open-source, lightweight solution designed for fast, reliable, and secure routing to 1600+ language, vision, audio, and image models. Built with Hono framework for TypeScript/JavaScript, it processes over **10 billion tokens daily** in production environments.

<CardGroup cols={3}>
  <Card title="Blazing Fast" icon="bolt">
    Sub-1ms latency with a tiny 122kb footprint
  </Card>

  <Card title="Battle Tested" icon="shield-check">
    Processing 10B+ tokens daily in production
  </Card>

  <Card title="Enterprise Ready" icon="building">
    Enhanced security, scale, and custom deployments
  </Card>
</CardGroup>

## Why Choose AI Gateway?

### Universal LLM Integration

Integrate with **any LLM in under 2 minutes**. The gateway provides a unified OpenAI-compatible API for 250+ models across 45+ providers including:

* OpenAI, Azure OpenAI, Anthropic Claude
* Google Gemini, AWS Bedrock, Cohere
* Together AI, Groq, Perplexity, Mistral
* Ollama, Hugging Face, and many more

### Production-Grade Reliability

<CardGroup cols={2}>
  <Card title="Automatic Retries" icon="rotate">
    Retry failed requests up to 5 times with exponential backoff
  </Card>

  <Card title="Fallbacks" icon="shield-halved">
    Automatically switch to backup providers on failures
  </Card>

  <Card title="Load Balancing" icon="scale-balanced">
    Distribute requests across multiple API keys or providers
  </Card>

  <Card title="Request Timeouts" icon="clock">
    Set granular timeouts to manage latencies
  </Card>
</CardGroup>

### Advanced Features

* **Guardrails**: Verify LLM inputs and outputs with 40+ pre-built guardrails
* **Multi-modal Support**: Text, vision, audio, image generation, and real-time APIs
* **Smart Caching**: Reduce costs and improve latency with response caching
* **Conditional Routing**: Route requests based on custom logic and conditions
* **MCP Gateway**: Centralized control plane for Model Context Protocol servers

## Quick Links

Get started with these essential resources:

<CardGroup cols={2}>
  <Card title="Quickstart Guide" icon="rocket" href="/quickstart">
    Make your first API call in under 5 minutes
  </Card>

  <Card title="Installation Guide" icon="download" href="/installation">
    Deploy the gateway with npx, Docker, or Node.js
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/routing">
    Learn about routing, configs, and providers
  </Card>

  <Card title="API Reference" icon="code" href="/api/overview">
    Explore the complete API documentation
  </Card>
</CardGroup>

## Key Capabilities

### Routing & Load Balancing

Distribute requests intelligently across multiple providers and API keys:

```python theme={null}
config = {
  "strategy": {
    "mode": "loadbalance",
  },
  "targets": [
    {"provider": "openai", "api_key": "sk-***", "weight": 0.7},
    {"provider": "anthropic", "api_key": "sk-ant-***", "weight": 0.3}
  ]
}

client = client.with_options(config=config)
```

### Guardrails

Protect your AI deployments with input/output validation:

```python theme={null}
config = {
  "retry": {"attempts": 5},
  "output_guardrails": [{
    "default.contains": {"operator": "none", "words": ["Apple"]},
    "deny": True
  }]
}

client = client.with_options(config=config)
```

<Tip>
  The retry config ensures requests are retried up to 5 times, while the guardrail denies any response containing "Apple".
</Tip>

### Multi-Provider Fallbacks

Automatically failover to backup providers:

```python theme={null}
config = {
  "strategy": {"mode": "fallback"},
  "targets": [
    {"provider": "openai", "api_key": "sk-***"},
    {"provider": "anthropic", "api_key": "sk-ant-***"}
  ]
}
```

## Architecture

The AI Gateway is built with:

* **Hono Framework**: Fast, lightweight web framework supporting multiple runtimes
* **Provider System**: Modular provider implementations with standardized interfaces
* **Middleware Pipeline**: Request validation, caching, logging, and routing
* **Plugin System**: Extensible guardrails for content filtering and validation

<Note>
  The gateway runs on multiple environments: Node.js, Cloudflare Workers, Docker, Kubernetes, and more.
</Note>

## Community & Support

<CardGroup cols={3}>
  <Card title="GitHub" icon="github" href="https://github.com/portkey-ai/gateway">
    Star the repository and contribute
  </Card>

  <Card title="Discord" icon="discord" href="https://discord.gg/portkey">
    Join our community for help
  </Card>

  <Card title="Twitter" icon="twitter" href="https://twitter.com/PortkeyAI">
    Follow for updates and tips
  </Card>
</CardGroup>

## Next Steps

<Steps>
  <Step title="Install the Gateway">
    Follow the [quickstart guide](/quickstart) to get the gateway running locally in 2 minutes.
  </Step>

  <Step title="Make Your First Request">
    Send your first API call to any LLM provider through the gateway.
  </Step>

  <Step title="Explore Features">
    Learn about [routing](/concepts/routing), [guardrails](/concepts/guardrails), and [caching](/concepts/caching).
  </Step>

  <Step title="Deploy to Production">
    Choose your [deployment method](/deployment/overview) for production use.
  </Step>
</Steps>

<Note>
  **Need Enterprise Features?** Check out our [enterprise version](/deployment/enterprise) with advanced security, governance, and compliance features.
</Note>
