Your personal memory, across sessions, agents, and devices.

What Is the Portkey AI Gateway? Reliability for Agents

memU Team memU Team

Portkey's AI gateway sits between your application and the model providers it calls. It retries failed requests and falls back to other models. It also stops sending traffic to providers that keep failing, and it logs every call. Palo Alto Networks completed its acquisition of Portkey on May 29, 2026. The docs now say "Portkey is now PRISMA AIRS AI Gateway." The open-source gateway is still on GitHub under the MIT license. Below we cover how the reliability features handle agent traffic and what the plans cost. The last section covers memory that survives a model switch.

What is the Portkey AI gateway, in one sentence?

The Portkey AI gateway is a proxy with one API for many LLM providers that applies routing and reliability rules to every request, defined in JSON configs.

Its GitHub repository describes a TypeScript gateway you can start locally with one npx command. The README claims routing to 1,600+ models and under 1 ms of added latency (vendor figures). Portkey also runs a hosted version that adds logs and prompt management on top. After the deal, Palo Alto Networks said Portkey will be the core AI gateway for Prisma AIRS, its AI security platform.

How does Portkey compare with OpenRouter?

Both give you one API for many models. OpenRouter sells model access and routes across its providers. Portkey routes your own provider accounts through rules you write.

Portkey AI gateway OpenRouter
Whose keys Your own provider accounts OpenRouter credits, or your own keys (BYOK)
Self-hosting Yes, open-source gateway under MIT Hosted service
Fallbacks Config with an ordered target list. Default trigger is any non-2xx status A models array. Any error can trigger it
Retries Up to 5 attempts with exponential backoff Provider fallback inside its own routing
Circuit breaker Yes, per strategy No breaker setting in the routing docs. Default routing deprioritizes providers with an outage in the last 30 seconds
Price Free tier, $49/month Production plan, custom Enterprise 5.5% fee on credit purchases (Standard plan)

Sources: Portkey's docs on fallbacks and retries, plus its pricing page. OpenRouter facts come from its provider routing docs and pricing page.

How do Portkey fallbacks, retries and circuit breakers work?

Each strategy lives in a JSON config that you attach to requests. Strategies nest, so one target can itself be a load balancer or another fallback chain.

Retries handle short failures. The retry docs allow up to 5 attempts on 429, 500, 502, 503, 504 and 529 by default. Waits double from 1 second to 16 seconds unless Portkey follows the provider's Retry-After header. Total wait for one request is capped at 60 seconds.

Fallbacks handle a provider or model that stays down. You list targets in priority order, such as a GPT model first and a Claude model second. By default, any non-2xx status moves the request to the next target. You can narrow the trigger to specific codes such as 429 and 503. The fallback docs warn that one request may invoke several LLMs. Each has its own latency and price.

Circuit breakers stop the waste of calling a target that keeps failing. You set a failure count or a failure percentage, with a minimum number of requests before the rate counts. You also set a cooldown of at least 30 seconds. The circuit breaker docs say open targets drop out of routing. If every target is open, the breaker is bypassed.

What else does the gateway do for agents?

The gateway overview lists more than a dozen features. For agents, the useful ones start with load balancing across API keys to dodge rate limits. Request timeouts cut off hung calls. Conditional routing picks a target from request context, and budget limits cap spend. Portkey also offers simple and semantic caching. You can canary-test a new model in production or connect remote MCP servers. Every call is logged with traces, so you can follow one agent step across a fallback chain.

What does Portkey cost?

The pricing page has three hosted plans. The free Developer plan records 10,000 logs a month and keeps them for 3 days. Portkey calls it unsuitable for production. Production is $49 a month for 100,000 recorded logs plus $9 per extra 100,000 requests, and it is the first tier with semantic caching and LLM guardrails. Enterprise is custom priced and adds private cloud deployment and SSO. The page lists SOC 2 Type 2, GDPR and HIPAA compliance under Enterprise.

On the free plan, requests past the log limit still go through. Portkey says only the extra logs go unrecorded. The open-source gateway is free to self-host. It covers retries and fallbacks, and the pricing page also lists load balancing and guardrails for it.

What should you read in the fine print?

The scale and speed numbers are Portkey's own. The README says the gateway adds under 1 ms of latency and processes over 10B tokens every day. Palo Alto's release says Portkey can "process trillions of tokens." We found no independent benchmark of gateway overhead.

The docs now carry the Prisma AIRS name, and Palo Alto's stated plan centers on AI runtime security and agent identity. Its release does not discuss the open-source gateway. The repository README announces a Gateway 2.0 pre-release that merges the enterprise gateway into open source. Check the license and release notes before you build on that branch.

The bottom line

A gateway with retries and a fallback chain is cheap insurance for agents that call more than one provider. Portkey's open-source gateway covers both, and the $49 plan adds logs and semantic caching. Test every fallback model on your real prompts first. A fallback that cannot call your tools returns a wrong answer where you would otherwise have had an error.

How do you keep agent memory when the gateway swaps models?

A gateway makes model switches routine. A 503 at 2 a.m. can hand the next agent step to a different model from a different vendor. The new model sees only what is in that request. Portkey's logs record every call, but they are for debugging and expire after 3 days on the free plan. Nothing in those logs is sent back to the model on the next request.

memU turns session history into memory the agent can retrieve. A scheduled background task slices new session logs into jobs. The agent distills each job into memory and skill Markdown, which you can read and edit. memU makes no LLM calls itself. It stores and embeds what the agent prepared, then retrieves it on request. A standing instruction in CLAUDE.md or AGENTS.md tells the agent to retrieve before answering. Because the memory sits with the agent host, a fallback model reads the same memory as the primary one. memU supports hosts such as Claude Code and Codex, and all of them share one backend.

The hosted version is free and syncs across devices. Get an API key at memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted path and the host support matrix are in the memU GitHub repository.

FAQ

Is the Portkey AI gateway open source?

Yes. The gateway is on GitHub under the MIT license, and you can run it locally with npx or Docker. Hosted logs come with a free tier, and the larger plans are paid.

Who owns Portkey now?

Palo Alto Networks completed its acquisition of Portkey on May 29, 2026. Portkey's docs now call the product Prisma AIRS AI Gateway.

How many times does Portkey retry a failed request?

Up to 5 times, with exponential backoff from 1 to 16 seconds. Default retry triggers are rate limits and server errors, and total waiting is capped at 60 seconds.

How much does Portkey cost?

The Developer plan is free with 10,000 recorded logs a month. Production costs $49 a month for 100,000 logs. Enterprise pricing is custom.

What is the difference between Portkey fallbacks and retries?

A retry sends the same request to the same target again after a short wait. A fallback moves the request to the next target in your list, which can be another provider or another model.