Skip to navigation

Portkey Alternatives: When You Need Routing, Not a Platform

In short: Portkey alternatives for apps that only need retries, fallbacks and timeouts: a feature audit from its own docs, a fee calculator and a checklist (28 Nov 2026).

Published 25 min read
On this page

Portkey alternatives are worth a look when you signed up for retries and fallbacks and found a platform: logs, guardrails, prompt management, an MCP gateway and, since 29 May 2026, a Palo Alto Networks parent. This post does something the top results do not. It sorts every routing feature in Portkey’s own documentation by plan, prices the platform fee from the docs plan table, works out the worst-case wait of a retry-and-fallback config, and gives you a 12-item checklist to decide whether routing is all you need. We publish it on One AI API Key, so we are one of the alternatives, and we say where Portkey is the better choice. Every Portkey fact below was read on 28 November 2026 from a page listed in the sources.

What happened to Portkey, in dated facts

Four facts matter before you compare anything, and each one can be checked in a minute.

On 29 May 2026 Palo Alto Networks published a press release saying it had closed the acquisition of Portkey and would make it the core AI gateway of its Prisma AIRS security platform. On 28 November 2026 the portkey.ai home page carried a banner reading “Portkey is now PRISMA AIRS AI Gateway”, generally available for all enterprises, above the older headline about a production stack for gen AI builders. The pricing page answered with a permanent redirect (HTTP 308) to a Palo Alto Networks page with a contact form and no plan prices. And the docs, now titled Portkey (Prisma AIRS AI Gateway), still describe Dev, Pro and Enterprise plans in a feature comparison table.

Two more facts help. The open-source gateway is MIT-licensed with about 13,500 stars on the day we read it, and its most recent push was on 20 November 2026. Portkey’s own pages give three different counts of what it reaches: the docs introduction says over 250 models, the GitHub page says 1,600+, and the Palo Alto page says more than 3,000 LLMs, MCP servers and tools. They count different things, so treat any of them as marketing rather than a catalogue.

We do not know what the acquisition changes for people who already use the product, and we will not guess. The practical reading is narrower. If you are buying a plan today, the public pricing page no longer shows what you would pay, so get the terms in writing. If you only wanted routing, you now have a good reason to check whether you are paying for a platform you do not use. The side-by-side of plans, guardrails and team features is on our Portkey comparison page, and we do not repeat it here. This post covers the narrower question: which parts of Portkey are routing, which are platform, and what else can do the routing part.

Which Portkey features are routing and which are platform?

Portkey’s gateway docs list the routing features one page each, and most pages carry a plan note at the top. We read all of them. The table keeps only what each page states, with the plan note quoted as written, and adds one column of our own: whether an app that only calls models and wants them to keep answering needs the feature.

Feature What the docs say Plan note in the docs Routing-only app needs it?
Fallbacks An ordered list of targets; by default any non-2xx status triggers the next one; on_status_codes narrows it, for example to 429 and 503; targets can nest All plans Yes
Load balancing Weights across providers, models or several keys of one provider, normalised to 100 percent; optional sticky routing All plans Only with several keys or equal models
Automatic retries Up to 5 attempts; default codes 429, 500, 502, 503, 504, 529; backoff of 1, 2, 4, 8 and 16 seconds; optional Retry-After support All plans Yes
Request timeouts Milliseconds, set per request, per strategy or per target All plans Yes
Circuit breaker Stops sending to a target after a failure count or rate; cooldown of at least 30 seconds All plans Only at high volume
Conditional routing Picks a target from metadata, request parameters or the URL path All plans Sometimes
Simple cache Exact match on the whole request body All plans If you repeat identical prompts
Semantic cache (same page) Cosine similarity, default threshold 0.95, needs a vector database; requests under 8,191 tokens and at most 4 messages Select Enterprise plans (the plan table lists it under Pro and Enterprise) Rarely
Budget and rate limits per API key Cost or token caps, alert thresholds, weekly or monthly reset; rate limits per minute, hour or day Enterprise and select Pro If other people hold keys

