Skip to content
🎓 Find your path Subscribe

Authenticate: Max Plan vs. API Key

Tier 0 · Total Beginner 9 min read

You’ve installed the claude command. Before it’ll do anything, it needs to know which Claude account to charge the work to. There are two main ways to log in, and they bill completely differently. Picking the right one is the difference between a flat monthly fee and a bill that grows with every task. This page explains both so you choose on purpose, not by accident.


Claude subscription (Pro/Max)API key (Console)
What it isA flat monthly plan you already use for the Claude chat appPay-as-you-go credits billed per word processed
How you payOne fixed monthly pricePer use — every task costs a little
LimitsUsage caps that reset on a clock; you wait and continueYou keep going as long as you have credit
Best forSteady, daily hands-on useAutomation, scripts, bursty heavy workloads

Both work fine for learning. The reason to understand the difference now is that it bites people later — usually when an unattended script quietly runs up a bill, or when a subscription cap stops your work mid-task.

Section titled “Option A — Log in with a Claude subscription (recommended to start)”

If you already pay for Claude Pro or Max, use that. It’s the simplest path and there’s no separate per-task bill to watch.

  1. Start a session. In your terminal, type:

    Terminal window
    claude
  2. Follow the login prompt. On first run, Claude Code opens your browser and asks you to log in to your Claude account. Approve it.

  3. You’re done. Your credentials are saved on your machine. You won’t be asked again. To switch accounts later, type /login inside a running session.

The tradeoff: subscriptions have usage caps that reset on a timer. If you do a lot of heavy work in a short window, you may hit a cap and have to wait for it to reset before continuing. For learning and ordinary daily use, this rarely gets in the way.

An API key is a secret string tied to a Claude Console account with prepaid credits. Instead of a flat monthly fee, you’re billed per use — each task costs a fraction of a cent to a few cents depending on how much text the model reads and writes.

You’d choose this when:

  • You want to run agents unattended — on a schedule, in scripts, in the background — where subscription caps would interrupt you.
  • Your workload is bursty or heavy and you’d rather pay for exactly what you use than hit a reset timer.

To use it, you set the key as an environment variable before starting Claude Code, or log in through the Console flow. Console keeps a running tally of your spend.

The plot twist: subscription and automation are splitting apart

Section titled “The plot twist: subscription and automation are splitting apart”

Here’s a detail that trips up beginners building automation, and it’s worth knowing up front because the date is close.

As of June 15, 2026, non-interactive Claude Code usage — running with the -p flag, the Agent SDK, GitHub Actions, or any third-party tool wrapping Claude — stops drawing from your interactive subscription limit. Instead it draws from a separate, capped monthly programmatic credit (a fixed dollar amount on Max plans, no rollover). When that programmatic credit runs out, the work either halts or — if you’ve enabled API billing — silently falls back to pay-as-you-go charges.

What that means in plain terms:

  • Typing in an interactive session (claude, then chatting) → draws from your normal subscription limit.
  • Running unattended automation (scripts, schedules, the -p one-shot mode) → draws from a separate capped programmatic budget, and can spill over into API billing if you let it.

You don’t need to act on this today. Just file it away: the moment you start automating Claude Code, billing changes, and an unattended agent can spend money you didn’t watch it spend.

Start a session:

Terminal window
claude

If it drops you into a prompt without asking you to log in again, you’re authenticated. Type /help to see what’s available, or exit (or Ctrl+D) to leave.


Next: Your First Session — open a session, ask for something, and watch the agent actually use tools to do it.