Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

Use your own Anthropic API key with an agent: what it costs, and the billing trap to check first

Written October 31, 2026 · Edited November 12, 2026

For a builder deciding between a Claude subscription allowance and their own Anthropic API key: the key route bills per token against prepaid credits in a Console organization, with no monthly allowance to fall back on. Check which route a run is on before the first long job, and set the limit before it starts.

Two meters, and the credential decides

A Claude subscription and an Anthropic API key are two different meters. A subscription — Pro at $20 a month billed monthly, Max at $100, Ultra at $200 — buys usage limits: Pro and Max carry a five-hour session window and a weekly limit, and Ultra carries a weekly limit — verified Ultra accounts have no five-hour session limit. The limits are shared across Claude on web, desktop, and mobile and Claude Code, all drawing from one pool. Anthropic's pricing page states the shared pool plainly, and that Claude Code is included in paid plans. An API key buys tokens: every request bills per million input and output tokens against prepaid credits held by a Console organization, and there is no allowance inside that meter. The same Claude Code install can land on either meter depending on how it is signed in, so the first question about any run is never which model it used, but which meter it billed.

Anthropic's own pricing page also lists the switch between the two: for heavy coding sessions, you can switch to pay-as-you-go API credits through a Console account. That sentence is the whole key route in one line. It is also where the trap sits, because a subscription and a key can both be present on one machine, and a run bills to whichever credential the tool actually used. Confirm the route from the usage record after a small run, before trusting a long one.

What the key route costs

Per-token prices below are Anthropic's standard API rates for the current models, per million tokens, in US dollars, as stated on Anthropic's model pages. Output costs more than input on every model, so a run that writes long answers costs several times what its prompt suggests.

Anthropic also states savings of up to 90% with prompt caching and 50% with batch processing on the Sonnet page. Those are ceilings for repeated prompts and deferred work, not the rate a live agent session pays. A rough sense of scale, from the Sonnet rates alone: one million input tokens and half a million output tokens cost $2 plus $5, or $7. A session that reads a large codebase and writes long replies several times an hour reaches tens of dollars in a day without anything going wrong. That is the normal price of the key route, not a malfunction.

The trap: monthly API credits do not pay for Claude Code

Max and Ultra plans include a monthly API credit to build on the Claude Platform: $100 a month on Max, $200 on Ultra, as Anthropic's pricing page states. It is easy to read that as $100 of Claude Code usage. It is not. The credit pays for building on the API — your own applications and agents, the Agent SDK, and the Console playground. Interactive Claude Code sessions draw from the subscription's usage limits, not from the credit, and the credit does not raise those limits. A Max subscriber who cancels an API budget expecting the credit to cover terminal sessions will find the sessions still hitting plan limits, while the credit sits unused on API work they may never do.

The same split applies in the other direction. Unused credit expires at the end of each billing cycle rather than building up, so a credit is worth claiming only for API work you already plan to do. If the work is interactive coding sessions, the subscription allowance is the meter that matters, and the credit changes nothing about it. Before counting the credit as savings, name the API work it would pay for. If there is none, it is not savings.

Before the first long run

  1. Set the limit first. In the Console organization that owns the key, set a spend limit below what you are willing to lose, in a separate workspace for the experiment, with its own key. The exact steps are in Stop an agent running up a bill — do them before the run, not after the first surprising bill. A limit set after a runaway job has already started is a report, not a control.
  2. Run something small, then read the usage record. One short task on Sonnet 5.5, then open the Console usage record and confirm the tokens and the cost appear under the organization and workspace you intended. If the run does not appear, it billed somewhere else — stop and find out where before running anything longer.
  3. Start on the cheapest model that can do the job. Haiku 5.5 for short, high-volume prompts; Sonnet 5.5 for everyday coding. Move to Opus only for work that Sonnet visibly mishandles, and never let a default model choice put Fable on an unattended loop.
  4. Price the loop, not the call. An agent loop makes many calls. Estimate calls per task from the small run, multiply by the per-token rates above, and compare the result with the subscription allowance you would otherwise use. The key route wins for unattended, scheduled, or bulk work that would stall on the plan's session and weekly limits; the subscription wins for a person driving the tool through the day. That comparison, done with your own numbers, is the decision — not the headline price of either meter.

What can go wrong

Related playbooks

Sources

Back to: Coding playbooks hub · Also: Token cost calculator · Agent cost estimator · What an agent costs, in plain figures · Stay inside the subscription allowance · Stop an agent running up a bill