Three things in that table are worth a second look. First, the five features most apps use (fallbacks, retries, timeouts, circuit breaker, conditional routing) are on every plan, including the free Dev plan, so routing is not what Portkey charges for. What the plan table separates is the platform around it: log retention of 3 days on Dev and 30 days on Pro, the request allowance, and the prompt, access-control and compliance rows.

Second, Portkey’s own pages disagree on semantic caching. The cache page says it needs select Enterprise plans; the plan table puts text in both the Pro and Enterprise columns. That is a small thing, and exactly the kind you only find by reading both pages. Ask before you plan around it.

Third, the per-key budget limit is the one control a team handing out keys needs most, and its page says it is for Enterprise and select Pro customers. Portkey’s Model Catalog also carries budgets and rate limits at the provider and workspace level, so the picture is not all or nothing, but a free-plan user should not assume a per-key dollar cap exists.

The docs menu also lists areas that are not routing at all: Observability, Model Catalog, MCP Gateway, Agent Gateway, Coding Agents, Prompt Studio, Guardrails and Administration. They are real products for the teams that need them. They are also the part you pay a platform for, so the useful question is which of them you open in a normal week.

What does the platform fee look like next to your volume?

Portkey’s plan table lists a free Dev plan for 10,000 requests a month with no overage allowed, a Pro plan at $49 a month for 100,000 requests, and $9 a month for every extra 100,000 up to 3 million requests. Beyond that it says custom Enterprise pricing. We assume each started block of 100,000 is billed, which is how we read “for every 100K”; confirm that when you buy. The fee is for Portkey itself. Tokens are billed separately, because Portkey stores your own provider credentials and your provider bills you.

The arithmetic for Pro is $49 plus $9 times the number of 100,000 blocks above the first one. At 1,000,000 requests that is nine blocks, so $49 + $81 = $130. At 3,000,000 it is 29 blocks, so $49 + $261 = $310.

Portkey Pro listed fee by monthly requests (docs plan table, 28 Nov 2026)

  • 10,000 (Dev plan)$0free, no overage allowed
  • 100,000$49
  • 500,000$85$49 + 4 blocks x $9
  • 1,000,000$130$49 + 9 blocks x $9
  • 2,000,000$220$49 + 19 blocks x $9
  • 3,000,000$310$49 + 29 blocks x $9; above this, custom pricing
Platform fee only, from the plan table in Portkey's docs. The pricing page no longer shows these figures, so treat them as the last published list, not a quote. Provider token costs are extra on top of every bar.

A flat fee is small next to a big token bill and large next to a small one. Put your own numbers in the calculator: it computes the listed Pro fee and shows it as a share of what you spend on tokens.

Platform fee against token spend

Token bill from your providers
$3,000.00
Portkey listed fee (Dev or Pro)
$130.00
Fee as a share of the token bill
4.3%
Which plan the table implies
Pro: up to 3 million with overage
One AI API Key platform fee
No seat fee; tokens at the published rate

Fee figures are the last published list in Portkey's docs plan table (read 28 November 2026). Above 3 million requests the fee shows as $0 because the docs give no number. On our side the pricing page lists no seat fee or subscription; compare the per-token rate of the model you use with your provider's own price page, because that rate, not a platform fee, is where the difference sits.

The honest reading is that for a team with a real token bill, $130 a month is noise and the question is features. For a hobby project with 200,000 requests a month, the same fee would be $58 for a layer that retries and falls back, which an SDK flag and a second model id also do. Our post on what gateways charge in fees lines up the other fee shapes: credit fees, markup and bring-your-own-key.

How long can a retry-and-fallback config keep your user waiting?

Retries and fallbacks protect uptime and cost latency, and few people add up how much. Portkey’s retry page gives the schedule: the first attempt is immediate, then the waits are 1, 2, 4, 8 and 16 seconds for retries one to five. The wait before giving up after n retries is therefore 2 to the power n, minus 1, seconds: 1, 3, 7, 15 or 31. That is on top of the time each attempt takes, and a timeout caps each attempt.

