[{"data":1,"prerenderedAt":607},["ShallowReactive",2],{"blog-post-byok-ai-bring-your-own-key":3,"related-posts-byok-ai-bring-your-own-key":581},{"id":4,"title":5,"author":6,"body":10,"category":555,"date":556,"description":557,"extension":558,"featured":559,"hideToc":559,"image":560,"imageAlt":561,"imageHeight":562,"imageWidth":563,"itemList":564,"lang":564,"meta":565,"navigation":566,"noindex":559,"path":567,"readingTime":568,"redirected":559,"relatedSlugs":564,"seo":569,"seoTitle":570,"stem":571,"subtitle":564,"tags":572,"updatedDate":564,"__hash__":580},"blog/blog/byok-ai-bring-your-own-key.md","BYOK AI Explained: What Bring Your Own Key Means for AI Agents",{"name":7,"role":8,"avatar":9},"Shabnam Katoch","Growth Head","/img/avatars/shabnam-profile.jpeg",{"type":11,"value":12,"toc":536},"minimark",[13,20,23,26,29,34,37,40,43,47,50,95,98,116,119,126,130,133,222,236,240,243,246,259,262,323,326,334,338,344,349,352,356,359,363,366,370,378,382,385,391,399,403,406,423,439,442,450,454,457,468,474,484,488,493,496,501,504,509,512,517,520,525,528,533],[14,15,16],"p",{},[17,18,19],"strong",{},"Bring your own key means your agent runs on your API account, at your provider's price. Here is how the billing works, what it saves, and how to keep the key safe.",[14,21,22],{},"Every AI agent platform has to answer one question: who pays the model provider?",[14,24,25],{},"Some platforms buy tokens in bulk and resell them to you as credits, usually with a margin. Others ask you to paste in your own API key, so the provider bills you directly. That second model is BYOK, short for bring your own key.",[14,27,28],{},"It sounds like a billing detail. In practice it decides how much your agent costs, which models it can use, and who can see your usage. Here is how it works.",[30,31,33],"h2",{"id":32},"what-byok-means-in-ai","What BYOK means in AI",[14,35,36],{},"In AI tools, BYOK means you create an API key with a model provider, such as Anthropic, OpenAI, Google or DeepSeek, and give it to the app. The app sends your agent's requests using that key. The provider charges your account at its normal rates.",[14,38,39],{},"The app still charges for what it does: hosting, scheduling, connectors, memory, the interface. It just doesn't sit between you and the token bill.",[14,41,42],{},"One naming note. In cloud security, BYOK also means \"bring your own encryption key\", where a company supplies the key a cloud service uses to encrypt its data. That is a different idea. This post is about API keys for AI models.",[30,44,46],{"id":45},"how-byok-billing-works","How BYOK billing works",[14,48,49],{},"With BYOK, an agent's cost splits into two separate bills.",[51,52,53,69],"table",{},[54,55,56],"thead",{},[57,58,59,63,66],"tr",{},[60,61,62],"th",{},"Bill",[60,64,65],{},"Who sends it",[60,67,68],{},"What it covers",[70,71,72,84],"tbody",{},[57,73,74,78,81],{},[75,76,77],"td",{},"Platform fee",[75,79,80],{},"The agent platform",[75,82,83],{},"Hosting, tools, connectors, the interface",[57,85,86,89,92],{},[75,87,88],{},"Model usage",[75,90,91],{},"Your model provider",[75,93,94],{},"Every token your agent sends and receives, at list price",[14,96,97],{},"Because the provider bills you directly:",[99,100,101,107,110,113],"ul",{},[102,103,104],"li",{},[17,105,106],{},"You pay the provider's list price, with no resale margin on top.",[102,108,109],{},"Your provider dashboard shows exactly what each agent spent.",[102,111,112],{},"Discounts you already get, like prompt caching or batch pricing, apply to your agent too.",[102,114,115],{},"You can switch models or providers by swapping the key, without changing platforms.",[14,117,118],{},"The trade-off is that you manage a provider account. You need a card on file with each provider you use, and you watch two bills instead of one.",[14,120,121],{},[122,123],"img",{"alt":124,"src":125},"How BYOK billing works: agent platform sends platform fee for hosting and tools; model provider bills model usage at list price, no markup","/img/blog/byok-ai-bring-your-own-key-billing.jpg",[30,127,129],{"id":128},"byok-vs-managed-credits-vs-subscription-sign-in","BYOK vs managed credits vs subscription sign-in",[14,131,132],{},"BYOK isn't the only way to pay for an agent's model. There are three common setups.",[51,134,135,150],{},[54,136,137],{},[57,138,139,141,144,147],{},[60,140],{},[60,142,143],{},"BYOK",[60,145,146],{},"Managed credits",[60,148,149],{},"Subscription sign-in",[70,151,152,166,180,194,208],{},[57,153,154,157,160,163],{},[75,155,156],{},"How it works",[75,158,159],{},"You paste your provider API key",[75,161,162],{},"The platform buys tokens and sells you credits",[75,164,165],{},"You sign in with a consumer plan, like ChatGPT",[57,167,168,171,174,177],{},[75,169,170],{},"Who bills tokens",[75,172,173],{},"Your provider, at list price",[75,175,176],{},"The platform, often with a margin",[75,178,179],{},"Your subscription, within its limits",[57,181,182,185,188,191],{},[75,183,184],{},"Usage visibility",[75,186,187],{},"Full, in your provider dashboard",[75,189,190],{},"Whatever the platform shows",[75,192,193],{},"Your plan's usage page",[57,195,196,199,202,205],{},[75,197,198],{},"Model choice",[75,200,201],{},"Any model your key can reach",[75,203,204],{},"The platform's catalog",[75,206,207],{},"Models your plan includes",[57,209,210,213,216,219],{},[75,211,212],{},"Best for",[75,214,215],{},"Steady or heavy usage, cost control",[75,217,218],{},"One invoice, no provider accounts",[75,220,221],{},"People already paying for a plan",[14,223,224,225,230,231,235],{},"Subscription sign-in is newer. OpenAI now lets Go, Plus and Pro subscribers spend their plan's usage in third-party apps, and OpenClaw supports it. Our guide to ",[226,227,229],"a",{"href":228},"/blog/openclaw-chatgpt-subscription","using your ChatGPT subscription with OpenClaw"," covers that path. Anthropic took the opposite route for Claude Pro and Max; the ",[226,232,234],{"href":233},"/blog/openclaw-anthropic-subscription-ban","OpenClaw subscription ban explainer"," has the history.",[30,237,239],{"id":238},"what-byok-saves-a-worked-example","What BYOK saves: a worked example",[14,241,242],{},"Take one agent that handles 2,000 tasks a month. Each task sends about 20,000 input tokens and gets back about 2,000 output tokens. That's 40M input and 4M output tokens a month.",[14,244,245],{},"On Claude Sonnet 5.5, which lists at $2 per 1M input tokens and $10 per 1M output tokens:",[99,247,248,251,254],{},[102,249,250],{},"Input: 40M x $2 = $80",[102,252,253],{},"Output: 4M x $10 = $40",[102,255,256],{},[17,257,258],{},"Model cost at list price: $120 a month",[14,260,261],{},"Here's what that same usage costs through different routes.",[51,263,264,277],{},[54,265,266],{},[57,267,268,271,274],{},[60,269,270],{},"Route",[60,272,273],{},"Monthly model cost",[60,275,276],{},"Difference",[70,278,279,290,301,312],{},[57,280,281,284,287],{},[75,282,283],{},"BYOK, direct to Anthropic",[75,285,286],{},"$120",[75,288,289],{},"List price",[57,291,292,295,298],{},[75,293,294],{},"OpenRouter credits bought by card (5.5% fee)",[75,296,297],{},"$126.60",[75,299,300],{},"+$6.60",[57,302,303,306,309],{},[75,304,305],{},"A platform reselling tokens at a 20% margin (illustrative)",[75,307,308],{},"$144",[75,310,311],{},"+$24",[57,313,314,317,320],{},[75,315,316],{},"BYOK on Claude Haiku 5.5 ($0.10 / $0.50 per 1M)",[75,318,319],{},"$6",[75,321,322],{},"Cheaper model, same key setup",[14,324,325],{},"Two things stand out. First, the margin scales with usage, so it matters more the more your agent works. Second, the biggest saving often isn't the fee at all. It's being able to move routine tasks to a cheaper model, which BYOK makes a settings change.",[14,327,328,329,333],{},"OpenRouter has its own BYOK mode: you add your provider keys there, and the first $25,000 a month of list-price usage carries no fee, then 5%. Our ",[226,330,332],{"href":331},"/blog/openrouter-vs-direct-api-agents","OpenRouter vs direct API breakdown"," runs the full numbers.",[30,335,337],{"id":336},"how-to-keep-your-api-keys-safe","How to keep your API keys safe",[14,339,340,343],{},[17,341,342],{},"A BYOK key is a password with a credit card attached."," Treat it like one.",[345,346,348],"h3",{"id":347},"use-one-key-per-agent-or-workspace","Use one key per agent or workspace",[14,350,351],{},"If a key leaks, you revoke one key and one agent stops, not everything. On Anthropic, keys belong to the workspace they were created in, so a workspace per project keeps things separated.",[345,353,355],{"id":354},"set-a-spend-limit-at-the-provider","Set a spend limit at the provider",[14,357,358],{},"Anthropic lets you set a spend limit per workspace, below your organization's limit, plus email alerts at a set amount. OpenAI lets you set project spend limits with alerts. Check whether yours only alerts or actually blocks requests, because OpenAI's own help page describes both.",[345,360,362],{"id":361},"restrict-what-the-key-can-do","Restrict what the key can do",[14,364,365],{},"OpenAI keys can be All, Restricted or Read Only. Restricted keys let you choose None, Read or Write per endpoint, so an agent key doesn't need access it never uses.",[345,367,369],{"id":368},"never-put-keys-in-plain-text","Never put keys in plain text",[14,371,372,373,377],{},"Not in chat messages, not in config files you share, not in screenshots. Our guide to ",[226,374,376],{"href":375},"/blog/openclaw-secrets-management-stop-plaintext-api-keys","keeping API keys out of plain text"," covers the self-hosted side.",[345,379,381],{"id":380},"rotate-on-any-doubt","Rotate on any doubt",[14,383,384],{},"If a key may have been exposed, create a new one at the provider, update it in your agent, then delete the old one.",[14,386,387],{},[122,388],{"alt":389,"src":390},"Key safety checklist: one key per agent, spend limit at the provider, restricted permissions, never in plain text, rotate on any doubt","/img/blog/byok-ai-bring-your-own-key-safety-checklist.jpg",[14,392,393,394,398],{},"If you'd rather not run the agent side yourself, BetterClaw hosts the agent and keeps your key encrypted, with zero markup on inference. ",[226,395,397],{"href":396},"/pricing","Compare BetterClaw plans",".",[30,400,402],{"id":401},"how-byok-works-on-betterclaw","How BYOK works on BetterClaw",[14,404,405],{},"BetterClaw is built around BYOK. Every plan supports it, and we never mark up inference.",[99,407,408,414,420],{},[102,409,410,413],{},[17,411,412],{},"Basic ($19 a month)"," is BYOK only. You bring a key from any of the 28+ supported providers, including Anthropic, OpenAI, Google, DeepSeek, Groq and OpenRouter.",[102,415,416,419],{},[17,417,418],{},"Pro and Business"," add managed keys alongside BYOK, for teams that want to run some agents without a provider account.",[102,421,422],{},"Ollama is supported too, so local models cost nothing in tokens.",[14,424,425,426,430,431,434,435,438],{},"Adding a key takes a minute. Open ",[427,428,429],"em",{},"Settings > Agents",", pick the agent, open its Model tab, choose a provider and model, paste the key and click ",[427,432,433],{},"Save & Redeploy",". On paid plans, you use ",[427,436,437],{},"Connect a model"," instead and pick which of that provider's models to add.",[14,440,441],{},"Your key is stored encrypted and used only to run that agent's model. Secrets you add for tools work the same way: values are masked after saving, agents read them by reference and never see the raw value, and every read is recorded in the audit log.",[14,443,444,445,449],{},"If a key stops working, our ",[226,446,448],{"href":447},"/blog/openclaw-api-key-not-working","API key troubleshooting guide"," covers the usual causes.",[30,451,453],{"id":452},"when-byok-isnt-the-right-choice","When BYOK isn't the right choice",[14,455,456],{},"BYOK is the better deal for most steady agents, but not for everyone.",[99,458,459,462,465],{},[102,460,461],{},"If you can't put a card on file with a provider, or your company needs one supplier invoice, managed credits are simpler.",[102,463,464],{},"If you already pay for ChatGPT and your agent's usage fits inside the plan, subscription sign-in can cost nothing extra.",[102,466,467],{},"If you only run an agent a few times a month, the saving from avoiding a margin is small. Pick whatever is easiest.",[14,469,470,471],{},"The rule of thumb: ",[17,472,473],{},"the more your agent runs, the more BYOK is worth.",[14,475,476,477,483],{},"Ready to run an agent on your own key? ",[226,478,482],{"href":479,"rel":480},"https://app.betterclaw.io/sign-in",[481],"nofollow","Deploy your first BetterClaw agent",". Plans start at $19 a month with a 7-day money-back guarantee.",[30,485,487],{"id":486},"frequently-asked-questions","Frequently Asked Questions",[14,489,490],{},[17,491,492],{},"What does BYOK mean in AI?",[14,494,495],{},"BYOK stands for bring your own key. You give an AI app your own API key from a model provider, and the provider bills you directly for usage at its normal rates, instead of the app reselling tokens to you.",[14,497,498],{},[17,499,500],{},"Is BYOK cheaper than buying credits?",[14,502,503],{},"Usually, yes. With BYOK you pay the provider's list price with no resale margin. How much you save depends on the margin you'd otherwise pay and how much your agent runs, so heavy users save the most.",[14,505,506],{},[17,507,508],{},"Is it safe to give an app my API key?",[14,510,511],{},"It's as safe as the app's key storage and your own limits. Use a separate key per app, set a spend limit at the provider, restrict the key's permissions where you can, and rotate it if anything looks wrong.",[14,513,514],{},[17,515,516],{},"Can I use BYOK with any model?",[14,518,519],{},"You can use any model your key has access to, as long as the app supports that provider. BetterClaw supports 28+ providers, plus OpenAI-compatible and Anthropic-compatible custom endpoints.",[14,521,522],{},[17,523,524],{},"Does BYOK work with local models?",[14,526,527],{},"Local models don't need a key at all, because there's no provider to bill. Apps that support Ollama, including BetterClaw, can run them with zero token cost.",[14,529,530],{},[17,531,532],{},"What is the difference between BYOK and a ChatGPT subscription?",[14,534,535],{},"BYOK bills per token through an API account. A ChatGPT subscription is a flat monthly plan, and some apps now let you sign in with it and spend the plan's included usage, up to its limits.",{"title":537,"searchDepth":538,"depth":538,"links":539},"",2,[540,541,542,543,544,552,553,554],{"id":32,"depth":538,"text":33},{"id":45,"depth":538,"text":46},{"id":128,"depth":538,"text":129},{"id":238,"depth":538,"text":239},{"id":336,"depth":538,"text":337,"children":545},[546,548,549,550,551],{"id":347,"depth":547,"text":348},3,{"id":354,"depth":547,"text":355},{"id":361,"depth":547,"text":362},{"id":368,"depth":547,"text":369},{"id":380,"depth":547,"text":381},{"id":401,"depth":538,"text":402},{"id":452,"depth":538,"text":453},{"id":486,"depth":538,"text":487},"Guides","2026-10-19","BYOK means your AI agent runs on your own API key and the provider bills you directly. How it works, what it costs, and how to keep keys safe.","md",false,"/img/blog/byok-ai-bring-your-own-key.jpg","Bring your own key: one encrypted API key routed to three model providers, your account, your price",512,1024,null,{},true,"/blog/byok-ai-bring-your-own-key","8 min read",{"title":5,"description":557},"BYOK AI Explained: Bring Your Own Key for AI Agents (2026)","blog/byok-ai-bring-your-own-key",[573,574,575,576,577,578,579],"byok ai","bring your own key ai","byok meaning","byok api key","byok llm","byok vs credits","ai agent api key","LaoXncUQE414HFyaQSQvz6GBRlKGQipfMjaD4n5iL4s",[582,591,599],{"stem":583,"title":584,"description":585,"date":586,"image":587,"category":588,"redirected":559,"author":589,"readingTime":590},"blog/zanus-ai-vs-nvidia-dgx","Zanus AI Review: Private AI Servers vs NVIDIA DGX Spark and Station","Zanus AI review: what its private AI servers include, why pricing is quote-only, what the vendor won't publish, and when an NVIDIA DGX makes more sense.","2026-08-18","/img/blog/zanus-ai-vs-nvidia-dgx.jpg","Comparison",{"name":7,"role":8,"avatar":9},"9 min read",{"stem":592,"title":593,"description":594,"date":595,"image":596,"category":588,"redirected":559,"author":597,"readingTime":598},"blog/dgx-spark-alternative","DGX Spark Alternatives 2026: 6 Cheaper Options From $0 to $3,099","DGX Spark now costs $6,950 (64 GB from $4,999) and runs Linux only. Six cheaper alternatives ranked by price, from free Ollama to Strix Halo PCs.","2026-06-16","/img/blog/dgx-spark-alternative.jpg",{"name":7,"role":8,"avatar":9},"16 min read",{"stem":600,"title":601,"description":602,"date":603,"image":604,"category":588,"redirected":559,"author":605,"readingTime":606},"blog/openrouter-vs-direct-api-agents","OpenRouter vs Direct API: Is It Cheaper? Real Cost Math (2026)","OpenRouter pricing explained: the 5.5% fee, how BYOK removes it, free models, and the monthly spend where going direct to the API is cheaper.","2026-06-03","/img/blog/openrouter-vs-direct-api-agents.jpg",{"name":7,"role":8,"avatar":9},"14 min read",1792566333453]