Is This Allowed? Claude Code Terms of Service Explained

Claude Code terms of service key rules and usage policies explained for developers
FIG 1.0 // IS THIS ALLOWED? CLAUDE CODE TERMS OF SERVICE EXPLAINED ID: POST-226

Updated February 20, 2026: On February 19, 2026, Anthropic published updated Legal and Compliance documentation clarifying authentication policies. Key change: the Agent SDK now explicitly requires API key authentication — OAuth tokens from Free/Pro/Max accounts cannot be used with the Agent SDK. The docs also note that subscription usage limits assume “ordinary, individual usage.” For local Claude Code CLI usage on your own computer, nothing changes. For business or always-on deployments, use API keys. See the updates below.

Based on Anthropic’s current terms, running Claude Code CLI on your own computer works as it always has — it’s Anthropic’s official product built for scripted and automated use, and the Consumer ToS exempts it from the prohibition on automated access. For anything production, always-on, or business-related, API keys under the Commercial Terms are the clear path — with no automation restrictions and no ambiguity.

Every time I post a video about running Claude Code as an always-on AI assistant, the same question shows up in the comments: “Won’t Anthropic ban me for this?”

I get it. You’re paying $100-200/month for a Claude subscription, you set up an always-on AI assistant, and now you’re worried you just violated some terms you didn’t read.

So I read them. All of them. Here’s what you actually need to know.

The Short Answer

If you’re using Claude Code CLI — Anthropic’s own product — you’re fine. Whether you run it locally or on a VPS, whether it’s for personal or business use, Claude Code is an intended, official way to use Claude programmatically.

If you’re using an API key instead of a subscription, you have even fewer restrictions.

Now let me show you exactly why.

The Two Ways to Use Claude Code

Claude Code supports two authentication methods, and they fall under completely different legal terms:

  1. Pro/Max Subscription → Consumer Terms of Service
    Pro ($20/mo) gives you Claude Code access but with limited usage — good to start, but quickly limiting for heavy automation. Max ($100-200/mo) unlocks the full power with significantly higher limits. Both share usage limits with the claude.ai web interface.
  2. API Key (Anthropic Console) → Commercial Terms of Service
    You pay per token. No shared limits. Designed for developers and businesses.

This distinction matters because the rules are different for each.

“But Section 3.7 Says…”

One of my viewers left a detailed comment citing “Consumer ToS Section 3.7” as proof that running Claude Code as a bot violates the terms.

Here’s the thing: Section 3.7 doesn’t exist.

The Consumer Terms Section 3 (“Use of our Services”) contains a numbered list of prohibited uses. Item 7 on that list is what people are referencing. Here’s what it actually says:

“Except when you are accessing our Services via an Anthropic API Key or where we otherwise explicitly permit it, to access the Services through automated or non-human means, whether through a bot, script, or otherwise.”

Read it carefully. There are two explicit exceptions:

  • Via an Anthropic API Key — if you’re using an API key, this restriction doesn’t apply at all
  • Where Anthropic otherwise explicitly permits it — Claude Code CLI is Anthropic’s own official product, built specifically for scripted and automated use

This isn’t a gray area. Anthropic’s Claude Code documentation literally shows you how to pipe, script, and automate:

tail -f app.log | claude -p "alert me if you see anomalies"
git diff main | claude -p "review for security issues"

They even have official GitHub Actions integration — fully automated CI/CD pipelines running on cron schedules with zero human interaction. That’s as “automated and non-human” as it gets, and it’s in their official docs. You can take this automation even further with Claude Code hooks, which let you trigger custom scripts before and after Claude Code actions.

What About Running It on a VPS?

No restrictions whatsoever. Neither the Consumer Terms, Commercial Terms, nor the Acceptable Use Policy contain any language about where you run Claude Code.

Anthropic’s own enterprise documentation supports deployment across AWS Bedrock, Google Vertex AI, corporate proxies, and custom LLM gateways. You can even set a custom base URL:

export ANTHROPIC_BASE_URL='https://your-gateway.com'

Running Claude Code on a $5/month VPS is an intended deployment pattern, not a loophole.

Why My Full Version Uses API Keys on the Server (And You Should Too)

