Does Claude Code support BYOK? (And Codex?) The honest answer

People search 'claude code byok' and 'does codex support byok' expecting a yes/no. The real answer is subtler: both CLIs always run on your own credentials. That's not a feature, it's the only mode they have. Here's what 'BYOK' actually means for Claude Code and Codex, the API-key vs subscription split, and the one thing the CLIs can't do that sends people looking.

By Brian Boisjoli Updated 5 min read byokclaude-codecodexai-agents

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 / Business via "Sign in with ChatGPT", included in your subscription

The split matters more than most people expect:

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:

  1. "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.

  2. "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.

  3. "Can I run Claude Code / Codex without keeping a machine on?" This is the one the CLIs genuinely can't answer on their own, 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 the CLI runs where you run it: 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 Remote Control partly addresses it by letting your phone drive a Claude Code session running on your always-on machine; we compared that approach here. Both vendors also run the agent in their own cloud now: Claude Code on the web and Codex cloud tasks start from a browser or the mobile app on supported subscriptions and work on your repo in the vendor's sandbox. They cover the coding. They don't host the app you build.

The other approach is a hosted BYOK agent: an agent running Claude or GPT models lives 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 VibeKit's servers instead of your laptop, the app it builds is hosted at a live URL, and there's no platform token markup on BYOK traffic. A Claude Pro / Max sign-in works too, but Anthropic bills third-party use of it to your plan's prepaid extra usage, not your plan limits. 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 runs on a pool of free models, 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/Business 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, which is 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. You can keep an always-on machine and drive it remotely (Anthropic's Remote Control), start a cloud session from the vendor (Claude Code on the web, Codex cloud) on a supported subscription, or use a hosted BYOK agent that runs on a server and accepts your key. All three 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.

Try VibeKit
Every app gets its own AI agent. Free tier with BYOK.
Start building →