Take a config with 3 retries, a 10-second timeout and two fallback targets. On one target, if every try runs to its timeout, the worst case is 4 tries times 10 seconds plus 7 seconds of backoff, which is 47 seconds. If both targets fail the same way, 94 seconds pass before the user sees an error. That is longer than most chat clients wait, and a good reason to set the timeout from the client’s patience backwards.

Worst-case wait before an error

Backoff wait on one target (seconds)
7.00
Worst case on one target (seconds)
47.00
Worst case across the whole chain (seconds)
94.00
Against your client limit
Longer than your client waits

Assumes every try runs to the timeout and the same retry setting applies to each target. Backoff follows Portkey's retry page (1, 2, 4, 8, 16 seconds). Portkey's separate cap on cumulative Retry-After waiting (60 seconds, only when that option is on) is not modelled.

The same arithmetic applies to any gateway, ours included, and it is why our routing docs keep the retry count low (two on the named model) and let you set X-Request-Timeout yourself. A fallback chain that takes 94 seconds to fail is worse for a user than one that fails in 20 and says so. The post on surviving a provider outage works a full example, and the guide to 429 errors separates the three causes so you retry only the ones that retrying can fix.

Which of Portkey’s extras do you actually use?

Routing is a small part of a gateway that sells a platform. The checklist below lists twelve things that are not retries, fallbacks or timeouts. Tick only what you need in the next three months, not what sounds nice. The result tells you whether routing is enough.

Tick what you need beyond retries, fallbacks and timeouts

0 of 12 needed

Routing is enough

Use SDK retries plus a fallback header or a small hosted gateway. A platform would be mostly unused.

If you ticked nothing or one item, the rest of this post is for you. If you ticked six or more, skip to the part on when Portkey is still the right call. We would rather lose that reader here than have them discover the gap in production.

What are the options for routing without a platform?

Think of three routes before you think of a vendor: let the SDK retry, use a hosted gateway that routes, or run an open-source gateway yourself. They differ in what they ask of you.

The SDK you already use. The official OpenAI Python SDK, per its README, retries connection errors, 408, 409, 429 and 5xx responses twice by default with a short exponential backoff, and times out after 10 minutes unless you set a shorter limit. That covers a flaky minute at one provider with no extra component. It does not cover a provider being down for an hour, because there is nothing to fall back to. Our guide to switching an OpenAI app to another base URL shows how little changes if you later put a gateway in front.

A hosted gateway that routes. You send one request to one endpoint, and the gateway owns the list of fallback targets and the timeout. OpenRouter documents a models array that tries the next model when the first one’s providers are down, rate-limited or refuse. Cloudflare AI Gateway says its core features, including caching and rate limiting, are free on all plans, with a 5 percent fee on credits bought through its Unified Billing. And our own gateway, covered below, offers fallbacks, virtual models and per-key limits with no seat fee. The posts on Cloudflare alternatives, Vercel alternatives and Requesty alternatives go deeper on each.

A gateway you run yourself. Portkey’s open-source gateway starts with one npx command or in Docker. LiteLLM’s router documents cooldowns, fallbacks, timeouts and retries with fixed or exponential backoff across several deployments, and notes that Redis tracks cooldowns in production. You get your own keys, your own network and your own configs. You also get the pager: updates, uptime, secrets handling and a database if you want logs. The LiteLLM alternatives guide puts numbers on that ops time, and LiteLLM versus a hosted gateway shows where the break-even sits.

