[{"data":1,"prerenderedAt":1119},["ShallowReactive",2],{"blog-post-claude-setup-token-third-party-tools":3,"related-posts-claude-setup-token-third-party-tools":1091,"decoder-links-claude-setup-token-third-party-tools":1115,"hero-size-claude-setup-token-third-party-tools":1116},{"id":4,"title":5,"author":6,"body":11,"bottomCta":1065,"category":1066,"date":1067,"definedTerm":1065,"description":1068,"extension":1069,"featured":1070,"hideToc":1070,"image":1071,"imageAlt":1072,"imageHeight":1073,"imageWidth":1074,"itemList":1065,"lang":1065,"lead":1065,"meta":1075,"navigation":248,"noindex":1070,"path":1076,"primaryHub":1065,"readingTime":1077,"redirected":1070,"relatedSlugs":1065,"seo":1078,"seoTitle":1079,"stem":1080,"subtitle":1081,"tags":1082,"updatedDate":1067,"__hash__":1090},"blog/blog/claude-setup-token-third-party-tools.md","claude setup-token: What It's For, How Long It Lasts, and Why Not to Paste It Into Other Tools",{"name":7,"role":8,"avatar":9,"bio":10},"Shabnam Katoch","Growth Head","/img/avatars/shabnam-profile.jpeg","Shabnam leads growth at BetterClaw and has spent the past three years building organic distribution for AI-native products. She writes about no-code agent builders, content strategy, and what it actually takes to grow without an ads budget.",{"type":12,"value":13,"toc":1030},"minimark",[14,21,24,37,40,59,64,70,80,87,90,93,121,130,138,142,149,166,170,173,202,205,265,271,276,287,291,297,308,312,322,329,336,340,343,467,480,494,586,598,606,612,616,623,633,637,643,646,674,680,684,687,694,697,703,707,710,716,730,733,744,748,751,780,783,787,791,797,802,805,810,813,816,819,825,829,832,836,844,850,854,860,868,872,879,885,891,895,901,907,911,917,923,927,932,936,942,946,949,954,957,972,980,984,988,994,998,1005,1009,1012,1016,1019,1023,1026],[15,16,17],"p",{},[18,19,20],"em",{},"\"paste it in. My openclaw webui dashboard shows up but I can't chat.\"",[15,22,23],{},"That was February 2026 on r/openclaw. Someone had generated a Claude setup-token, pasted it into OpenClaw, and got a dashboard that loaded but an agent that wouldn't talk.",[15,25,26,27,30,31,36],{},"Seven months later, an OpenClaw issue put it more bluntly: ",[18,28,29],{},"\"Anthropic now rejects setup tokens from third-party apps unless extra usage is purchased.\""," The error on that Max account read \"API Error: 400 Third-party apps now draw from your extra usage, not your plan limits.\" (The full OpenClaw story is in our ",[32,33,35],"a",{"href":34},"/blog/openclaw-anthropic-subscription-ban","OpenClaw and Anthropic subscription timeline",".)",[15,38,39],{},"So what is this token actually for? And why does it work in one place and fail in another?",[41,42,43],"blockquote",{},[15,44,45,49,50,54,55,58],{},[46,47,48],"strong",{},"The short version:"," ",[51,52,53],"code",{},"claude setup-token"," prints a one-year OAuth token tied to your Claude subscription. Anthropic documents it for \"CI pipelines, scripts, or other environments where interactive browser login isn't available\": you set it as ",[51,56,57],{},"CLAUDE_CODE_OAUTH_TOKEN"," and Claude Code uses your plan. It isn't an API key, it isn't saved anywhere, and it needs a paid plan. Pasting it into a third-party agent like OpenClaw or Hermes is the \"intermediate … session tokens\" case Anthropic's terms prohibit. Use an API key there instead.",[60,61,63],"h2",{"id":62},"what-claude-setup-token-does-and-what-it-doesnt","What claude setup-token does, and what it doesn't",[15,65,66,67],{},"Anthropic's authentication docs describe it in one line: ",[18,68,69],{},"\"For CI pipelines, scripts, or other environments where interactive browser login isn't available, generate a one-year OAuth token with claude setup-token.\"",[15,71,72,73,76,77],{},"The flow is the same as ",[51,74,75],{},"/login",". A browser opens, you approve, and the token prints in your terminal. The docs add: ",[18,78,79],{},"\"It does not save the token anywhere; copy it and set it as the CLAUDE_CODE_OAUTH_TOKEN environment variable wherever you want to authenticate.\"",[15,81,82,83,86],{},"Tokens start with ",[51,84,85],{},"sk-ant-oat01-",". Anthropic's docs don't state that prefix, but it appears in GitHub issues and in OpenClaw's documentation.",[15,88,89],{},"Note what the docs don't say. They never call it \"CI only\". Scripts and headless machines count too.",[15,91,92],{},"Here's what it can't do:",[94,95,96,100,107,118],"ul",{},[97,98,99],"li",{},"Start Remote Control sessions or fetch claude.ai connectors (locally configured MCP servers still work)",[97,101,102,103,106],{},"Run in bare mode or with ",[51,104,105],{},"CLAUDE_CODE_SIMPLE=1",", which ignore it",[97,108,109,110,113,114,117],{},"Read your usage through ",[51,111,112],{},"/api/oauth/usage",", which returns 403 because the token lacks the ",[51,115,116],{},"user:profile"," scope",[97,119,120],{},"Spend your Max or Ultra monthly API credit, because it isn't a Console key",[15,122,123,124,126,127],{},"It bills your subscription's plan limits, exactly like ",[51,125,75],{},". That includes GitHub Actions: runs started by the Claude Code GitHub Action ",[18,128,129],{},"\"count as Claude Code usage, so API credits don't cover them, even with -p.\"",[15,131,132,133,137],{},"If you're weighing this against a third-party agent like Hermes, our ",[32,134,136],{"href":135},"/blog/hermes-agent-claude-chatgpt-subscription#the-terms-question-first","Hermes subscription status guide"," explains which route sits on which side of Anthropic's rule.",[60,139,141],{"id":140},"who-can-create-a-claude-setup-token","Who can create a Claude setup token",[15,143,144,145,148],{},"The docs said on 29 November that the token ",[18,146,147],{},"\"requires a Pro, Max, Ultra, Team, or Enterprise plan.\""," So not Free.",[15,150,151,152,154,155,49,158,161,162,165],{},"One admin detail is worth knowing. ",[51,153,53],{}," and ",[51,156,157],{},"/install-github-app",[18,159,160],{},"\"enforce only forceLoginMethod, so they can mint a token in a different organization.\""," If your company relies on ",[51,163,164],{},"forceLoginOrgUUID"," to keep logins inside your organisation, this is a gap to plan around.",[60,167,169],{"id":168},"using-it-correctly-ci-scripts-and-headless-servers","Using it correctly: CI, scripts and headless servers",[15,171,172],{},"Generate it on any machine with a browser:",[174,175,180],"pre",{"className":176,"code":177,"language":178,"meta":179,"style":179},"language-bash shiki shiki-themes github-light","claude setup-token\n# approve in the browser, then copy the token from the screen\n","bash","",[51,181,182,195],{"__ignoreMap":179},[183,184,187,191],"span",{"class":185,"line":186},"line",1,[183,188,190],{"class":189},"s7eDp","claude",[183,192,194],{"class":193},"sYBdl"," setup-token\n",[183,196,198],{"class":185,"line":197},2,[183,199,201],{"class":200},"sAwPA","# approve in the browser, then copy the token from the screen\n",[15,203,204],{},"Then set it where Claude Code runs:",[174,206,208],{"className":176,"code":207,"language":178,"meta":179,"style":179},"# macOS, Linux, WSL\nexport CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...\nclaude -p \"Summarise the failing tests in this repo\"\n\n# Windows PowerShell\n$env:CLAUDE_CODE_OAUTH_TOKEN = \"sk-ant-oat01-...\"\n",[51,209,210,215,231,243,250,256],{"__ignoreMap":179},[183,211,212],{"class":185,"line":186},[183,213,214],{"class":200},"# macOS, Linux, WSL\n",[183,216,217,221,225,228],{"class":185,"line":197},[183,218,220],{"class":219},"sD7c4","export",[183,222,224],{"class":223},"sgsFI"," CLAUDE_CODE_OAUTH_TOKEN",[183,226,227],{"class":219},"=",[183,229,230],{"class":223},"sk-ant-oat01-...\n",[183,232,234,236,240],{"class":185,"line":233},3,[183,235,190],{"class":189},[183,237,239],{"class":238},"sYu0t"," -p",[183,241,242],{"class":193}," \"Summarise the failing tests in this repo\"\n",[183,244,246],{"class":185,"line":245},4,[183,247,249],{"emptyLinePlaceholder":248},true,"\n",[183,251,253],{"class":185,"line":252},5,[183,254,255],{"class":200},"# Windows PowerShell\n",[183,257,259,262],{"class":185,"line":258},6,[183,260,261],{"class":223},"$env:CLAUDE_CODE_OAUTH_TOKEN = ",[183,263,264],{"class":193},"\"sk-ant-oat01-...\"\n",[15,266,267,268],{},"Anthropic's environment-variable reference adds a useful detail: ",[18,269,270],{},"\"Unless you run /login, Claude Code uses the token you set for the whole session. To replace an expired token, generate a new one and restart.\"",[272,273,275],"h3",{"id":274},"the-gotcha-that-breaks-ci-scripts","The gotcha that breaks CI scripts",[15,277,278,279,282,283,286],{},"Don't try ",[51,280,281],{},"$(claude setup-token)"," in a script. Claude Code issue #97350 explains why: the command ",[18,284,285],{},"\"writes the token and its interactive UI to the same stdout,\""," so the captured value needs cleaning up. Copy it from the screen instead.",[272,288,290],{"id":289},"headless-servers","Headless servers",[15,292,293,294,296],{},"On a VPS with no browser, run ",[51,295,53],{}," on your laptop and paste the token into the server's environment. That's the documented use.",[15,298,299,300,303,304,307],{},"If the command isn't found, install or update Claude Code first (",[51,301,302],{},"npm install -g @anthropic-ai/claude-code"," or ",[51,305,306],{},"claude update","). On zsh, check that the install folder is on your PATH.",[272,309,311],{"id":310},"github-actions","GitHub Actions",[15,313,314,315,317,318,321],{},"Store the token as a repository secret named ",[51,316,57],{}," and pass it to the action's ",[51,319,320],{},"claude_code_oauth_token"," input.",[15,323,324,325,328],{},"Stay with me here, because this catches teams out. Anthropic's docs warn that an OAuth token ",[18,326,327],{},"\"is tied to the subscription of the person who ran claude setup-token.\""," For a secret shared across repositories, they recommend an API key instead.",[15,330,331],{},[332,333],"img",{"alt":334,"src":335},"Correct use, mint once and use in CI: run claude setup-token on a laptop with a browser, approve in the browser, then set CLAUDE_CODE_OAUTH_TOKEN on the CI runner; the token is not saved anywhere and is tied to one person's plan","/img/blog/claude-setup-token-third-party-tools-ci-use.jpg",[60,337,339],{"id":338},"claude_code_oauth_token-vs-anthropic_api_key-which-one-wins","CLAUDE_CODE_OAUTH_TOKEN vs ANTHROPIC_API_KEY: which one wins",[15,341,342],{},"When several credentials are present, Claude Code picks one in a fixed order. Here's the full list from Anthropic's docs:",[344,345,346,362],"table",{},[347,348,349],"thead",{},[350,351,352,356,359],"tr",{},[353,354,355],"th",{},"Rank",[353,357,358],{},"Credential",[353,360,361],{},"What it's for",[363,364,365,388,401,414,428,440,455],"tbody",{},[350,366,367,371,385],{},[368,369,370],"td",{},"1",[368,372,373,374,377,378,377,381,384],{},"Cloud provider (",[51,375,376],{},"CLAUDE_CODE_USE_BEDROCK",", ",[51,379,380],{},"_VERTEX",[51,382,383],{},"_FOUNDRY",")",[368,386,387],{},"Bedrock, Vertex or Foundry billing",[350,389,390,393,398],{},[368,391,392],{},"2",[368,394,395],{},[51,396,397],{},"ANTHROPIC_AUTH_TOKEN",[368,399,400],{},"Bearer token for an LLM gateway or proxy",[350,402,403,406,411],{},[368,404,405],{},"3",[368,407,408],{},[51,409,410],{},"ANTHROPIC_API_KEY",[368,412,413],{},"A Console API key",[350,415,416,419,425],{},[368,417,418],{},"4",[368,420,421,424],{},[51,422,423],{},"apiKeyHelper"," output",[368,426,427],{},"Rotating credentials from a vault",[350,429,430,433,437],{},[368,431,432],{},"5",[368,434,435],{},[51,436,57],{},[368,438,439],{},"Your setup-token",[350,441,442,445,448],{},[368,443,444],{},"6",[368,446,447],{},"Anthropic profile or federation credentials",[368,449,450,451,454],{},"The ",[51,452,453],{},"ant"," CLI and Workload Identity Federation",[350,456,457,460,464],{},[368,458,459],{},"7",[368,461,462],{},[51,463,75],{},[368,465,466],{},"Your normal subscription sign-in",[15,468,469,470,473,474,476,477],{},"Two lines from the docs explain most \"why isn't my token being used?\" questions. First: ",[18,471,472],{},"\"In non-interactive mode (-p), the key is always used when present.\""," Second: if you have a subscription but ",[51,475,410],{}," is also set, ",[18,478,479],{},"\"Claude Code uses the API key once you approve it.\"",[15,481,482,483,485,486,489,490,493],{},"So if Claude Code seems to ignore your setup-token, an API key, auth token or ",[51,484,423],{}," is probably outranking it. Run ",[51,487,488],{},"unset ANTHROPIC_API_KEY"," and check ",[51,491,492],{},"/status",".",[344,495,496,508],{},[347,497,498],{},[350,499,500,502,505],{},[353,501],{},[353,503,504],{},"Setup-token",[353,506,507],{},"Console API key",[363,509,510,521,533,544,555,564,575],{},[350,511,512,515,518],{},[368,513,514],{},"What it is",[368,516,517],{},"An OAuth token for your subscription",[368,519,520],{},"A pay-as-you-go key",[350,522,523,526,530],{},[368,524,525],{},"Where you get it",[368,527,528],{},[51,529,53],{},[368,531,532],{},"Claude Console",[350,534,535,538,541],{},[368,536,537],{},"What it bills",[368,539,540],{},"Your plan limits",[368,542,543],{},"Per token, to the key owner",[350,545,546,549,552],{},[368,547,548],{},"Lifetime",[368,550,551],{},"One year",[368,553,554],{},"Until you delete it",[350,556,557,560,562],{},[368,558,559],{},"Precedence rank",[368,561,432],{},[368,563,405],{},[350,565,566,569,572],{},[368,567,568],{},"Meant for",[368,570,571],{},"Your own CI, scripts, headless boxes",[368,573,574],{},"Anything, including tools you build",[350,576,577,580,583],{},[368,578,579],{},"Third-party tools?",[368,581,582],{},"No",[368,584,585],{},"Yes, billed to the key owner",[15,587,588,589,591,592,595,596,493],{},"One more trap: don't feed the setup-token through ",[51,590,423],{},". Issue #97350 reports that every request then fails with ",[51,593,594],{},"401 authentication_error: API key is invalid",", while the same token works fine as ",[51,597,57],{},[15,599,600,601,605],{},"If you're on Max or Ultra, the API-key column costs less than it looks: your monthly API credit can pay for it. Our guide to ",[32,602,604],{"href":603},"/blog/claude-max-api-credits-ai-agents","funding an agent's API key from your Max or Ultra credit"," shows how.",[15,607,608],{},[332,609],{"alt":610,"src":611},"Precedence, which credential wins: cloud provider, AUTH_TOKEN, API_KEY (always wins in -p), apiKeyHelper, OAUTH_TOKEN (the setup-token at rank 5), profile, then /login; unset the API key to use the token","/img/blog/claude-setup-token-third-party-tools-precedence.jpg",[60,613,615],{"id":614},"expiry-renewal-and-revocation","Expiry, renewal and revocation",[15,617,618,619,622],{},"The token lasts one year. Nothing warns you before it expires: one tool's issue tracker (igor #145) puts it plainly, ",[18,620,621],{},"\"A seat's setup-token expires after a year and nothing warns before it does.\""," Put a calendar reminder in when you create it.",[15,624,625,626,629,630,493],{},"Don't confuse this with your normal login. Interactive claude.ai logins have their own end dates, which ",[51,627,628],{},"claude auth status --text"," shows on a line starting ",[51,631,632],{},"Sign-in ends:",[272,634,636],{"id":635},"yes-you-can-revoke-it","Yes, you can revoke it",[15,638,639,640],{},"Some guides say a setup-token can't be revoked. That's wrong. Anthropic's help article on logging out of all active sessions lists ",[18,641,642],{},"\"Claude Code, including tokens created with setup-token for continuous integration (CI).\"",[15,644,645],{},"You have three routes:",[647,648,649,655,668],"ol",{},[97,650,651,654],{},[46,652,653],{},"claude.ai Settings > Account > Log out of all sessions."," This signs out everything, including setup-tokens.",[97,656,657,660,661,154,664,667],{},[46,658,659],{},"Settings > Claude Code",", where Anthropic says you can ",[18,662,663],{},"\"manage your authorization tokens\"",[18,665,666],{},"\"click the trash can icon\""," to remove one.",[97,669,670,673],{},[46,671,672],{},"Settings > Account > Active sessions",", then the three-dot menu and \"Terminate\".",[15,675,676,677],{},"Here's what nobody tells you: deleting a GitHub secret does not revoke the token. Anthropic's GitHub Actions doc says so directly: ",[18,678,679],{},"\"If you delete a secret, the credential it held stays valid.\"",[272,681,683],{"id":682},"the-honest-gap","The honest gap",[15,685,686],{},"Revoking is possible. Knowing which token you're revoking is harder.",[15,688,689,690,693],{},"Claude Code issue #99702 (open) says the Settings list ",[18,691,692],{},"\"shows no identifying fragment of the token itself, not even the last 4 characters.\""," Issue #106670 (open) asks whether minting a new token kills the old one, and has no answer yet.",[15,695,696],{},"So if a token leaks, log out of all sessions. That revokes every login on every machine. Then mint a fresh token.",[15,698,699],{},[332,700],{"alt":701,"src":702},"Revocation, three ways to revoke, and deleting the secret is not one: log out everywhere revokes all, Settings > Claude Code removes one token, Active sessions terminates, while deleting the GitHub secret leaves the token valid; the list shows no token fragment, so after a leak log out everywhere","/img/blog/claude-setup-token-third-party-tools-revoke.jpg",[60,704,706],{"id":705},"third-party-tools-why-its-blocked-and-what-to-use-instead","Third-party tools: why it's blocked, and what to use instead",[15,708,709],{},"This is the part most people are actually searching for.",[15,711,712,713],{},"Anthropic's Claude Code legal page is specific. OAuth is ",[18,714,715],{},"\"intended exclusively for purchasers of Claude … subscription plans and is designed to support ordinary use of Claude Code and other native Anthropic applications.\"",[15,717,718,719,722,723,726,727],{},"Developers ",[18,720,721],{},"\"should use API key authentication.\""," And they ",[18,724,725],{},"\"may not collect, store, or intermediate Claude.ai credentials or session tokens,\""," and that ",[18,728,729],{},"\"sign-in to a Claude account must complete through Anthropic's own flow.\"",[15,731,732],{},"Handing your setup-token to OpenClaw, Hermes or any other agent tool puts that tool in the middle of your credentials. That's the case the sentence describes.",[15,734,735,736,739,740,743],{},"The help centre adds the billing side. Anthropic ",[18,737,738],{},"\"reserves the right to draw use of such third-party tools from usage credits rather than subscription limits,\""," and tools that ",[18,741,742],{},"\"misrepresent their identity to Anthropic's servers\""," are prohibited.",[272,745,747],{"id":746},"what-happens-in-practice","What happens in practice",[15,749,750],{},"The evidence lines up with the policy:",[94,752,753,759,770],{},[97,754,755,758],{},[46,756,757],{},"9 January 2026:"," Anthropic blocked third-party use of Claude Code subscriptions (a 625-point Hacker News thread).",[97,760,761,764,765,769],{},[46,762,763],{},"3 September 2026:"," OpenClaw issue #136991 shows a setup-token handed to OpenClaw returning \"API Error: 400 Third-party apps now draw from your extra usage, not your plan limits.\" Our guide to ",[32,766,768],{"href":767},"/blog/third-party-apps-now-draw-from-your-extra-usage","the \"Third-party apps now draw from your extra usage\" error"," covers every variant.",[97,771,772,775,776,779],{},[46,773,774],{},"Today:"," Hermes' docs still show a \"fallback / legacy\" ",[51,777,778],{},"ANTHROPIC_TOKEN"," override that accepts a setup-token. We don't recommend it.",[15,781,782],{},"There's a newer wrinkle. Nous' DirectSDK plugin 0.5.0 (28 November) can take a setup-token as one of several pooled logins, which it passes to the unmodified Claude Code binary. Anthropic hasn't said how that sits against its \"intermediate\" line, so we'd stick to the options below.",[272,784,786],{"id":785},"the-alternatives","The alternatives",[15,788,789],{},[46,790,413],{},[15,792,793,794,796],{},"Set it as ",[51,795,410],{}," in your agent. On Max or Ultra, it can be funded by your monthly API credit ($100 or $200). The credit guide linked in the precedence section shows how to claim it.",[15,798,799],{},[46,800,801],{},"For Hermes, sign in to Claude Code yourself",[15,803,804],{},"The DirectSDK plugin drives your own signed-in Claude Code binary, which is the case the legal page says isn't prevented. It works today, metered as Agent SDK usage, and may be billed to usage credits. The Hermes status guide linked near the top explains which route sits on which side of the rule.",[15,806,807],{},[46,808,809],{},"Run the job in Claude Code itself",[15,811,812],{},"If it's a one-off, the CLI on your own login is the simplest answer.",[15,814,815],{},"For OpenClaw specifically, the setup-token route and its history are in the OpenClaw timeline linked at the top.",[15,817,818],{},"We built BetterClaw so nobody has to paste a Claude.ai token anywhere. Agents run on your own API key from any of 28+ providers at zero markup, or on your ChatGPT Plus or Pro sign-in.",[15,820,821],{},[332,822],{"alt":823,"src":824},"Third-party tools, use a key, not a token: passing a setup-token to an agent app means intermediating tokens, so give your agent a Console API key, your own Claude Code login or run it in the CLI instead; API keys bill the key owner","/img/blog/claude-setup-token-third-party-tools-use-api-key.jpg",[60,826,828],{"id":827},"errors-with-the-documented-text","Errors, with the documented text",[15,830,831],{},"All of these come from Anthropic's Claude Code errors page unless noted.",[272,833,835],{"id":834},"revoked-token-interactive","Revoked token (interactive)",[174,837,842],{"className":838,"code":840,"language":841},[839],"language-text","OAuth token revoked · Please run /login\n","text",[51,843,840],{"__ignoreMap":179},[15,845,846,847],{},"Anthropic: ",[18,848,849],{},"\"A revoked token means you signed out everywhere or an admin removed access.\"",[272,851,853],{"id":852},"expired-token-interactive","Expired token (interactive)",[174,855,858],{"className":856,"code":857,"language":841},[839],"Please run /login · API Error: 401 OAuth token has expired ...\n",[51,859,857],{"__ignoreMap":179},[15,861,862,863,377,865],{},"The docs add that if you authenticate with ",[51,864,57],{},[18,866,867],{},"\"you see the same messages when that token expires or is revoked.\"",[272,869,871],{"id":870},"in-p-mode-and-the-agent-sdk","In -p mode and the Agent SDK",[15,873,874,875,878],{},"The error code is ",[51,876,877],{},"authentication_failed",":",[174,880,883],{"className":881,"code":882,"language":841},[839],"Failed to authenticate: OAuth token revoked. Please log in again or contact your administrator.\nFailed to authenticate. API Error: 401 OAuth token has expired ...\n",[51,884,882],{"__ignoreMap":179},[15,886,887,888],{},"The fix: Claude Code keeps sending the value you set after a 401, so ",[18,889,890],{},"\"Generate a fresh token with claude setup-token and restart with it, or unset the variable and run /login.\"",[272,892,894],{"id":893},"account-or-organisation-problem-not-expiry","Account or organisation problem, not expiry",[174,896,899],{"className":897,"code":898,"language":841},[839],"API Error: 401 Invalid authentication credentials\n",[51,900,898],{"__ignoreMap":179},[15,902,903,904],{},"Anthropic says this appears when a credential was recently revoked, an organisation removed your access, or the account was deactivated, ",[18,905,906],{},"\"so an expired token isn't the cause.\"",[272,908,910],{"id":909},"old-scopes","Old scopes",[174,912,915],{"className":913,"code":914,"language":841},[839],"OAuth token does not meet scope requirement: user:profile\n",[51,916,914],{"__ignoreMap":179},[15,918,919,920,922],{},"Run ",[51,921,75],{}," to get a token with current scopes.",[272,924,926],{"id":925},"through-apikeyhelper","Through apiKeyHelper",[15,928,929,931],{},[51,930,594],{}," (issue #97350). Use the environment variable instead.",[272,933,935],{"id":934},"in-a-third-party-tool","In a third-party tool",[15,937,938,941],{},[51,939,940],{},"API Error: 400 Third-party apps now draw from your extra usage, not your plan limits."," This is what OpenClaw users saw. The error guide linked in the section above covers every variant and the fixes.",[60,943,945],{"id":944},"the-token-is-fine-the-destination-is-the-problem","The token is fine. The destination is the problem.",[15,947,948],{},"Here's the honest takeaway.",[15,950,951,953],{},[51,952,53],{}," is a genuinely useful tool. It lets your own scripts and pipelines use the plan you already pay for, with no browser in sight. The trouble only starts when it leaves your hands.",[15,955,956],{},"The rule of thumb is simple. If the thing running Claude is yours, the token fits. If it's someone else's app, give that app an API key.",[15,958,959,960,966,967,971],{},"If you want an agent without any of this, ",[32,961,965],{"href":962,"rel":963},"https://app.betterclaw.io/sign-in",[964],"nofollow","start free with BetterClaw",". The free plan includes 1 agent and 100 credits a month with no card, and Starter is $19 a month for 2,000 credits (",[32,968,970],{"href":969},"/pricing","see full pricing",").",[15,973,974,975,979],{},"Build it visually in our ",[32,976,978],{"href":977},"/ai-agent-builder","no-code AI agent builder"," on your own key at zero markup. We handle the infrastructure. You handle the interesting part.",[60,981,983],{"id":982},"frequently-asked-questions","Frequently Asked Questions",[272,985,987],{"id":986},"what-is-claude-setup-token","What is claude setup-token?",[15,989,990,991,993],{},"It's a Claude Code command that prints a one-year OAuth token tied to your Claude subscription. Anthropic documents it \"for CI pipelines, scripts, or other environments where interactive browser login isn't available.\" You set it as ",[51,992,57],{},", and Claude Code bills your plan limits.",[272,995,997],{"id":996},"whats-the-difference-between-claude_code_oauth_token-and-anthropic_api_key","What's the difference between CLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_API_KEY?",[15,999,1000,1001,1004],{},"The OAuth token uses your subscription's plan limits; the API key bills per token to the Console account that owns it. If both are set, the API key wins, and in ",[51,1002,1003],{},"-p"," mode \"the key is always used when present.\" Only the API key is meant for third-party tools.",[272,1006,1008],{"id":1007},"how-do-i-revoke-a-claude-setup-token","How do I revoke a Claude setup token?",[15,1010,1011],{},"Log out of all sessions in claude.ai Settings > Account, which Anthropic says covers \"tokens created with setup-token,\" or remove it with the trash-can icon in Settings > Claude Code. The list doesn't show which token is which, so after a leak, logging out everywhere is safest. Deleting a GitHub secret does not revoke it.",[272,1013,1015],{"id":1014},"how-long-does-a-claude-setup-token-last-and-does-it-cost-extra","How long does a Claude setup token last, and does it cost extra?",[15,1017,1018],{},"It lasts one year, with no warning before it expires. It doesn't cost extra: it draws on your existing plan limits, and it can't spend your Max or Ultra monthly API credit.",[272,1020,1022],{"id":1021},"can-i-use-a-claude-setup-token-with-openclaw-or-hermes","Can I use a Claude setup token with OpenClaw or Hermes?",[15,1024,1025],{},"Anthropic's terms say developers \"may not collect, store, or intermediate Claude.ai credentials or session tokens,\" and OpenClaw users who tried it got a 400 asking them to buy extra usage. Use a Console API key in those tools instead, or, for Hermes, sign in to Claude Code yourself through the DirectSDK plugin.",[1027,1028,1029],"style",{},"html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}",{"title":179,"searchDepth":197,"depth":197,"links":1031},[1032,1033,1034,1039,1040,1044,1048,1057,1058],{"id":62,"depth":197,"text":63},{"id":140,"depth":197,"text":141},{"id":168,"depth":197,"text":169,"children":1035},[1036,1037,1038],{"id":274,"depth":233,"text":275},{"id":289,"depth":233,"text":290},{"id":310,"depth":233,"text":311},{"id":338,"depth":197,"text":339},{"id":614,"depth":197,"text":615,"children":1041},[1042,1043],{"id":635,"depth":233,"text":636},{"id":682,"depth":233,"text":683},{"id":705,"depth":197,"text":706,"children":1045},[1046,1047],{"id":746,"depth":233,"text":747},{"id":785,"depth":233,"text":786},{"id":827,"depth":197,"text":828,"children":1049},[1050,1051,1052,1053,1054,1055,1056],{"id":834,"depth":233,"text":835},{"id":852,"depth":233,"text":853},{"id":870,"depth":233,"text":871},{"id":893,"depth":233,"text":894},{"id":909,"depth":233,"text":910},{"id":925,"depth":233,"text":926},{"id":934,"depth":233,"text":935},{"id":944,"depth":197,"text":945},{"id":982,"depth":197,"text":983,"children":1059},[1060,1061,1062,1063,1064],{"id":986,"depth":233,"text":987},{"id":996,"depth":233,"text":997},{"id":1007,"depth":233,"text":1008},{"id":1014,"depth":233,"text":1015},{"id":1021,"depth":233,"text":1022},null,"Guides","2026-12-01","What claude setup-token creates, CLAUDE_CODE_OAUTH_TOKEN vs ANTHROPIC_API_KEY, expiry, revoking it, and why OpenClaw or Hermes is the wrong place for it.","md",false,"/img/blog/claude-setup-token-third-party-tools.jpg","Claude Code guide cover: claude setup-token printing an sk-ant-oat01 token, labelled for CI and scripts and not for other apps",512,1024,{},"/blog/claude-setup-token-third-party-tools","12 min read",{"title":5,"description":1068},"Claude Setup Token: What It's For and Where It's Blocked","blog/claude-setup-token-third-party-tools","What the command creates, who can make one, CLAUDE_CODE_OAUTH_TOKEN vs ANTHROPIC_API_KEY, expiry and the revocation path most guides miss, the documented errors, and why OpenClaw and Hermes are the wrong place for it. Docs quoted as checked 29 November 2026.",[1083,1084,320,1085,1086,1087,1088,1089],"claude setup token","claude code oauth token","claude_code_oauth_token vs anthropic_api_key","claude setup token revoke","claude setup token openclaw","claude setup token hermes","claude code oauth token github actions","SkHhpc1NDvXNiVeCqI4yJfP5DQNRXPlv7W7kzDtOEyA",[1092,1099,1107],{"stem":1093,"title":1094,"description":1095,"date":1067,"image":1096,"category":1097,"redirected":1070,"author":1098,"readingTime":1077},"blog/claude-subscription-vs-api-for-agents","Claude Subscription vs API for AI Agents: Which Actually Costs Less?","Claude Pro, Max or Ultra vs the API for an AI agent: per-turn maths on Sonnet, Opus, Haiku and Fable, plan limits, monthly API credits and when each wins.","/img/blog/claude-subscription-vs-api-for-agents.jpg","Comparison",{"name":7,"role":8,"avatar":9,"bio":10},{"stem":1100,"title":1101,"description":1102,"date":1067,"image":1103,"category":1104,"redirected":1070,"author":1105,"readingTime":1106},"blog/third-party-apps-now-draw-from-your-extra-usage","\"Third-Party Apps Now Draw From Your Extra Usage\": What It Means and How to Fix It","The Claude 400 \"Third-party apps now draw from your extra usage\" explained: every variant, which tools trigger it, what it costs and the 3 fixes.","/img/blog/third-party-apps-now-draw-from-your-extra-usage.jpg","Troubleshooting",{"name":7,"role":8,"avatar":9,"bio":10},"14 min read",{"stem":1108,"title":1109,"description":1110,"date":1111,"image":1112,"category":1066,"redirected":1070,"author":1113,"readingTime":1114},"blog/claude-code-auto-compact-settings","Claude Code Auto Compact: What the Threshold Is, the Two Settings That Change It, and the Cost","How Claude Code auto compact works, the default threshold, the two settings that change when it compacts, the cost per request and when it is not working.","2026-11-13","/img/blog/claude-code-auto-compact-settings.jpg",{"name":7,"role":8,"avatar":9,"bio":10},"10 min read",[],{"width":1117,"height":1118},1536,768,1796193348772]