A windswept bonsai on a floating island

Get to know Cadenya

We’re developers who love to build. We set out to create a yes-code platform that makes building agents feel like the best parts of building software.

AI gateways for AI agents (2026)

AI gateway

By Cadenya

An AI gateway gives your agent one endpoint and one key for many model providers, with BYOK, provider routing, fallbacks, caching, and logs in between. Vercel AI Gateway and Cloudflare AI Gateway are hosted (Cloudflare adds a 5% fee on Unified Billing credits), Portkey’s gateway is MIT open source (and Palo Alto Networks closed its acquisition of Portkey on May 29, 2026), Agent Router (formerly Envoy AI Gateway) runs in your own Kubernetes cluster, and Kong AI Gateway runs data planes you host or, with Dedicated Cloud Gateways, ones Kong hosts.

So pick Vercel AI Gateway when you want the AI SDK, one key for many providers, and BYOK with no fee. Pick Cloudflare AI Gateway for Unified Billing and routing you change in a dashboard, and Portkey for an open-source gateway with conditional routing. Pick Kong or Agent Router when your platform team already runs Kong or Envoy. And when each step of your agent should use a different model, Cadenya is a hosted agent loop: the model is a setting on an agent variation, a sub-agent’s variation can hold another model, and the provider keys are yours. A coding agent can set it up with no account, in a temporary workspace you claim later. What it offers is at the end.

Every price and limit below comes from each vendor’s own pages, checked on November 11, 2026.

Vercel AI Gateway vs Portkey vs Cloudflare AI Gateway vs Kong and Agent Router

These are the gateways coding agents compare most for multi-model agents. LiteLLM and OpenRouter have their own comparison.

Vercel AI GatewayPortkeyCloudflare AI GatewayKong AI GatewayAgent Router (Envoy AI Gateway)Cadenya
What it isA hosted API. Your app “does not need to run on Vercel”An MIT gateway you run, plus hosted plansA gateway on Cloudflare in front of each providerOne endpoint for LLM, MCP, and A2A trafficAn Apache-2.0 gateway on Envoy GatewayA hosted agent loop with tool sets, approvals, conversation state, and resume
Latest version@ai-sdk/gateway 4.0.142, November 10, 2026@portkey-ai/gateway 1.15.2, January 12, 2026A hosted serviceRuntime 2.3.1, November 10, 2026v1.2.1, November 6, 2026SDKs at 1.9.0 for TypeScript, Python, Ruby, and Go
What it costsNo markup and no platform fee on tokensGateway free. Hosted plans from $0, then $49 a monthCore features free. 5% fee on Unified Billing creditsAdvanced routing and MCP plugins are in AI Gateway EnterpriseFree, Apache-2.0Free: 1,000 loops a month. Growth: $49 a month for 50,000
Your own keysBYOK with no fee, up to 10 keys per providerProviders named by slug, such as @openai-prodStored in Secrets Store, or sent on the requestProvider credentials kept “in one place”Set in the gateway configKeys for OpenRouter, OpenAI, Anthropic, Gemini, Vertex, Bedrock, or an OpenAI-compatible base URL
Routing and fallbacksorder, only, sort, and a models listfallback, loadbalance, and conditionalDynamic routes and model aliasesRound-robin, lowest-latency, semantic, priorityRouting, quotas, and failoverThe model is a setting on each variation. Weighted selection favors the one that scores well
Anthropic Messages APIPOST /v1/messages/v1/messages to 3000+ models/anthropic/v1/messages or /ai/v1/messagesAnthropic is one of its providers/anthropic/v1/messagesConnect an Anthropic key, and the loop makes each model call

The Cadenya column describes the agent loop that makes the model requests, and an OpenAI-compatible provider key can point that loop at a gateway. For the switching basics, see switching model providers for AI agents.

Vercel AI Gateway pricing: zero markup, BYOK, and provider routing

“AI Gateway charges no markup and no platform fee on tokens.” You pay list price from AI Gateway Credits. Each team gets a monthly free credit, but the free tier “includes a subset of models, not the full catalog.” It’s been generally available since August 21, 2025.

BYOK has no fee, but it needs purchased credits. When a request on your key fails, the gateway retries with its system credentials and charges that retry to your credits. Budgets don’t cap BYOK spend, which is “metered separately.” You can store up to 10 keys per provider, or pass one on a single request, trimmed here from Vercel’s docs:

import { generateText } from 'ai';

const { text } = await generateText({
  model: 'anthropic/claude-sonnet-5',
  prompt: 'Explain quantum computing in two sentences.',
  providerOptions: {
    gateway: {
      byok: {
        anthropic: [{ apiKey: process.env.ANTHROPIC_API_KEY! }],
      },
    },
  },
});