Option Routing features in its own docs Platform fee in its own docs Who runs it
Provider SDK alone Retries (2 by default) and a timeout; no fallback target None You
Portkey hosted Fallbacks, load balancing, retries, timeouts, circuit breaker, conditional routing Dev free; Pro listed at $49 a month; pricing page redirects Palo Alto Networks
Portkey open source The same routing features as a self-run gateway (MIT) None for the software You
LiteLLM router Cooldowns, fallbacks, timeouts, retries, load balancing See its docs for hosted and enterprise terms You
Cloudflare AI Gateway Fallbacks with a response header showing the step used; caching; rate limits Core features free; 5 percent on Unified Billing credits Cloudflare
OpenRouter A models array of fallbacks See our fee comparison OpenRouter
One AI API Key (publisher of this post) Two retries, up to 3 fallbacks, virtual models, timeout header, per-key limits No seat fee; per-token rates at /models One AI API Key

We disclose the last row: we publish this post, and every cell for the other rows comes from the row’s own documentation, read on 28 November 2026. For a wider table with nine options and a criteria picker, see our nine-gateway comparison for 2026; for OpenRouter specifically, the OpenRouter alternatives post and the OpenRouter comparison page cover it.

Routing or platform: four questions

Only retry, fallback, timeout?SDK retries or a fallback header cover itOwn provider keys or contracts?Yes: self-host Portkey OSS or LiteLLMNeed teams, SSO, audit, SLA?Yes: Portkey Enterprise or a peerWant one key and one bill?A hosted gateway, ours included
Answer from the top and stop at the first yes. Most single-product apps stop at the first or fourth question.

How does the same routing look on our gateway?

Here is a routing config in the shape Portkey’s docs show, using placeholders for the providers and models. It falls back on four named status codes, retries three times and times out each try after 10 seconds.

