The short answer, then the real one
Yes — Claude Code and Codex both run on your own key. But "BYOK" is a slightly wrong frame for them, and understanding why tells you something useful.
When people search claude code byok, does claude code support byok, or does codex support byok, they're usually carrying a mental model from the hosted AI builders — Replit, Lovable, Bolt — where the platform sells you metered credits and "BYOK" is a special escape hatch that lets you pay the model provider directly instead. (We wrote the honest per-platform scorecard for those.)
Claude Code and Codex don't work that way. They're command-line tools published by the model providers themselves — Claude Code by Anthropic, Codex by OpenAI. There is no middleman reselling you tokens, so there's no platform cut to escape. Your credentials are the only thing that powers them. In that sense they're "BYOK" the way your own laptop is "bring your own computer" — it was never anything else.
So the precise answer is: the key question isn't whether they support BYOK (they do, exclusively) — it's which kind of credential you bring, and what it costs.
Two ways to authenticate each one
Both CLIs accept two credential types, and the choice changes your bill:
| Tool | API key (metered, per-token) | Subscription (flat) |
|---|---|---|
| Claude Code (Anthropic) | Anthropic Console API key — billed per token against your Console account | Claude Pro / Max plan via OAuth login — included in your monthly subscription |
| Codex (OpenAI) | OpenAI Platform API key — billed per token against your Platform account | ChatGPT Plus / Pro / Team via "Sign in with ChatGPT" — included in your subscription |
The split matters more than most people expect:
- API key = pure usage-based. Great for bursty or occasional use; you pay for exactly the tokens you burn, nothing when idle. Heavy daily use can run past a subscription's effective cost — that's the daily-burn math worth doing before you commit.
- Subscription OAuth = flat monthly, with usage limits. If you're already paying for Claude Pro/Max or ChatGPT Plus for the chat product, routing the CLI through the same subscription is often the cheapest path — you've already paid for the capacity.
Neither is "more BYOK" than the other. Both bill to your account with no third party in the middle. The subscription path trips people up because it doesn't feel like BYOK — there's no sk-... string to paste — but it's the same principle: your credential, your bill.
So why do people search "claude code byok" at all?
If the CLIs are BYOK-only, why is the query so common? Almost always, it's a proxy for one of three real questions:
"Can I use my Claude Pro / ChatGPT subscription instead of paying API rates?" — Yes (the subscription column above). This is the single most common intent, and the answer is the good news.
"Does some builder that runs Claude Code / Codex under the hood let me bring my own key?" — Different question, different answer, and it's where the real traps live. Cursor: yes. Most hosted builders: no. The per-platform scorecard covers each one with sources.
"Can I run Claude Code / Codex without keeping a machine on?" — This is the one the CLIs genuinely can't answer, and it's worth its own section.
The thing a CLI can't do: run when your machine is off
A CLI is a program on a computer. Claude Code and Codex are BYOK-native and excellent — but they run where you run them: your laptop, or a server you keep alive. Close the lid, lose Wi-Fi, or step away from your desk, and the agent stops. There's nothing to bring your key to from your phone.
That gap — "I have the key, I have the subscription, but I don't have a machine that's always on and reachable from my pocket" — is what sends a lot of claude code byok searchers looking for something else. Anthropic's own remote-control and Codex's mobile features partly address it by letting your phone drive an agent running on your always-on machine; we compared that approach here.
The other approach is a hosted BYOK agent: the Claude or Codex agent runs on a server that's always on, you reach it from a phone or browser, and it still bills to your own Anthropic/OpenAI credential. That's the lane VibeKit sits in — you bring exactly the keys this post is about (Anthropic, or OpenAI/Codex including the ChatGPT-subscription OAuth path), the agent runs on hosted containers instead of your laptop, and there's no platform token markup on BYOK traffic. It's not a replacement for the CLI on your desk; it's the answer to "but my desk isn't always with me." (If you'd rather not bring a key at all, there's a free tier that routes through a shared pool — covered in the cost breakdown.)
FAQ
Does Claude Code support BYOK? Yes — exclusively. It runs on either your Anthropic Console API key (per-token) or your Claude Pro/Max subscription via OAuth. There's no platform reselling tokens, so every call bills to your own account.
Does Codex support BYOK? Yes — same model. Codex authenticates with your OpenAI Platform API key or your ChatGPT Plus/Pro/Team subscription ("Sign in with ChatGPT"). Your credential, your bill.
Is using my Claude Pro / ChatGPT subscription the same as BYOK? Effectively, yes. It doesn't involve pasting an API key, but it's still your own credential powering the agent with no middleman — the defining property of BYOK. For steady daily use it's often the cheaper of the two paths.
Can I run Claude Code or Codex from my phone on my own key? Not the CLI by itself — it needs a machine to run on. Either keep an always-on machine and drive it remotely (Anthropic remote control / Codex mobile), or use a hosted BYOK agent that runs the same model on a server and accepts your key. Both keep the billing on your account.
Which is cheaper, API key or subscription? Depends on volume. Light/bursty use favors the metered API key; heavy daily use usually favors a flat subscription you're likely already paying for. Run the daily-burn numbers before committing.
VibeKit
Enter App