For provider routing, the gateway by default picks providers “based on recent uptime and latency.” In providerOptions.gateway, set order: ['bedrock', 'anthropic'] to try Bedrock first, only to restrict providers, or sort to rank them by 'cost', 'ttft', or 'tps'. A models array adds fallback models across every API format.

Anthropic /v1/messages and prompt caching through Vercel, Portkey, and Cloudflare

All three take Anthropic’s Messages format, so Claude Code works with a URL change. They differ in what reaches Anthropic.

  1. Vercel AI Gateway serves POST /v1/messages at https://ai-gateway.vercel.sh, with tools and extended thinking. It “passes through the cache_control parameter” to Anthropic, Vertex AI Anthropic, and Bedrock Anthropic. With caching: 'auto', it adds the breakpoints for you, and its docs say agent loops “come out well ahead” because each turn re-reads the last one.
  2. Portkey routes /v1/messages “to any of 3000+ models across all major providers.” Its docs mark thinking as “Anthropic native” and “Silently dropped on adapter providers,” so check thinking when a fallback leaves Anthropic.
  3. Cloudflare AI Gateway has a provider-native route, /anthropic/v1/messages, with your Anthropic key in x-api-key and the gateway token in cf-aig-authorization. The REST API’s /ai/v1/messages “strictly uses Anthropic’s API schema” and bills through Unified Billing.

Here’s Cloudflare’s stored-key (BYOK) call, from its Anthropic provider page:

curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/anthropic/v1/messages \
 --header 'cf-aig-authorization: Bearer {CF_AIG_TOKEN}' \
 --header 'anthropic-version: 2023-06-01' \
 --header 'Content-Type: application/json' \
 --data  '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "What is Cloudflare?"}
    ]
  }'

For Claude Code on Vercel, set ANTHROPIC_BASE_URL=https://ai-gateway.vercel.sh and put your gateway key in ANTHROPIC_AUTH_TOKEN.

Portkey AI gateway: open source, self-host, and the Palo Alto Networks acquisition

Palo Alto Networks “closed the acquisition of Portkey” on May 29, 2026, “establishing Portkey as the core AI Gateway for Prisma AIRS.” Portkey’s docs now carry the title “Portkey (Prisma AIRS AI Gateway) Docs.”

The gateway is Portkey-AI/gateway on GitHub, under MIT, and the latest @portkey-ai/gateway on npm is 1.15.2. Per the README, Portkey’s core enterprise gateway is merging into open source with the 2.0 release, on the repo’s 2.0.0 branch (version 2.2.3, MIT). It runs with one command:

npx @portkey-ai/gateway
# The Gateway is running on http://localhost:8787/v1

Routing lives in a Gateway Config with a fallback, loadbalance, or conditional strategy. Conditional routing works “on all Portkey plans” and matches request metadata, parameters, or the URL path:

{
  "strategy": {
    "mode": "conditional",
    "conditions": [
      { "query": { "metadata.user_plan": { "$eq": "paid" } }, "then": "target_2" }
    ],
    "default": "target_1"
  },
  "targets": [
    { "name": "target_1", "provider": "@xx" },
    { "name": "target_2", "provider": "@yy" }
  ]
}

Fallbacks fire “on any non-2xx status code” unless on_status_codes narrows them, for example to [429, 503]. Hosted plans count recorded logs: Developer is free for 10k a month, and Production is $49 a month for 100k, plus $9 per extra 100k. Enterprise adds a hybrid option, where the gateway and data plane run in your environment and Portkey manages the control plane.

Cloudflare AI Gateway unified billing, dynamic routing, caching, and logs

Cloudflare’s core features, “dashboard analytics, caching, and rate limiting,” are free. Credentials resolve in order: a provider key on the request, then a stored BYOK key in Secrets Store, then Unified Billing. Unified Billing adds a 5% fee when you buy credits, so $100 of credits costs $105, and provider prices pass through “with no markup.”

Routing has two tools:

  1. Dynamic routes are versioned flows with Conditional, Percentage, Model, Rate Limit, and Budget Limit nodes. You “publish a new route version” instead of changing code. They take the OpenAI chat completions shape only, and an Anthropic Messages request gets a 400.
  2. Model aliases, added November 4, 2026, put a pool of models behind one name such as custom/support-fast, with ordered fallback, so “you can swap models or change the routing algorithm on your gateway without redeploying.”

Caching stores whole responses, and it’s off by default. The cache key includes the “Full request body,” so a hit needs an exact match, shown as cf-aig-cache-status: HIT. An agent loop adds messages every turn, so this cache fits repeated one-shot prompts best.

