The apps a base URL cannot reach, and what it costs to route them
Every gateway routes tools with a base-URL setting. Four desktop apps have none. Routing those is a different problem — four trust stores, two transports, compressed bodies and endpoints that move.
Pick any LLM gateway — LiteLLM, Bifrost, Portkey, LLM Gateway, kRouter. All of them route a client that lets you set a base URL. You point the tool at an address, the gateway speaks the protocol, done. That part is solved, and the differences between gateways there are about team features, budgets and deployment shape, not capability. We compare those honestly elsewhere.
Then there are the apps with no setting at all.
Claude Desktop. Google Antigravity. GitHub Copilot. Kiro IDE. Each talks to a hostname compiled into the product. There is no field, no environment variable, no config file. From a gateway's point of view they are not clients — they are closed appliances that happen to run on your laptop.
Routing those is the part almost nobody does, and this is what it actually takes.
You are not configuring a client, you are terminating its TLS
With no setting to change, the only remaining option is to catch the traffic locally: redirect the hostname to 127.0.0.1, answer on port 443, and present a certificate the machine trusts.
That sentence is short and the work under it is not, because you have just taken responsibility for things a normal gateway never touches: a root certificate authority on the user's machine, the system hosts file, and the failure behaviour of both.
Four problems follow, and each one cost a release.
1. Installing a CA is not the same as being trusted
The obvious step is to put your root CA in the operating system's trust store. It is also, on its own, close to useless here, because none of these four apps asks the operating system.
| Runtime | Reads | Behaviour | App |
|---|---|---|---|
| Node / Electron | NODE_EXTRA_CA_CERTS | adds to the OS store | Claude Desktop, Kiro |
| the IDE's own config | caCertificates setting | adds | Antigravity |
| Go | SSL_CERT_FILE | replaces the OS store | Antigravity's agy |
Four mechanisms, and one of them inverts the others. Go treats SSL_CERT_FILE as the complete root pool, so a bundle exported by an unrelated Python install hides your CA from every Go program on the machine — and the failure is indistinguishable from certificate pinning. That one was recorded in our own source as pinning for months before anyone ran the four-second experiment that disproved it.
The fix has a trap on the other side: point SSL_CERT_FILE at your CA alone and every Go binary the user owns — gh, docker, the Go toolchain — stops trusting the internet. The bundle must always be system roots plus your CA, and it must merge whatever the user already had.
2. The interceptor's failure mode is the user's network
A hosts entry is a line in a file. A listener is a process. Only one survives a crash.
Kill the interceptor and the hostname still resolves to 127.0.0.1 with nothing behind it. It does not fall back to the vendor — DNS resolved fine, the connection was refused, there is no second candidate. Every program on the machine now finds that provider unreachable, and nothing on screen connects that to a gateway that stopped running.
So routing closed apps means owning a watchdog that heals the machine after your own crash. That is a whole subsystem, and it exists only because of the hosts file.
It is also why there is a second transport. A CONNECT proxy has no persistent half: when it dies the port stops accepting, the client reports a refused connection accurately, and nothing is left behind. Proxy capture mode needs no password, affects one app instead of the machine, and cannot blackhole a domain. It is strictly better where the client honours HTTPS_PROXY — which Antigravity's agent does not, so both transports have to exist.
3. You do not control the wire format, and it changes
A configured client speaks a protocol you agreed on. A captured app speaks whatever it feels like this week.
- Claude Desktop gzips its bodies. The model matcher read raw bytes, saw a gzip header, correctly identified it as binary, and passed the request through to Anthropic on the user's own quota — 33 of 34 requests, with every setting green.
- Kiro moved its chat endpoint twice. From a path, to
POST /plus anx-amz-targetheader, then to/v1/responseswith an OpenAI Responses body. Each move silently converted every chat turn into a passthrough. - Antigravity's backend rejects old IDE version markers, so requests need the version rewritten or the vendor refuses them outright.
- Models get retired mid-flight, and a retirement notice arrives as a clean HTTP 200 that bills, logs as success and renders as the model's own words.
None of this is work you can finish. It is a maintenance surface that moves when four vendors ship, and the failure mode is always the same: capture looks enabled, routes nothing, and the user's own subscription quietly pays.
4. Every failure is silent by default
That last sentence is the real cost, and it is why this work is disproportionate to its apparent size.
When a configured client breaks, it breaks loudly — a connection error, a 4xx, something in a log. When capture breaks, the app keeps working perfectly. The vendor answers. The user gets their completion. The only symptom is that a subscription is being spent that the user believed was being routed, and that is invisible until the bill or the quota page.
So the engineering is not mostly about interception. It is about refusing to report success:
- a tool label carried one hop so usage can say which IDE spent the money, instead of attributing everything to whoever served it
- an empty-completion status that is actually written, instead of being a constant called from nowhere
- status read from whether the port is listening, not from whether a child-process handle exists
- an intercept log line carrying the request path, because Claude Desktop fans out roughly a hundred near-simultaneous calls on launch and a benign fan-out is otherwise indistinguishable from a retry storm
Is it worth it
Honestly: only if you use those apps.
If your tools all have a base-URL field, none of this matters and you should choose a gateway on the criteria that actually apply to you — team budgets, spend tracking, deployment model. LiteLLM is a better answer for a team that needs governance. We say so plainly.
Capture matters when the tool you use every day is one of the four closed ones, and the alternative is paying one vendor's subscription for work another model should be doing. That is the case kRouter is built for, and it is the reason the feature list here is shaped the way it is: four trust mechanisms, two transports, a body decoder, a watchdog, and a lot of machinery whose only job is to admit when it did not work.
Start at MITM capture if you want to set it up.
Published by Kodelyth, the team that builds kRouter. Posts are drafted with AI assistance and reviewed by a person before they go out. kRouter is free and MIT licensed.
Install kRouterRelated posts
- ComparisonsBest self-hosted LLM gateways in 2026, and how to vet oneLiteLLM, Bifrost, Portkey, LLM Gateway, Agent Router and kRouter: who each is for, and the checks to run before a gateway holds your API keys.
- ComparisonsClaude Code with GLM, Kimi or DeepSeek: setup and trade-offsGLM-5.3, Kimi K3 and DeepSeek V4 can all drive Claude Code. What each costs, which slot each suits, what breaks, and when you need a router.
- ComparisonsGrok in Claude Code and Codex: three ways to pay for itGrok 4.5 to 4.7 in Claude Code or Codex through Grok Build, OpenCode Go or the xAI API: what each costs, which API it speaks, and the setup.
Relevant docs
- Getting StartedInstall kRouter, connect a first provider, and point Claude Code, Codex or any OpenAI-compatible tool at it. Takes about five minutes.
- Core conceptsProviders, combos, account routing, token savers, MITM mode, quota tracking, the response cache and remote access: the eight ideas behind kRouter.
- ProvidersConnect 95+ AI providers to kRouter: OAuth subscriptions, free services, free-tier and pay-per-token API keys, and browser-cookie logins.