LLM API vendor lock-in is the cost of leaving a provider, and it is usually hidden in code that works today: a model id repeated in forty files, a prompt tuned to one family’s habits, a tool schema in one vendor’s shape, a conversation stored on someone else’s server. This post gives you four things the top results for the keyword mostly skip. A dated table of how much notice three providers say they give before retiring something. A six-layer map of where lock-in sits. A calculator that puts hours and dollars on the cost of leaving. And a 30-minute switch drill with a script you can run today (we tested it against a local mock endpoint, you point it at two real routes). One AI API Key is a gateway and we publish this post, so one section shows how to leave us too.
What does vendor lock-in mean for an LLM API?
Lock-in is not “using one provider”. Using one provider is fine, and for many projects it is the right call. Lock-in is the gap between how fast you can leave and how fast you may have to. When the two are close, you are free. When leaving takes six weeks and a provider gives you four, you are locked in.
Two kinds of exit matter. A chosen exit happens because a rival is cheaper, faster or better at your task. A forced exit happens because something changed under you: a model retired, a price moved, terms changed, a service went down for a day, an account was suspended, or the company behind a tool was bought. You can postpone a chosen exit forever. You cannot postpone a forced one, and it is the forced exit that an exit plan is for.
The rest of this post assumes a small team with a real app: a few call sites, a prompt file or two, maybe a tool-calling agent. If you run a coding agent rather than your own app, the posts on single-model-family lock-in in coding agents and moving agent context to another provider apply the same ideas to that case. If you are a startup picking a provider now, choosing a provider you can leave covers the stage-by-stage choices.
Where does lock-in hide? Six layers
We found it useful to stop thinking of “the API” as one thing. A call crosses six layers, and each one ties you in differently. The table lists them from easiest to hardest to move.
| Layer | What ties you in | Portable form | How you notice it broke |
|---|---|---|---|
| 1. Endpoint and key | Base URL and key pasted into code or a vendor SDK | Env vars read in one module | Connection or 401 error |
| 2. Model ids | Ids hard-coded in files, names that mean different things per provider | Alias map: role to id per route | 404 or a silent change of model |
| 3. Prompts | Wording tuned to one family, prompts stored only in a vendor dashboard | Prompt files in your repo plus a golden set | Quality drops, no error |
| 4. Tools and output shape | Tool schemas in one shape, trust in a strict-output flag | One JSON Schema file, adapters, your own validation | Malformed arguments or parse errors |
| 5. State | Conversations, files or objects kept server-side | Your own message history and files | A feature disappears at shutdown |
| 6. Money and counting | Prepaid balance, tokenizer differences, per-provider limits | Budgets in dollars, spend-down habit, usage exports | A bill that does not match the estimate |
The pattern to see is that layers 1 and 2 fail loudly and cheaply, while 3 to 6 fail quietly. A wrong base URL gives you an error in the first minute. A prompt that scores 8% worse on the new model gives you nothing until a customer complains. That is why the drill later in this post replays prompts and checks tool calls, not only connectivity.
How much notice do providers give before they retire something?
We read the three public deprecation pages on 28 November 2026. The numbers below are what each page says, not what we have experienced.
| Source | What it states | What it means for your plan |
|---|---|---|
| OpenAI deprecations | At least 6 months for generally available models, at least 3 months for specialised variants and image models, possibly 2 weeks for previews; faster only for safety or compliance reasons | Build the alias map so a six-month window is one afternoon of work |
| OpenAI, Assistants API row | Notice dated 26 August 2025, shutdown 26 August 2026, replacement named as the Responses and Conversations APIs | A whole feature, not a model, went away after 12 months |
| OpenAI, reusable prompt objects | Notice dated 3 June 2026, shutdown 30 November 2026 (180 days), advice to move prompt content into your application code | Prompts that live only in a vendor dashboard are a dependency |
| Anthropic model deprecations | At least 60 days notice before retiring publicly released models; a usage export by API key and model to find deprecated ids you still call | The shortest stated floor of the three: 60 days |
| Google Gemini deprecations | Listed shutdown dates are the earliest possible dates, with the exact date confirmed in advance; one retired Flash id is not shut down but routes automatically to its successor | An id can keep working while the model behind it changes |
Two of those rows deserve a second look. The Assistants API row is the cleanest example of lock-in in this market: an object model and server-side state that took teams months to adopt, retired with a documented 12 months of notice (26 August 2025 to 26 August 2026 is 365 days). The notice was generous and some teams still scrambled, because the work was rewriting state handling, not changing a string. And the reusable-prompt row shuts down on 30 November 2026, two days after we read the page. OpenAI’s own advice on that page is to put prompt content in your application code, which is the portable form this post argues for anyway.
The Gemini row is the subtle one. When an id automatically routes to a successor, your code keeps running and your outputs change. Nothing errors. That is a reason to log the model field of every reply, which the usage snippet later in this post does, and to pin dated ids where a provider offers them.
Minimum stated notice before retirement, in days
- OpenAI, preview models14the page gives 2 weeks as an example, not a floor
- Anthropic, public models60
- OpenAI, specialised variants903 months
- OpenAI, generally available1806 months
A practical reading: if your switch takes longer than the shortest notice you depend on, you are exposed. With a 60-day floor and a switch that costs three weeks of someone’s time, you can survive one forced exit at a time and not two at once. The calculator further down puts a number on your own case. The OpenAI page also says you can watch for shutdowns programmatically: the list-models call can return an optional shutdown_date on each model, so a nightly job against a provider that fills the field is cheap insurance. Not every route fills it, so check yours before you rely on it.
Layer 1: how do environment variables keep the endpoint portable?
The Twelve-Factor App states the rule plainly: store config in the environment, and keep config strictly separate from code, because config changes between deploys and code does not. A provider is config. The base URL, the key and the model ids are all things that vary by route.
The smallest useful version is a profile file with a named set of values per route. Profile A is where you run today; profile B is the route you would move to. Both live in your environment, never in source control.
# .env (never committed; load it from your secret store in production)
LLM_PROFILE=A
LLM_A_BASE_URL=https://api.oneaiapikey.com/v1
LLM_A_API_KEY=paste-your-key-here
LLM_B_BASE_URL=https://PROVIDER_B_HOST/v1
LLM_B_API_KEY=paste-the-second-key-hereThe OpenAI and Anthropic SDKs both accept a base URL, so this works without a wrapper library. The guide to switching an OpenAI SDK app to a different base URL covers the SDK-specific settings, and our migration docs list the environment variables for both formats. The Anthropic-format base URL has no /v1 on the end because the SDK adds it, a difference that bites exactly once per team.
Keys belong in a secret store, one per project and per route, with their own spend limit. Our guides to API key security for AI apps and one key per project with spend limits walk through it, and if a key does leak, the first-hour checklist tells you what to rotate in what order. A second key on a second route is also your blast-radius control: a leak on one profile does not touch the other.
Layer 2: what is a model alias map?
Application code should say what a call is for, not which model does it. An alias map turns a role such as fast or smart into an id per route. When a provider retires an id, you edit one JSON file.
{
"fast": { "A": "deepseek-deepseek-v4.1-flash:free", "B": "MODEL_ID_AT_B" },
"smart": { "A": "z-ai-glm-5.3:free", "B": "MODEL_ID_AT_B" },
"cheap": { "A": "deepseek-v4-flash:free", "B": "MODEL_ID_AT_B" }
}# llm_config.py: the only file that knows which provider is behind a call
import json, os
from openai import OpenAI
PROFILE = os.environ.get("LLM_PROFILE", "A")
ALIASES = json.load(open("model-aliases.json"))
def client() -> OpenAI:
return OpenAI(
base_url=os.environ[f"LLM_{PROFILE}_BASE_URL"],
api_key=os.environ[f"LLM_{PROFILE}_API_KEY"],
)
def model(role: str) -> str:
return ALIASES[role][PROFILE]from llm_config import client, model
reply = client().chat.completions.create(
model=model("fast"),
max_tokens=300,
messages=[{"role": "user", "content": "Summarise this ticket in one line."}],
)
# log what answered, not what you asked for: a provider-side alias can change under you
print("role=fast answered_by=%s tokens=%s" % (reply.model, reply.usage.total_tokens))Three habits make the map earn its keep. Give every role an entry for every profile, even if profile B is a placeholder you have not tested; an empty cell is how a forced exit turns into a scramble. Use roles that describe work (fast, smart, long-context, code) rather than model names, because a model name in a role defeats the point. And log the model that answered, as the snippet does, so a silent change like the Gemini auto-route shows up in your logs.
Model ids themselves differ between providers and gateways. The same underlying model can carry a different id on each route, and we wrote a separate post on why model names drift between gateways. Look ids up in the route’s own list. On ours, GET /v1/models with your key returns what your key can call, and the model list shows every id with its page. The ids in the example above are free-lane ids at the time of writing, and free lists move: on 25 November 2026 we removed 11 ids from our own free lane because the gateway log showed no successful request for them in 24 hours. An alias map is how you survive that, on any provider.
Can the gateway hold the alias map for you?
Partly. Two features of ours cover the failure case without changing your code. The first is the X-Fallback-Models header: up to 3 model ids, tried in order when the provider fails before it starts answering. A reply from a fallback carries X-Fallback-From naming the model that failed, and only the attempt that answers is billed. The routing docs have the exact rules and the headers reference lists the rest.
curl https://api.oneaiapikey.com/v1/chat/completions \
-H "Authorization: Bearer $ONEAIAPIKEY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Fallback-Models: deepseek-deepseek-v4.1-flash:free" \
-d '{
"model": "z-ai-glm-5.3:free",
"max_tokens": 100,
"messages": [{"role": "user", "content": "Reply with the word OK."}]
}'The second is a virtual model: in the console under Models, then Routing, you can give a chain of up to 3 models a name of your own and send that name as the model. It is convenient and it is also lock-in of a mild kind, because the name exists only on our side. Keep a copy of every virtual model’s chain in your own alias map, so leaving us does not mean reconstructing it from memory. The uptime and fallbacks guide and the post on keeping an agent running when one provider is down show fallback chains in practice.
Layer 3: how do you keep prompts portable?
Prompts are the layer people underestimate. They carry no provider-specific syntax, so they seem portable, but they are tuned to the habits of whatever model you wrote them on. Anthropic’s compatibility page says this directly: a prompt adjusted extensively for OpenAI is likely well tuned to OpenAI specifically, and it suggests reworking it for the new model. The same is true in every direction.
Three practices keep the cost of that rework small.
- Keep prompts in files in your repository. One file per prompt, reviewed in pull requests, with a version in the filename or a comment. A prompt that lives only in a vendor dashboard or a server-side prompt object is a dependency; OpenAI’s retirement of reusable prompt objects on 30 November 2026 is the live example.
- Write the contract, not the trick. State the task, the output format and two examples. Avoid instructions that only make sense for one family (“think step by step” for a model that reasons by default, or markup habits that one vendor’s models favour). When a prompt needs a trick, mark it in a comment so the rework knows where to look.
- Keep a golden set. Twenty to fifty real inputs with a check for each: an exact string, a regex, a JSON field, a length limit, or a short rubric a second model can grade. The set is what turns “the new model feels fine” into a number. Without it, layer 3 failures stay invisible, which is the whole reason they are dangerous.
One detail from the compatibility documentation is worth knowing because it changes behaviour without an error. OpenAI-format requests can place system or developer messages anywhere in a conversation. Anthropic’s compatibility layer takes all of them, joins them with newlines and sends the result as one top-level system field wherever they appeared. If your app inserts instructions mid-conversation, the meaning shifts when you change route. The drill below will not catch that, but your golden set will if it includes a multi-turn case.
Prompt cost is part of this too. A long fixed prompt is billed on every call, and cache rules differ by provider, as the prompt caching docs and the post on cutting LLM API costs explain. When you compare routes, compare the bill for the same golden set, not the price list.
Layer 4: what happens to tools and structured output?
Tool calling looks standardised and mostly is. OpenAI-format tools carry a name, a description and a parameters JSON Schema. Anthropic’s native format carries a name, a description and an input_schema, per its tool use overview. The schema is the same idea in a different key, and a ten-line adapter bridges them. Keep one definition and convert at the edge.
# One tool definition in the OpenAI shape, one small adapter per provider shape
def to_anthropic_tool(t):
f = t["function"]
return {"name": f["name"], "description": f.get("description", ""), "input_schema": f["parameters"]}The trouble is in the edges, not the schema. This table lists differences the three providers document themselves, read on 28 November 2026.
| Behaviour | What the provider documents | What to do |
|---|---|---|
| Strict function schemas | Anthropic’s OpenAI-format layer ignores the strict flag, so tool arguments may not follow the schema |
Validate arguments yourself on every route |
| JSON mode | Same layer accepts only json_schema with strict, and a request with json_object or text returns a 400 |
Ask for JSON in the prompt, parse, validate, retry once |
| Prompt caching | Not supported through that layer; supported in Anthropic’s own SDKs | Treat caching as a native feature and measure it per route |
| Ignored fields | Most unsupported fields are silently ignored rather than rejected | Log which parameters you send and test their effect |
| Reasoning settings | Gemini’s layer accepts reasoning_effort, and native thinking settings go in a Google-specific extra_body |
Put provider-specific settings in profile files, not call sites |
| Structured output on OpenAI’s newer API | The Responses API moves response_format to text.format |
Keep an adapter, or stay on Chat Completions, which OpenAI says remains supported |
| Tools with reasoning | OpenAI says that from GPT-5.4 on, Chat Completions does not support tool calling with reasoning_effort other than none |
Re-test tool flows after every model change, even on the same provider |
The last row is the one that surprises people: the “portable” endpoint changed behaviour inside one provider. Compatibility is a moving target on both sides of the wire. Google’s own page makes the same point differently, recommending that anyone not already using the OpenAI libraries call the Gemini API directly. That is fair advice, and it is also an admission that the compatibility layer is a convenience for migrating, not a place to build features that need the native API.
Three rules follow. Validate every structured output yourself with a JSON Schema validator, on every route, and treat a strict flag as a hint. Keep tool definitions in one file and convert at the edge. And keep the number of provider-specific parameters small and visible, in one module, so the list of things to re-test after a switch is short.
If your tools run as separate servers, the Model Context Protocol, an open-source standard for connecting AI applications to external systems, moves part of this problem out of your code. A tool server that speaks it works with any client that does, which is a different kind of portability from the schema adapter above. Our MCP docs and tool calling docs show both formats side by side, and the structured output docs cover JSON mode on our side.
Layer 5: where does state live?
The surest way to lose a week is to let a vendor hold your conversation. OpenAI’s migration guide states that responses are stored by default and that chat completions are stored by default for new accounts; you turn storage off with store: false. It also warns that chaining with previous_response_id does not remove the cost of earlier turns: the previous input tokens in the chain are still billed as input. So server-side state does not even save money, it only moves the history to a place you cannot export from on short notice.
The Assistants API history above is the extreme case: objects, threads and files on a vendor’s servers, retired on a published date. The portable alternative is dull and works everywhere: keep the message list in your own database, send what each call needs, and treat any provider-side store as a cache you can lose. Our Responses API docs describe the format working without stored state on the gateway, and the streaming comparison covers the other state-adjacent choice, how replies arrive.
The same applies to files. If a provider’s file store holds your only copy of a document, you have a layer-5 dependency. Keep originals in your own storage and upload per request or per session.
Layer 6: what do money and token counts lock in?
Two things here are easy to miss.
Token counts do not convert. Tokenizers differ between providers and between model generations of the same provider. Anthropic’s token counting docs describe the count as an estimate, say billing on newer models reflects the newer tokenizer, and tell you not to reuse token counts measured on an older model to estimate cost or context fit. So a budget written in tokens does not port. Write budgets in dollars, per key and per project, and compare routes on the cost of the same golden set. The billing audit guide shows how to compare reported usage against your own count.
Prepaid money does not move. A balance is useful because it caps your risk and awkward because it is stuck on one route. Keep prepaid amounts small, top up on a schedule that matches your spend, and treat a balance as something you plan to spend down before a switch. Our posts on prepaid credits and gateway fees list what to check in any provider’s terms before paying, including whether credits expire, and the runaway bill guide covers the caps that stop a loop from draining a balance you cannot move.
Export your usage regularly. Ours is on the usage page as CSV, with model, token counts, cost and request id per call, and Anthropic’s deprecation page recommends the same habit for finding deprecated ids you still call. A usage export is a quick audit of layer 2 that costs nothing: filter by model and look for anything on a retirement list.
What does leaving actually cost? A calculator
The inputs are yours. The defaults are placeholders, not measurements: 40 places in code that name a provider or a model, 20 minutes each to find, edit and retest when nothing is abstracted, $60 an hour, 8 hours to build the profile files, alias map and golden set once, 2 hours per switch once they exist (the drill plus fixes), and 2 switches a year (a forced one and a chosen one). It runs in your browser and sends nothing.
Exit cost: hard-coded versus abstracted
- Hours per switch, hard-coded
- 13.33
- Hours a year, hard-coded
- 26.67
- Hours a year with the layer (setup counted once)
- 12.00
- Labour saved a year (USD)
- $880.00
- Switches until the layer pays for itself
- 0.71
Placeholder inputs, not measurements. With the defaults: 40 places at 20 minutes is 13.3 hours a switch; twice a year is 26.7 hours; the layer costs 8 + 2 x 2 = 12 hours; the 14.7 hours saved at $60 is about $880.
The calculator leaves out the cost that matters most in a forced exit, which is time pressure. Thirteen hours of work spread over a quiet month is cheap; thirteen hours in the week before a shutdown, while a customer-facing feature is down, is not. The abstraction layer buys speed under pressure more than it buys hours.
The 30-minute switch drill
A drill is a rehearsal of the exit with real calls and a written result. The goal is not to switch; it is to know, in half an hour, whether you could. Everything below can run against a free key, so it costs nothing to try. On One AI API Key a free account signs in with Google, takes no card, and the free lane gives 48 ids a shared allowance of 100 requests and 3,000,000 tokens a day, which is far more than the drill uses. The six checks use about six requests per route.
| Minute | Step | What you produce |
|---|---|---|
| 0 to 5 | Create a key on route B, fill the B cells of the alias map | A profile B in your env file |
| 5 to 15 | Run the six-check script against A and B side by side | A pass or fail table you can paste in a ticket |
| 15 to 25 | Replay the golden set on B and score it the same way as on A | Two scores, not an impression |
| 25 to 30 | Decide: ship, shadow, or stay; revoke the test key if you stay | A dated line in your exit plan file |
The drill, minute by minute
The script below runs six checks against each profile with the standard library only. We wrote it for this post and tested it against a local mock server that speaks the OpenAI chat format: the pass paths and the failure paths (wrong model id, wrong checks) behaved as expected there. We have not run it against every provider, so treat a failure as a lead to read, not a verdict. The six checks are: the model id appears in the model list, a plain chat returns content and a usage object, JSON can be requested in the prompt and parsed, a tool call returns arguments that parse, a stream sends data and ends with the done marker, and a bad model id returns a JSON error body instead of an HTML page.
#!/usr/bin/env python3
"""Switch drill: run the same six checks against profile A (today) and profile B (the exit route)."""
import json, os, sys, time, urllib.request, urllib.error
def profile(tag):
return {"base": os.environ[f"LLM_{tag}_BASE_URL"].rstrip("/"),
"key": os.environ[f"LLM_{tag}_API_KEY"],
"model": os.environ[f"LLM_{tag}_MODEL"]}
def call(p, path, body=None):
data = json.dumps(body).encode() if body is not None else None
req = urllib.request.Request(p["base"] + path, data=data, headers={
"Authorization": "Bearer " + p["key"], "Content-Type": "application/json"})
t = time.time()
try:
return urllib.request.urlopen(req, timeout=90), t
except urllib.error.HTTPError as e:
return e, t
def chat(p, **extra):
body = {"model": p["model"], "max_tokens": 200, **extra}
r, t = call(p, "/chat/completions", body)
raw = r.read().decode("utf-8", "replace")
ms = int((time.time() - t) * 1000)
try:
return r.status, json.loads(raw), ms
except ValueError:
return r.status, {}, ms
def t_listed(p):
r, t = call(p, "/models")
ids = [m.get("id") for m in json.loads(r.read()).get("data", [])]
return p["model"] in ids, f"{len(ids)} ids"
def t_chat(p):
s, j, ms = chat(p, messages=[{"role": "user", "content": "Say OK."}])
u = j.get("usage") or {}
return s == 200 and bool(j["choices"][0]["message"]["content"]) and u.get("total_tokens", 0) > 0, f"{ms} ms"
def t_json(p):
s, j, ms = chat(p, messages=[{"role": "user", "content": 'Reply with only this JSON object: {"ok": true}'}])
text = j["choices"][0]["message"]["content"].strip().strip("`").removeprefix("json").strip()
return s == 200 and json.loads(text).get("ok") is True, f"{ms} ms"
def t_tool(p):
tools = [{"type": "function", "function": {"name": "get_weather", "description": "Weather for a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
s, j, ms = chat(p, tools=tools, messages=[{"role": "user", "content": "What is the weather in Pune? Use the tool."}])
calls = j["choices"][0]["message"].get("tool_calls") or []
return s == 200 and bool(calls) and "city" in json.loads(calls[0]["function"]["arguments"]), f"{ms} ms"
def t_stream(p):
body = {"model": p["model"], "max_tokens": 50, "stream": True, "messages": [{"role": "user", "content": "Count to three."}]}
r, t = call(p, "/chat/completions", body)
first, done = None, False
for line in r:
line = line.decode("utf-8", "replace").strip()
if line.startswith("data:") and first is None:
first = int((time.time() - t) * 1000)
if line == "data: [DONE]":
done = True
return r.status == 200 and first is not None and done, f"first chunk {first} ms"
def t_error(p):
r, t = call(p, "/chat/completions", {"model": "no-such-model-id", "messages": [{"role": "user", "content": "x"}]})
try:
body = json.loads(r.read())
except ValueError:
body = {}
return 400 <= r.status < 500 and "error" in body, f"HTTP {r.status}"
CHECKS = [("model id is listed", t_listed), ("plain chat + usage", t_chat), ("JSON without response_format", t_json),
("tool call round trip", t_tool), ("streaming ends with [DONE]", t_stream), ("unknown id gives a JSON error", t_error)]
def main():
profiles = [profile("A"), profile("B")]
bad = 0
print(f"{'check':<32}{'A':<28}{'B':<28}")
for name, fn in CHECKS:
cells = []
for p in profiles:
try:
ok, note = fn(p)
except Exception as e: # a crash is a failed check, not a stopped drill
ok, note = False, type(e).__name__
bad += 0 if ok else 1
cells.append(("PASS " if ok else "FAIL ") + note)
print(f"{name:<32}{cells[0]:<28}{cells[1]:<28}")
sys.exit(1 if bad else 0)
main()export LLM_A_BASE_URL="https://api.oneaiapikey.com/v1"
export LLM_A_API_KEY="$ONEAIAPIKEY_API_KEY"
export LLM_A_MODEL="z-ai-glm-5.3:free"
export LLM_B_BASE_URL="https://PROVIDER_B_HOST/v1"
export LLM_B_API_KEY="$PROVIDER_B_KEY"
export LLM_B_MODEL="MODEL_ID_AT_B"
python3 drill.py # Python 3.9 or newer, standard library onlyPoint profile A and profile B at two different routes, or at two ids on the same route to practise a model switch. Reading the output is the real skill:
- A check fails on both routes. The check is probably wrong for your use case. Fix the script, not the providers. A model that does not list itself in the models endpoint is common on some gateways and is not a failure of the call.
- A check fails only on B. That is a layer to rework. A JSON failure means prompts or parsing need work on B. A tool failure means the model did not call the tool or the arguments did not parse. A streaming failure usually means a proxy in between is buffering.
- Everything passes but the golden set scores lower on B. That is layer 3, and it is the most common outcome. Decide whether the gap is acceptable, rework the prompts, or choose a different model on route B. The guide to verifying that an API serves the model it names helps when you doubt what is answering, and the free trial testing protocol lists eight tests to run on any gateway before it sees real traffic.
Keep the output. A dated drill result in your repository tells the next engineer, and your future self in a forced exit, which of the six layers have been proven and which are assumptions.
How do you score your own readiness?
This checklist has ten items. Tick what is true today; the verdict below follows the count. It runs in your browser and nothing is stored or sent.
Exit readiness
0 of 10 ticked
Locked in
A forced exit would be a rewrite. Start with the first two items: they take an afternoon and remove the loudest failures.
Which risk should you fix first?
How is your app built today?
Direct SDK, one provider
Through a gateway or router
A coding agent or IDE tool
Server-side assistants, stored prompts or stored threads
How do you leave a gateway, including this one?
A gateway lowers the cost of switching models and adds a dependency of its own, so the exit plan has to cover it. Here is what is portable on One AI API Key and what is not, as of 28 November 2026.
What moves with you. Requests use the standard OpenAI or Anthropic format, so the base URL and key are the whole connection: https://api.oneaiapikey.com/v1 for OpenAI format, and the host without /v1 for Anthropic format. The model list is a normal GET /v1/models. Usage is one record per request with model, token counts and cost, exportable as CSV from the usage page. None of that needs a proprietary SDK.
What does not move. The optional X- headers (fallback, tags, timeouts), virtual models and routing rules, per-key spend limits and allowlists, the free lane and its daily allowance, and the sign-up credit are all ours. If your code path depends on one of them, record it in your exit plan file and decide what replaces it on route B.
What we cannot promise. We do not control the providers that run the models behind us, so ids can disappear, as the 25 November free-lane clean-up showed. Our transparency page says what we monitor and what we cannot see, and the status page shows probes and history, which the post on what an honest status page looks like uses as its reference. On data, what you send is relayed to the company that runs the model; usage records keep counts, not prompts and answers; we do not train on your data; and prompt logging is opt-in per key. The ten questions to ask any gateway about data list what to ask us and everyone else, and the privacy guide sets out our wording.
What about money. Credit on your account is prepaid. Paid access is set up by hand, by email, today, and the reasons are in why we sell paid access by email. Spend the balance down on the route you are leaving, or keep it as the second route. If something went wrong on our side, write to somdutt777@gmail.com with the details and support will look at it case by case. The terms hold the rules. The same exit reasoning applies when a gateway changes hands: the post on OpenRouter and Stripe lists the checks, and the Helicone alternatives guide covers what a tool going into maintenance mode means for you.
A self-hosted proxy is the other way to hold the endpoint yourself, and it adds supply-chain work. LiteLLM’s own incident report says its PyPI versions 1.82.7 and 1.82.8 were live on 24 March 2026 from 10:39 UTC for about 40 minutes before PyPI quarantined them, and that the official proxy Docker image was not affected. That is a reasonable disclosure and also a reminder that running the gateway yourself makes you the party that pins versions and checks hashes. The LiteLLM alternatives post covers that trade, and hosted versus self-hosted puts hours on it.
What does a one-page exit plan contain?
Put one file in your repository, short enough that someone reads it during an incident. Here is the skeleton we would use.
| Section | What to write | Example |
|---|---|---|
| Routes | Profile A and B, with base URLs and the key names (not the keys) | A: current gateway; B: second gateway or direct provider |
| Triggers | The events that start an exit and who calls it | Shutdown notice under 90 days; error rate above 5% for an hour; a price rise you cannot absorb; a data-terms change |
| Roles | Alias map location and the owner of each role | model-aliases.json, owner named per role |
| Proof | Date and result of the last drill, golden set scores on A and B | 2026-11-28, 6 of 6 checks, 19 of 20 prompts |
| Money | Balance on each route, top-up rule, who can spend | Keep under 30 days of spend on each route |
| Rollback | What to flip back and how long it takes | Set LLM_PROFILE=A and redeploy |
The triggers row is the one teams skip, and it is the one that makes the plan real. A plan without triggers is a document; a plan with a rule such as “any shutdown notice under 90 days starts a drill” is a process. The uptime and fallbacks guide helps you set the error-rate triggers, and the 429 guide tells you which errors count as a provider problem and which are your own limits.
Where does this plan fit with the rest of your provider choice?
Portability is one criterion of several, and it should not be the only one. Choosing between a direct API and a gateway involves latency, trust, price and features, covered in the gateway versus direct API comparison, the trade-offs of one key for every model and the 12-point provider checklist. The guide to what an LLM gateway is explains why one base URL can reach many models at all.
If you want a reality check on a gateway’s claims before you trust it as route B, the posts on cheap API reseller risks and what our service gives and does not give apply the same standard to us. We would rather you run the drill against us and a rival and see the numbers than take our word for it.
What to do this week
You do not need all of this at once. In order of payoff:
- Move the base URL, key and every model id out of source code. One afternoon.
- Create profile B with a free key and fill its cells in the alias map. One hour.
- Run the drill once and save the result. Thirty minutes.
- Write the golden set from real traffic. An afternoon, and the most valuable of the four.
- Put the shortest deprecation notice you depend on on a calendar, with the date you read it.
On our side, a free account is a no-cost place to practise: Google sign-in, no card field, the 48 free ids work at a $0 balance, and the pricing page and model list show what is available and at what rates. The chat draws on the same allowance if you want to compare answers before writing code, and the cost calculator turns your golden set’s token counts into dollars for any priced id. The rankings page shows what the gateway measured across models, which is a useful starting list for route B candidates.
Practise the exit on a free key
Sign in with Google, create a key, point profile B at https://api.oneaiapikey.com/v1 and run the drill. 100 requests and 3,000,000 tokens a day on 48 free ids, no card.
Frequently asked questions
What is LLM API vendor lock-in?
Is an OpenAI-compatible endpoint enough to avoid lock-in?
extra_body field that only Gemini reads. Compatible means a request is accepted, not that it behaves the same. The compatibility test matrix shows how to probe a provider instead of trusting the label.How much notice will I get before a model is retired?
Should I use a gateway to avoid lock-in?
How often should I run the switch drill?
Does prompt caching make me more locked in?
Do I need LiteLLM or an agent framework to stay portable?
What does leaving One AI API Key involve?
Does the Responses API lock me in more than Chat Completions?
previous_response_id does not remove billing for earlier input tokens. OpenAI also says Chat Completions remains supported, so you can move one flow at a time. If you adopt Responses, keep your own copy of the conversation and set store: false where you do not need the stored state. Our Responses API page describes how the gateway handles the format.