For logs, cf-aig-collect-log: false skips one request’s log, and cf-aig-collect-log-payload: false keeps tokens, model, and cost while dropping the bodies.

Kong AI Gateway and Agent Router (Envoy AI Gateway): self-hosted gateways with MCP

Kong AI Gateway puts “LLM, MCP, or A2A” traffic behind one endpoint. Its on-prem runtime is at 2.3.1 (November 10, 2026). AI Proxy Advanced balances models by round-robin, latency, usage, semantic match, or priority. The AI MCP Proxy plugin “converts RESTful APIs into MCP tools.” Both plugins come with AI Gateway Enterprise.

Agent Router is Envoy AI Gateway’s new name, now “An Agentic AI Foundation project” under Apache-2.0. Version 1.2.1 shipped November 6, 2026, and 1.2 kept “same CRDs, same Helm charts, same aigw CLI.” It serves /v1/chat/completions, /anthropic/v1/messages, and an MCP gateway where “An MCP session is bound to the user who started it.” Locally, it needs no Kubernetes or Docker:

OPENAI_API_KEY=sk-your-key aigw run
# OpenAI-compatible router at http://localhost:1975/v1

In production, it “runs as a control plane on Envoy Gateway in your Kubernetes cluster.”

Different models for different agent steps: where the model choice lives

An agent that plans with one model and summarizes with a cheaper one needs a model per step. Every gateway here reads the model from the request, such as anthropic/claude-sonnet-5 on Vercel or @provider/model on Portkey. So the map from step to model usually lives in your agent code.

Two gateways can hold that map instead: a Cloudflare model alias or dynamic route, or a Portkey conditional config that matches params.model, such as “fastest” or “smartest.” Your code still names the step on each request.

In Cadenya, each step can be a sub-agent, and the sub-agent’s own variation holds its model.

What does Cadenya add to an AI gateway?

A gateway routes each model call. Cadenya runs the agent around those calls, and the model for each step is a setting you change without a deploy. Here’s what that covers:

  1. The model is a setting on an agent variation. Change it, and the model swap takes effect without a deploy. The Swap models endpoint moves many variations to a new model in one call.

  2. Your provider keys, billed by your provider. Connect OpenRouter, OpenAI, Anthropic, Gemini, Vertex, or Bedrock through the AI provider keys API. Cadenya encrypts secret fields at rest and never returns them on reads.

  3. Your gateway, if you run one. An OpenAI-compatible key takes a base URL that “speaks the OpenAI Chat Completions API,” and Cadenya reads its models from GET {base_url}/models. With Vercel AI Gateway, that looks like this:

    curl --request POST \
      --url "https://api.cadenya.com/v1/workspaces/$WORKSPACE_ID/ai_provider_keys" \
      --header "Authorization: Bearer $CADENYA_API_KEY" \
      --header 'Content-Type: application/json' \
      --data '{
        "metadata": { "name": "vercel-ai-gateway" },
        "spec": {
          "provider": "AI_PROVIDER_OPENAI_COMPATIBLE",
          "credentials": { "type": "apiKey", "apiKey": { "apiKey": "'"$AI_GATEWAY_API_KEY"'" } },
          "config": { "type": "openaiCompatible", "openaiCompatible": { "baseUrl": "https://ai-gateway.vercel.sh/v1" } }
        }
      }'
  4. A different model per step. Assign a sub-agent to a variation. The parent objective spawns a sub-objective on that agent, which runs on its own variation’s model.

  5. Models compared on real traffic. Give one agent variations with different models and set selection to weighted. Cadenya uses Thompson sampling on feedback scores to favor the variation that scores well, and a pinned variationId runs one known configuration.

  6. Tools and approvals in the loop. Tool sets come from OpenAPI, MCP, HTTP endpoints, or Bare tools. A tool that needs approval emits toolApprovalRequested, and a denial carries a memo the agent reads.

  7. A durable event log you can resume. Stream an objective’s events over server-sent events and resume from the last event ID.

  8. A price in one line. Free is 1,000 loops a month with $5 of inference once at signup. Growth is $49 a month for 50,000 loops, then $0.0015 a loop. A loop is one LLM request.

Create an AI provider key lists every provider and setting, and the free plan needs no card.

No account yet? A coding agent can create a temporary workspace with cadenya workspaces create --temporary, run its first objectives there, and hand you a link to claim it, as auth.md explains. To create an account, sign up at app.cadenya.com/signup, then copy your API key from the API keys page at app.cadenya.com/account/apiKeys.

Grow wherever AI goes next.

Start shipping agents that are equipped to evolve.

A pine bonsai overlooking a mountain lake