GPT-6 Builds Websites That Actually Look This Good...

TL;DR
Self-host LiteLLM or Kong, or use a managed gateway like Portkey, OpenRouter, or Cloudflare AI Gateway? A factual breakdown of cost, control, and ops tradeoffs.
Direct answer
Self-host LiteLLM or Kong, or use a managed gateway like Portkey, OpenRouter, or Cloudflare AI Gateway? A factual breakdown of cost, control, and ops tradeoffs.
Best for
Developers comparing real tool tradeoffs before choosing a stack.
Covers
Verdict, tradeoffs, pricing signals, workflow fit, and related alternatives.
| Source | What it covers |
|---|---|
| LiteLLM Documentation | Self-hosted proxy setup, routing strategies, budgets, and fallbacks |
| LiteLLM GitHub | Open-source codebase, provider integrations, deployment configs |
| Portkey AI Gateway | Managed gateway with guardrails, caching, and observability |
| Portkey Gateway GitHub | Open-source core of Portkey's gateway, self-hostable |
| OpenRouter Documentation | Hosted unified API for hundreds of models with fallback routing |
| Cloudflare AI Gateway Docs | Managed gateway on Cloudflare's edge network - caching, rate limiting, logs |
| Vercel AI Gateway Docs | Managed gateway pattern integrated with the Vercel AI SDK |
| Kong AI Gateway Docs | Self-hosted or Kong Konnect-managed gateway built on Kong's API gateway plugin model |
Last updated: August 22, 2026 Every team routing traffic to more than one model provider eventually hits the same fork in the road: run the gateway yourself, or hand it to a managed service. Both paths solve the same core problems - unifying provider APIs, tracking spend, failing over when a provider degrades - but they trade cost, control, and operational load very differently. This guide lays out the tradeoffs plainly so you can match the choice to your team size and constraints, rather than defaulting to whichever tool showed up first in a blog post.
If you want a side-by-side feature comparison of the tools themselves first, read LLM Routers Compared: LiteLLM vs Portkey vs OpenRouter in 2026. If you're trying to figure out how routing decisions map to actual invoice line items, see model routing recipes that cut AI spend.
An AI gateway sits between your application code and one or more model providers. It normalizes requests into a common format (usually OpenAI-compatible), then handles some combination of:
Every product in this category implements a different subset of that list. None of them implement all of it equally well, so the "which is best" question is less useful than "which tradeoff fits this team."
LiteLLM is the most common self-hosted choice. It ships as a Python SDK plus a proxy server you deploy yourself (Docker, Kubernetes, or bare metal), speaking the OpenAI format in front of 100+ provider integrations. Per the LiteLLM docs, the proxy handles routing, fallbacks, budgets, and rate limiting, and its GitHub repo is fully open source, so you can read or modify the routing logic directly.
Kong AI Gateway extends Kong's existing API gateway with AI-specific plugins (provider abstraction, semantic caching, prompt guardrails) per the Kong AI Gateway docs. Teams that already run Kong for regular API traffic get LLM routing as an additional plugin layer rather than a new system to operate, which is the main draw over LiteLLM for platform teams with existing API infrastructure.
Self-hosted tradeoffs:
From the archive
Jul 9, 2026 • 7 min read
Jul 8, 2026 • 7 min read
Jul 8, 2026 • 7 min read
Jul 8, 2026 • 6 min read
Portkey is a hosted gateway (with an open-source core on GitHub you can also self-host) that adds guardrails, semantic caching, and a request-observability dashboard on top of routing and fallbacks, per the Portkey docs.
OpenRouter is a hosted unified API in front of hundreds of models from every major lab, with automatic fallback and a single billing dashboard, per the OpenRouter documentation. It is the simplest option to integrate - one API key, one endpoint - but you are routing every request through OpenRouter's infrastructure and paying its per-token markup on top of underlying model pricing.
Cloudflare AI Gateway runs on Cloudflare's edge network and adds caching, rate limiting, and per-request logs in front of any model provider, documented at developers.cloudflare.com/ai-gateway. Teams already on Cloudflare's edge stack get this with minimal new infrastructure to reason about.
Vercel AI Gateway integrates directly with the Vercel AI SDK, documented at vercel.com/docs/ai-gateway, and is the path of least resistance for teams already deploying on Vercel who want provider-agnostic model calls without standing up separate infrastructure.
Managed tradeoffs:
Solo developer or small side project. Use a managed option - OpenRouter or Vercel AI Gateway if you're already on Vercel. Standing up and patching a self-hosted proxy for a project with light, sporadic traffic is rarely worth the operational overhead.
Small startup team validating a product. Managed gateways (Portkey, OpenRouter, Cloudflare AI Gateway) let you ship fast without hiring for infrastructure. Revisit the decision once monthly gateway spend or data-handling requirements grow enough to justify the switch.
Growth-stage team with steady, high-volume traffic. This is where self-hosting starts to pay for itself - LiteLLM's per-request cost is close to zero once deployed, and at scale that beats a vendor markup. Worth the switch once you have the engineering capacity to own the proxy's uptime.
Platform or infrastructure team already running Kong. Kong AI Gateway is the natural fit - it is an incremental plugin on infrastructure you already operate, not a new system.
Regulated industry or strict data residency requirements. Self-hosted (LiteLLM or Kong) gives you the clearest story for keeping data in-boundary, since nothing transits third-party infrastructure by default. If a managed vendor is still preferred, verify its data residency and retention commitments in writing before sending production traffic.
Team already deployed on Vercel or Cloudflare. Use the platform-native gateway (Vercel AI Gateway or Cloudflare AI Gateway respectively) before evaluating anything else - it removes an entire category of "new vendor to onboard" friction.
There is no universally correct answer. The honest framing is: managed gateways trade money and some data control for speed and zero ops burden; self-hosted gateways trade engineering time and on-call ownership for cost efficiency at scale and tighter data control. Match the choice to where your team actually is, not where you expect to be in two years.
The LiteLLM proxy and SDK are open source under the project's license, per its GitHub repository. Running it costs only your own infrastructure - compute, storage for logs, and the engineering time to deploy and maintain it. There is no per-request fee from LiteLLM itself.
It depends on the vendor's network placement and your own location relative to it. Edge-based gateways like Cloudflare AI Gateway are built specifically to minimize this by running close to the request origin. Always benchmark against your own traffic pattern before assuming any specific number, since network paths vary by region and provider.
Yes. Portkey's gateway core is open source on GitHub, so teams can self-host the routing and fallback logic while opting out of the managed dashboard, or use the hosted version for the added observability and guardrail features.
Any managed gateway that sits between your app and the model provider processes your request payloads, since that is how it applies routing, caching, and guardrails. Whether it stores that content, for how long, and under what terms depends on the vendor. Read each provider's data processing and retention documentation directly - do not assume based on the vendor's general reputation.
Neither is universally cheaper. Self-hosting removes vendor markup but adds infrastructure and engineering cost that only pays off at meaningful volume. Managed gateways add a markup but remove that overhead entirely. Model your own request volume and expected engineering hours before deciding; anecdotal comparisons from other teams' traffic patterns will not transfer cleanly to yours.
Read next
A practical comparison of LLM routing tools - LiteLLM, Portkey, and OpenRouter - covering cost management, fallbacks, caching, and when to use each for production AI applications.
10 min readA fair comparison of vLLM, TGI, SGLang, TensorRT-LLM, llama.cpp, and LMDeploy for self-hosted LLM inference - batching, quantization, hardware, and ops.
7 min readFable 5 posts an 80.3% SWE-Bench Pro score and costs 2x Opus 4.8 - here is the task-profile scoring guide that tells you when the premium pays off.
7 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
The easiest way to run LLMs locally. One command to pull and run any model. OpenAI-compatible API. 52M+ monthly download...
View ToolOpen-source OpenAI API replacement. Runs LLMs, vision, voice, image, and video models on any hardware - no GPU require...
View ToolHigh-throughput inference server for LLMs. PagedAttention memory management. The go-to for serious local or self-hosted...
View ToolOpen-source LLM engineering platform: tracing, evals, prompt management, and datasets. Self-hostable, OpenTelemetry-nati...
View ToolWatch your LLM spend tick up live, right in the editor.
View AppQueue and organize repeatable agent workflows before they become production automations.
View AppAuthor, test, score, and govern reusable AI agent skills before production registry.
View AppConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsStep-by-step guide to building an MCP server in TypeScript - from project setup to tool definitions, resource handling, testing, and deployment.
AI AgentsSet up Codex Chronicle on macOS, manage permissions, and understand privacy, security, and troubleshooting.
Getting Started
A practical comparison of LLM routing tools - LiteLLM, Portkey, and OpenRouter - covering cost management, fallbacks, ca...

A fair comparison of vLLM, TGI, SGLang, TensorRT-LLM, llama.cpp, and LMDeploy for self-hosted LLM inference - batching,...

An inside look at the gray-market relay economy that resells OpenAI, Anthropic, and Google API access at up to 97.8% off...

OpenRouter Fusion turns multi-model panels into an API feature. The useful lesson is not to run every prompt through mor...

Codex CLI 0.154.0 adds experimental worktrees, inline answers, Windows daemon support, and approval hardening. The impor...

A new code-editing paper finds full-file generation beating iterative diff edits on Flutter/Dart tasks. The useful takea...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.