Portkey-style config (sketch from the docs' shapes)
{
  "strategy": { "mode": "fallback", "on_status_codes": [429, 500, 502, 503] },
  "retry": { "attempts": 3 },
  "request_timeout": 10000,
  "targets": [
    { "provider": "@provider-a", "override_params": { "model": "model-a" } },
    { "provider": "@provider-b", "override_params": { "model": "model-b" } }
  ]
}

And here is the closest equivalent on One AI API Key: the same request with two headers, using free ids so you can run it without a balance.

curl: fallback chain and timeout, free ids
export ONEAIAPIKEY_API_KEY="paste-your-key-here"

curl https://api.oneaiapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $ONEAIAPIKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Fallback-Models: glm-4.7-flash:free, z-ai-glm-5.3-flash:free" \
  -H "X-Request-Timeout: 10000" \
  -d '{
    "model": "deepseek-v4-flash:free",
    "max_tokens": 60,
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'

The gateway first retries the model you named, up to twice, when the provider fails before sending any part of the answer (a 429, a 5xx or an unavailable model). Then it tries the ids in X-Fallback-Models, up to three, in order. A reply from a fallback model carries X-Fallback-From naming the one that failed, and the model field names the one that answered. Only the attempt that answers is billed. If an error arrives after the answer has started streaming, it is passed on as it is. All of that is in the routing docs, and the headers reference lists every request and response header.

A request on our routing layer

Key and limit checkenabled, not expired, inside the spend limitForward to the named modelretried up to twice on 429, 5xx, outageFallback chainup to 3 ids from X-Fallback-ModelsAnswer, one usage recordonly the answering attempt is billed
Source: the routing and privacy docs. A failing :free call is also retried on another free model by the gateway itself, so free ids can answer from a different model than you named; check the model field.

The mapping is partial, and the table says where.

Portkey config On One AI API Key What differs
strategy.mode: fallback with targets X-Fallback-Models, up to 3 ids; or a default fallback set in the console Ours switches model ids only, never provider accounts
retry.attempts up to 5 The named model is retried up to twice The count is fixed here
on_status_codes 429, 5xx and unavailable model trigger it Not configurable here
request_timeout X-Request-Timeout, 1,000 to 600,000 ms, answers 408 For a stream it is the time to the first chunk
Conditional routing A virtual model with rules read from X-Metadata; first match wins Chains of up to 3 models per rule
Load balancing weights A canary sends 1 to 50 percent of requests to one model first Not a weighted spread across targets
Circuit breaker None documented You would add it in your own client
Simple or semantic cache Not offered at the gateway; provider prompt caching is billed at the cached rate where the model supports it See prompt caching
Per-key budget and rate limits Per-key spend limit, expiry date, model list and a requests-per-minute limit A hard stop, not a weekly or monthly reset

If a row in the middle of that table is the reason you use Portkey, that is your answer: stay, or self-host its open-source gateway. If the rows you use are the first, fourth and last, you can move in an afternoon. The OpenAI-compatible base URL is the only code change, and the chat completions reference lists the request fields, including the timeout header.

What about budgets, guardrails and the other controls?

A routing-only app still needs a way to stop a loop from spending the month’s budget. That is the control we would look at first, and the one where free plans on gateways tend to be thinnest.

On Portkey, the per-key budget page describes a cost or token cap with alert thresholds and weekly or monthly resets, available on Enterprise and select Pro. On One AI API Key, every key can carry a dollar spend limit, an expiry date, a list of allowed models and a requests-per-minute ceiling, set in the console at no extra cost. The authentication docs explain each. Once the limit is spent the key returns 401 like a disabled key, and while some limit remains but less than the up-front cost estimate, a request fails with 403, so a key that runs long agent sessions needs headroom. The post on six caps that stop a runaway agent bill puts a cost on a loop and shows where each cap bites, and the cost control docs cover the rest.

Guardrails are a place where Portkey is clearly deeper. Portkey’s plan table lists deterministic guardrails, partner guardrails and LLM-based guardrails with PII and PHI redaction. Ours are per key and pattern-based: secret detection, prompt-injection phrases, source-code detection and up to ten custom rules, each in log or deny mode, plus PII redaction for emails, phone numbers, card numbers, IBANs, IP addresses and US social security numbers. A denied request is not sent upstream and not billed. They check the text you send, not an AI judgement of the answer, and the routing docs say so plainly. If you need classifier-grade checks on model output, that is a Portkey strength and not one we match.

Logs are the third control. Portkey’s plan table lists 3 days of log retention on Dev and 30 days on Pro, with traces, feedback, custom metadata and filters. Ours is a usage page with one record per request (model, key name, token counts, cost, timing and request id), exportable as CSV. Prompts and answers are not stored by default; the privacy docs and the guide to what a gateway sees and stores list the opt-in exceptions. If you debug production by reading prompts and answers in a log viewer, an observability product such as the one Portkey bundles is the better tool. Our post on Helicone alternatives explains the observability versus gateway split.

What do you give up by leaving Portkey?

Be clear about what a thin gateway does not have, because that is where people get surprised later.

  • Bring your own keys. Portkey stores credentials for your provider accounts and routes through them. We do not offer that: one prepaid balance pays for everything. If you have committed spend or negotiated rates with a provider, this alone is a reason to stay.
  • Self-hosting. Portkey’s gateway can run in your network under an MIT licence. Ours is hosted only.
  • Teams. Portkey lists role-based access, team management and audit logs. We have one account with many keys and an account activity log, and no SSO. Governance across an organisation is a clear Portkey win.
  • Breadth of controls. Semantic cache, circuit breaker, weighted load balancing, prompt templates and an MCP gateway exist there and not here.
  • A vendor you can put on a contract. Palo Alto Networks sells to enterprises with the paperwork that implies. We are a small prepaid service; the transparency page says what we monitor and what we cannot see, and the one AI API key review sets out what the service gives and does not give.

What you gain is smaller and more specific. One key and one balance for many models. A published per-token rate for each model on the models page, with an up-front status for each model. A free lane of 48 ids sharing 100 requests and 3,000,000 tokens a day, which works at a $0 balance. A sign-up credit of $10 for priced models, by Google sign-in with no card field. And the controls above on every key with no plan to upgrade to. For a small app that is mostly the whole story, and for a big organisation it is not enough, which is the reason both kinds of product exist. The post on one key for every model and what you trade lists the costs of that shape: a network hop, trust, key blast radius and model naming.

When is Portkey still the right call?

Several of the readers who land here should stay, and a couple should self-host. This picker puts each situation next to the option we would try first.

Which of these sounds like you?

I call one provider and only fear outages

Start with the SDK's own retries and add one fallback model id behind a gateway. A fallback header on One AI API Key or a models array elsewhere is enough. Put a timeout on every call; the uptime and fallbacks guide shows the pattern.

I run agents that can loop

Your first need is a cap, not a router. Set a spend limit and a requests-per-minute ceiling on each key, a timeout on each call and a max_tokens on each request. The runaway-bill guide has the numbers, and our cost control docs show where each setting lives.

I need teams, SSO and audit logs

That is the platform case. Portkey Enterprise or a peer is the right shape, and a thin hosted gateway is not. Read the Portkey comparison and the 10 data-processing questions before you sign.

I have my own provider keys and want to keep them

Self-host. Portkey's open-source gateway and LiteLLM both route through your own accounts. Budget the ops time honestly, and keep your routing config portable using the exit-plan guide.

I want one key for many models and a free way to try it

Try ours without paying: sign in with Google, send the probe script below on free ids and read the headers. If it fits, the pricing page shows how credit is added by email today. Online checkout is not open yet.

How do you test any routing layer for free?

You do not have to trust a feature list, ours or Portkey’s. A routing layer either switches models and reports it, or it does not, and you can see which in a few minutes.

  1. Make it show its work. Look for a response header or field that says which target answered. On ours it is the model field plus X-Fallback-From. Cloudflare documents a step header for its fallbacks. If a gateway hides which model answered, you cannot audit it.
  2. Turn the SDK’s own retries off. Otherwise you will credit the gateway for what your client library did. The probe below sets max_retries=0 for that reason.
  3. Set a short timeout and watch the status. On ours a timeout answers 408 with the code request_timeout; check that your platform does something equally explicit.
  4. Compare billing with usage. After a fallback, the usage page should show one answered attempt and a cost that matches the model named in the reply. The token billing audit shows how to check this against your own token counts.
  5. Read the status page. A routing layer you cannot see the health of is a black box. Ours is at /status, and the status page checklist grades any provider’s.
Probe: which model answered, and what failed first
import os, time
import openai
from openai import OpenAI

# max_retries=0: the SDK must not hide what the gateway does
client = OpenAI(base_url="https://api.oneaiapikey.com/v1", api_key=os.environ["ONEAIAPIKEY_API_KEY"], max_retries=0)

for i in range(5):
    t0 = time.time()
    try:
        raw = client.chat.completions.with_raw_response.create(
            model="deepseek-v4-flash:free",
            max_tokens=20,
            messages=[{"role": "user", "content": "Reply with one word."}],
            extra_headers={
                "X-Fallback-Models": "glm-4.7-flash:free, z-ai-glm-5.3-flash:free",
                "X-Request-Timeout": "10000",
            },
        )
        reply = raw.parse()
        print(i, "answered by", reply.model, "| failed model:", raw.headers.get("X-Fallback-From"),
              "| request id:", raw.headers.get("X-Request-Id"), "|", round(time.time() - t0, 2), "s")
    except openai.APIStatusError as e:
        print(i, "HTTP", e.status_code, "after", round(time.time() - t0, 2), "s")

Five requests of 20 tokens spend 5 of the 100 daily free requests and a negligible share of the 3,000,000-token allowance. If a free model is failing, you will see a different model in the answered by column, and X-Fallback-From will name the one that did not. The 8-test protocol extends this to token counts, streaming, tool calls and a support reply, and the guide to verifying that an API serves the model it names is the companion check for identity. For the reseller question underneath all of this, why cheap resale carries risk lists the patterns to watch for.

How do you start here?

Start with what costs nothing, and keep what you built portable.

  1. Sign in with Google on the sign-up page. There is no card field, and the account gets $10 of credit for priced models plus the 48 free ids.
  2. Create a key in the console, add a spend limit and an expiry date, and put the key in an environment variable. The quickstart shows the first call.
  3. Run the probe above on free ids, then open the usage page to see the records.
  4. Keep your routing in headers or in a small config you own. If you later need a platform, you can move; if you later need a router only, you already have one.

The status page, the transparency page and the public usage rankings show what the gateway measured, not what we claim. Paid use is by prepaid credit added by email today, so read the prepaid credits guide before you top up, and the free LLM API comparison for how our free lane stacks against other published free tiers. For ways to cut the token bill itself, 10 tactics to reduce LLM API costs applies whichever gateway you use, and the free models page lists every free id.

Test the routing layer before you decide anything

$10 sign-up credit, 48 free models sharing 100 requests and 3,000,000 tokens a day, no card.

Frequently asked questions

What is the closest free alternative to Portkey?
It depends on what you use. For retries, fallbacks, load balancing and conditional routing, Portkey's own open-source gateway is MIT-licensed and free to run, and you pay in operations time instead of fees. Cloudflare AI Gateway says its core features are free on all Cloudflare plans. On One AI API Key, retries, fallback headers and per-key limits cost nothing extra and the 48 free ids need no card; see the Cloudflare comparison for what that product does not do.
Is Portkey still an independent company?
No. Palo Alto Networks announced on 29 May 2026 that it had closed the acquisition, and portkey.ai now presents the product as Prisma AIRS AI Gateway. The Portkey comparison page has the dated side-by-side, and the post on a similar acquisition at OpenRouter gives a what-to-watch checklist that applies here too.
Is the Portkey open-source gateway still maintained?
The repository is public under the MIT licence, and on 28 November 2026 its most recent push was on 20 November 2026. That is a snapshot, not a promise. Read the commit history and the open issues yourself before you build on it, and keep your routing config in a form you could move; the exit-plan guide shows how.
Do I need a gateway for retries and fallbacks at all?
For retries, often not. The official OpenAI Python SDK retries connection errors, 408, 409, 429 and 5xx responses twice by default. A fallback is different: it needs a second model or provider to fall back to, which is what a gateway holds for you. The gateway versus direct API guide works through when each wins.
Does One AI API Key have load balancing or bring-your-own-keys?
No to both. One prepaid balance pays for every model, so there are no provider keys of yours to balance across, and a weighted split across several targets does not exist here. A canary sends 1 to 50 percent of requests to one model first, which covers gradual rollouts but not weighted spreading. If you hold provider contracts or negotiated rates, a self-hosted gateway such as the LiteLLM family or Portkey's open-source one fits better.
How much does Portkey cost?
Portkey's docs plan table lists a free Dev plan (10,000 requests a month, no overage), a Pro plan at $49 a month (100,000 requests, then $9 a month for every extra 100,000 up to 3 million) and custom Enterprise pricing. On 28 November 2026 portkey.ai/pricing redirected to a Palo Alto Networks page, so confirm the terms in writing before you rely on those figures. The calculator above turns them into a monthly fee for your volume.
Does a fallback bill me twice?
Here, no: only the attempt that answers is billed, as the routing docs state. On other gateways, check. Portkey's fallback page warns that a single request may invoke multiple LLMs, and its retry page says retry attempts are not logged individually, so look at your provider's own bill as well as the gateway's logs.
Can I move a Portkey routing config to your headers?
Partly. A fallback list of up to three model ids maps to X-Fallback-Models, a per-request timeout maps to X-Request-Timeout, and conditional routing maps to virtual-model rules. Switching between provider accounts, weighted load balancing, a circuit breaker and configurable retry counts do not map. The mapping table above lists each row.
How do I test a routing layer without spending money?
Use free ids and read the response headers. The probe script above sends five tiny requests and prints which model answered, which model failed first and the request id. The 8-test free protocol covers identity, token counts, streaming and billing movement, and the DeepSeek outage fallback guide shows a worked fallback setup.
More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
Claim $10 credit →