Here’s something most people don’t think about: subscription auth workarounds on a VPS are prohibited by Anthropic’s Terms of Service — and even if they weren’t, they’d be the wrong tool for server deployment. Let me explain why the full version of my bot (GoBot) uses API keys on the VPS instead of my Max subscription.

The Authentication Problem

Claude Code subscription requires a browser-based OAuth login. There’s no clean headless way to do this on a server. People have tried:

  • SSH port forwarding — Run claude /login on the VPS, forward port 8080 to your local machine, complete OAuth in your local browser. It works, but tokens expire in 8-12 hours and refresh tokens eventually die too. You’ll be re-authenticating regularly.
  • Copying credential files — Transfer ~/.claude/.credentials.json from your Mac to the VPS. Problem: macOS stores tokens in Keychain and actively deletes the credential file. And again, tokens expire.
  • claude setup-token — Anthropic’s intended solution for CI/CD. Still buggy — multiple open GitHub issues about it not working properly.

Beyond the practical limitations, these OAuth workarounds are prohibited by Anthropic’s Terms of Service — extracting or transferring subscription tokens to use outside the official CLI constitutes the same token extraction that led Anthropic to restrict consumer OAuth tokens in third-party tools like OpenClaw. You’d also wake up to a dead bot because tokens expire within hours.

An API key? Set it once, forget it. export ANTHROPIC_API_KEY=sk-ant-... and you’re done forever.

The Speed Problem

This is the real killer. Every time you use Claude Code CLI, it spawns a subprocess that loads all your MCP servers, skills, and hooks. On my Mac with 13 MCP servers configured, that’s 10-60 seconds of startup per message.

For complex tasks, that’s fine. But 60% of messages to my bot are simple — “what time is my next meeting?” or “good morning.” Spending 60 seconds to initialize a full Claude Code environment for a one-line answer is absurd.

Here’s how GoBot actually handles it:

Message Type How It’s Processed Response Time Cost
Simple questions (60%) Direct Anthropic API call 2-5 seconds $0.01-0.05
Complex tasks (40%) Agent SDK (full Claude Code power) 5-30 seconds $0.10-2.00
When my Mac is awake Forwarded to Mac 10-60 seconds Included in Max subscription ($100-200/mo)

The bot classifies every message by complexity. Simple stuff goes straight to the API — no subprocess, no MCP loading, just a fast HTTP call. Complex stuff (research, strategy, multi-step tasks) gets routed through the Agent SDK, which gives you full Claude Code capabilities including MCP servers and tools.

And here’s the clever part: hybrid mode. When my Mac is awake, the VPS forwards everything to it for subscription-included processing (no additional API cost). When I’m asleep or away, the VPS handles it via API. Best of both worlds. I go deeper into the full architecture in my article on building a AI Second Brain.

The Control Advantage

With API keys, you get:

  • Model selection per message — pick exactly which model handles each request
  • Budget caps — set daily spending limits, auto-downgrade from Opus to Sonnet when budget runs low
  • No shared limits — your bot doesn’t compete with your claude.ai web usage
  • Commercial Terms — explicitly designed for automated, business use

With a subscription, you get none of that. One model, shared limits, Consumer Terms.

What About Using It for Business?

Depends on your plan:

  • API Key / Teams / Enterprise: Commercial use is explicitly permitted. The Commercial Terms say you can “power products and services you make available to your own customers and end users.”
  • Pro/Max Subscription: These are consumer plans designed for individual use. They don’t explicitly prohibit business use, but they weren’t designed for it either.

My recommendation: If you’re building something for your business, use an API key. It’s pay-per-token, falls under Commercial Terms, and has zero ambiguity. Most people I know who run their bots on a VPS spend varying amounts on API usage depending on their model selection and volume — smart routing (Haiku/Sonnet/Opus) keeps costs optimized.

What About Using Multiple AI Models?

Some of you route between Claude, Ollama, and OpenRouter depending on the task complexity. Is that allowed?

Yes. Neither the Consumer Terms, Commercial Terms, nor the AUP prohibit using Claude alongside other models. The only restriction is using Claude’s output to train a competing AI model — which none of us are doing.

Claude Code itself supports third-party model providers natively. This isn’t a workaround, it’s a feature.

What IS Actually Prohibited?

Let’s be clear about what Anthropic does restrict:

1. Third-party tools spoofing Claude Code.

In January 2026, Anthropic enforced its Terms of Service against unauthorized tools that extracted OAuth tokens from Claude Code subscriptions and used them in their own API clients. Tools like OpenClaw (formerly Clawdbot), OpenCode, Roo Code, and Goose had their consumer OAuth tokens blocked. OpenClaw, which is still active and open source with 140K+ GitHub stars, now recommends API keys for Anthropic access. Anthropic stated they “tightened safeguards against spoofing the Claude Code harness.” Users running these tools had their accounts suspended.

What was banned specifically: tools that intercept the OAuth authentication flow, extract the access token, and make API calls pretending to be Claude Code. This is token extraction — using someone else’s credentials in your own client.

What remains allowed: using the actual claude CLI binary (Anthropic’s official product) on any machine — local, VPS, CI/CD. GoBot calls claude -p which spawns a real Claude Code subprocess. It does not extract tokens or impersonate Claude Code. This is the critical distinction.

The key distinction: calling claude -p (the real CLI) = allowed. Extracting OAuth tokens to use in a third-party API client = banned.

2. Building competing AI products. You can’t use Claude to train your own competing model or resell API access.

3. Harmful content. The Acceptable Use Policy covers the obvious stuff: no malware, no harassment, no deception, no weapons.

4. High-risk autonomous systems. If you’re deploying Claude in healthcare, legal, or financial contexts, Anthropic requires human-in-the-loop review and disclosure.

None of these are about running Claude Code as a personal AI assistant.

Agent SDK: API Keys Required (February 2026 Update)

As of February 19, 2026, Anthropic’s official Legal and Compliance docs explicitly state that the Agent SDK requires API key authentication. Using OAuth tokens from Free, Pro, or Max subscriptions with the Agent SDK is not permitted. If you’re building with the Agent SDK, use an API key from console.anthropic.com.

The docs also introduced the phrase “ordinary, individual usage” when describing what subscription usage limits assume. For local development and personal use on your own computer, Claude Code works as it always has. For business or production use cases, API keys under the Commercial Terms are the clear path.

Note on the current situation: There has been some confusion in the community. Anthropic employee Thariq Shihipar tweeted that the docs update was “a docs clean up that caused some confusion” and that “nothing is changing about how you can use the Agent SDK and MAX subscriptions.” However, the written docs explicitly state otherwise. When in doubt, follow the written policy — and use API keys for anything beyond personal/local use.

The Bottom Line

Our recommendation: Use Claude Code CLI locally on your computer — that’s Anthropic’s official product, nothing changes. For anything production, always-on, or business-related, use API keys. GoBot’s smart routing technique (Haiku for simple queries, Sonnet for medium, Opus for complex) keeps API costs manageable.

Here’s the decision tree:

  • Using Claude Code CLI on your own computer? Nothing changes. It’s Anthropic’s official product — local, daemon, cron job, all good.
  • Using an API key? The clearest path. Commercial Terms have no automation restrictions.
  • Using the Agent SDK? API keys required — OAuth tokens from subscriptions are not permitted per the February 2026 docs update.
  • Using a Pro or Max subscription? Claude Code CLI is permitted on both. Anthropic’s docs note that usage limits assume “ordinary, individual usage.” Pro ($20/mo) has lower limits; Max ($100-200/mo) for more power.
  • Using it for business? Use an API key. Falls under Commercial Terms with zero ambiguity. GoBot’s smart routing keeps costs down.
  • Running it on a VPS? Use an API key — subscription OAuth on servers is both impractical (tokens expire) and prohibited. Direct API calls are faster anyway.
  • Routing between multiple models? Totally fine. Just don’t train competing models.

My Setup (Full Transparency)

Here’s exactly how I run my AI Second Brain:

Local (Mac)

  • Claude Code CLI with Max subscription ($100-200/mo, no per-message API cost)
  • All 13 MCP servers loaded (Gmail, Calendar, Notion, etc.)
  • Full power, slower startup, no per-message API cost (covered by subscription)

VPS ($5/month Hostinger)

  • API key authentication (Commercial Terms)
  • Direct Anthropic API for simple messages (2-5 seconds)
  • Agent SDK for complex tasks (full Claude Code capabilities)
  • Tiered model routing: Haiku 60%, Sonnet 30%, Opus 10%
  • Daily budget cap with auto-downgrade

Hybrid Mode

  • VPS catches all messages 24/7
  • When Mac is awake: forwards to Mac for subscription-included processing
  • When Mac is asleep: handles via API on VPS
  • Monthly cost: ~API costs vary by usage + ~$5 VPS for 24/7 AI

Everything above is within Anthropic’s terms. I’m using their official CLI and API, authenticated properly, under the appropriate terms for each use case. No gray areas. If you want to customize Claude Code’s behavior further — like adding project-specific instructions or setting up memory — check out my complete CLAUDE.md guide with templates and examples.

If you want to build your own always-on AI assistant, I have a step-by-step course that walks you through the entire setup — from first install to a fully working bot. The tutorial uses Telegram, but the community has connected GoBot to Google Chat, Microsoft Teams, Discord, WhatsApp, and Slack too. Join the Autonomee community where 30+ people are building their own bots across multiple platforms and sharing configurations.

Sources

I read these so you don’t have to (but you should):


This post was originally written on February 15, 2026 and last updated February 20, 2026. Terms of service can change — and as we saw on February 19, they do. If you’re making significant business decisions based on ToS, read them yourself or consult a lawyer. I’m an AI educator, not a legal advisor.

Built with the Autonomee approach — own your infrastructure, understand your tools.

Frequently Asked Questions

Can Anthropic ban me for running Claude Code as a messaging bot?

On your own computer using the official Claude Code CLI — nothing changes, it’s Anthropic’s own product. For production or business use, use API keys to be safe. Anthropic’s February 2026 docs update introduced “ordinary, individual usage” language for subscription plans and explicitly requires API keys for the Agent SDK. What will get your account restricted is what happened in January 2026: Anthropic blocked consumer OAuth tokens from being used in third-party API clients (like OpenClaw). GoBot avoids this entirely — it calls claude -p (the real CLI subprocess) for local/hybrid mode, and uses standard Anthropic API keys for VPS mode.

Is it cheaper to use a Claude Max subscription or API keys for a 24/7 bot?

For a 24/7 always-on bot, API keys are significantly cheaper. A Claude Max subscription costs $100-200/month and gives you the full power of Claude Code. Pro at $20/month is cheaper but has significantly lower usage limits that make it impractical for a 24/7 bot. API costs on a VPS vary by usage and model selection — smart routing sends simple messages to Haiku (cheapest), medium to Sonnet, and only complex tasks to Opus. The subscription is better for heavy local use on your computer, but for a server that handles messages around the clock, API keys win on both cost and reliability.

Can I use Claude Code for commercial projects?

Yes, but use an API key to be safe. API keys fall under Anthropic’s Commercial Terms, which explicitly permit building products and services for your customers. Pro and Max subscriptions are consumer plans — they do not explicitly prohibit business use, but they were not designed for it. For any serious commercial project, the API gives you better terms, model selection per message, and budget controls.

What happens if I use Claude Code with a subscription on a VPS and tokens expire?

Your bot stops working until you manually re-authenticate. Subscription auth requires browser-based OAuth, and tokens expire in 8-12 hours. Attempting to keep subscription auth running headlessly on a VPS requires extracting or transferring OAuth tokens outside the official CLI, which is prohibited by Anthropic’s Terms of Service. This is the main reason to use API keys on servers — you set the key once and it works indefinitely, no re-authentication needed.

Is it against the rules to use Claude alongside other AI models like GPT or Ollama?

No. Neither the Consumer Terms, Commercial Terms, nor the Acceptable Use Policy prohibit multi-model routing. Claude Code itself natively supports third-party model providers. The only restriction is using Claude’s output to train a competing AI model. Routing between Claude, Ollama, and OpenRouter based on task complexity is a perfectly valid and common setup.

// NEXT_STEP

Want to build your own AI assistant?

Start with the free course or join 366+ professionals building their AI Second Brain.

Free Course Join the Community

// CONTINUE_SEQUENCE

Side-by-side comparison of OpenClaw and GoBot AI second brain platforms
Recommended Next Step

OpenClaw vs GoBot (Full Comparison)

OpenClaw went viral with 205K GitHub stars, then came the security crisis. Why I built…

Return to Archive