Anthropic is letting you run the Claude Agent SDK on your existing Claude subscription starting June 15, 2026. Before this, building anything with the Agent SDK meant a separate API key with metered pay-as-you-go billing on top of whatever you already pay for Claude Pro or Max. From June 15 forward, your monthly Claude plan includes a credit balance specifically for Agent SDK usage. No API key required.
If you have ever wanted to build a custom agent (a deploy bot, a research assistant, a triage tool) but did not want to put a separate billing card on file with Anthropic just to prototype, this is the change that matters. Your Pro subscription now ships with $20/month of Agent SDK usage. Max 20x ships with $200. Team Premium seats ship with $100.
What changed on June 15, 2026
The short version: Agent SDK usage now comes out of a monthly credit tied to your Claude plan. Previously it billed through the Anthropic API with a separate console balance.
Here is the credit by plan, taken directly from Anthropic’s announcement:
| Plan | Monthly Agent SDK credit |
|---|---|
| Pro | $20 |
| Max 5x | $100 |
| Max 20x | $200 |
| Team Standard (per seat) | $20 |
| Team Premium (per seat) | $100 |
| Enterprise (usage-based) | $20 |
| Enterprise Premium seat | $200 |
A few rules that matter:
- Enterprise Standard seat members do not get a credit. They have to use an API key or upgrade to a Premium seat.
- Credits are per-user and non-transferable. Your seat’s credit cannot be pooled with a teammate’s.
- Unused credits do not roll over. Whatever is left at the end of your billing cycle resets.
- One-time opt-in is required. The credit will not activate on your account until you claim it once. After that, it refreshes automatically each month.
- API key users do not receive the credit. This is plan-specific. If you have been authenticating via
ANTHROPIC_API_KEY, you are on the old billing model.
What the credit covers, and what it does not
Anthropic split this carefully. Read closely; the line between “covered” and “not covered” is what determines whether your bill actually changes.
Covered by the Agent SDK credit:
- Claude Agent SDK calls from your own Python or TypeScript projects
- The
claude -pcommand in Claude Code (non-interactive mode, used for scripted agent runs) - The Claude Code GitHub Actions integration
- Third-party applications that authenticate using the Agent SDK
Not covered (these still come out of your regular Claude plan, or stay separate):
- Interactive Claude Code sessions (the normal CLI you use day-to-day)
- Conversations on the Claude web app or mobile app
- Claude Cowork sessions
In other words, the Agent SDK credit is specifically for programmatic, automated, or non-interactive workloads. Your normal Claude Code work sits on the plan’s existing usage limits, which Anthropic recently raised by 50% through July 13. Two separate budgets, two separate purposes.
This is a meaningful design choice. It means you can experiment with a custom agent built on the SDK without eating into the budget you use for daily coding through Claude Code.
When you run out of credit
The credit covers a fixed dollar amount per month. What happens when you exceed it depends on one setting:
- Extra usage enabled: Overages bill as pay-as-you-go at standard API rates against your plan’s payment method.
- Extra usage disabled: Requests stop at the credit ceiling until the cycle resets.
For prototyping work, leave extra usage disabled. You will get a clean stop signal and avoid surprise bills. For production-grade automations that need to keep running, enable it.
The credit always draws first. You do not pay overage rates until your monthly allowance is gone.
How to opt in
The credit is not on by default. The opt-in is one-time and survives across billing cycles, but you have to do it once.
- Log in to the Claude account that owns the subscription (the user account on Pro/Max, or the seat account on Team/Enterprise).
- Visit the Claude Agent SDK plan settings (linked from Anthropic’s official support article).
- Claim the credit. After this, the credit refreshes automatically each month.
If you have multiple seats on a Team plan, every user has to claim independently. Admins cannot claim on behalf of seat members.
Setting up the SDK in Python or TypeScript
The Agent SDK ships in both Python and TypeScript. Both authenticate the same way against your plan: through the Claude Code CLI rather than a raw API key.
Python
Install:
pip install claude-agent-sdk
Authenticate by signing into Claude Code first:
claude login
This stores plan-tied credentials locally. The Python SDK picks them up automatically; you do not set ANTHROPIC_API_KEY for plan-based usage.
A minimal agent looks like this:
from claude_agent_sdk import Agent
agent = Agent(
system_prompt="You are a code review assistant.",
)
response = agent.run("Review the diff in /tmp/patch.diff and flag concerns.")
print(response.text)
The same call would have required ANTHROPIC_API_KEY and metered API billing before. Now it draws against your plan credit instead.
TypeScript
Install:
npm install @anthropic-ai/claude-agent-sdk
Authenticate via the same Claude Code login:
claude login
A minimal agent in TypeScript:
import { Agent } from "@anthropic-ai/claude-agent-sdk";
const agent = new Agent({
systemPrompt: "You are a code review assistant.",
});
const response = await agent.run(
"Review the diff in /tmp/patch.diff and flag concerns."
);
console.log(response.text);
For environments where the SDK cannot find the Claude Code credentials automatically (CI runners, Docker containers, remote dev boxes), you can set them as environment variables. Anthropic publishes the exact variable names in the Agent SDK docs.
If your Claude Code login is throwing config errors before you even get to the SDK setup, the invalid custom3p enterprise config fix covers the most common cause.
The claude -p workflow
There is a second way to use the Agent SDK credit that does not involve writing code: the claude -p command in Claude Code.
-p puts Claude Code into non-interactive mode. You hand it a prompt, it executes against your repo, and exits. No back-and-forth session. This is how you script Claude Code into CI pipelines, cron jobs, and Git hooks.
A simple example: a pre-commit hook that asks Claude to flag risky changes.
#!/usr/bin/env bash
# .git/hooks/pre-commit
DIFF=$(git diff --cached)
claude -p "Review this diff for security issues, secret leaks, and breaking changes. Return PASS or FAIL with reasoning:\n\n$DIFF"
Every invocation of claude -p after June 15 draws against your Agent SDK credit, not your interactive Claude Code budget. Which means you can wire it into automated workflows without worrying about burning through the limits you need for daily coding.
This pairs well with the /goal command for autonomous loops, and with AGENTS.md context files for steering the agent reliably across runs.
GitHub Actions integration
The Claude Code GitHub Actions integration is the third workload covered by the SDK credit. If you have wired Claude into PR reviews, issue triage, or release notes generation, those workflow runs now bill against the Agent SDK credit on whichever user installed the GitHub App.
This is useful for projects like Clawsweeper, the GitHub triage bot built on Claude Code, where automation runs constantly and the bill used to land on whichever API key was attached to the App.
Building real agents: pairing the SDK with Apidog
The Agent SDK’s real value is for agents that do more than respond to text; agents that hit real APIs, query databases, deploy code. For that to work reliably, the agent needs a defined contract for every external API it touches. Without one, the agent guesses request shapes and you spend your debugging time fixing hallucinated payloads.
This is where Apidog fits the workflow:
- Define the API contract first in Apidog. Spec out endpoints, request/response schemas, and example payloads. This becomes the source of truth.
- Export OpenAPI and pass it to your agent as context.
- Use the SDK to wire the agent against the real endpoints. The agent calls your API using the schemas it knows are correct.
- Validate with the Apidog CLI. Every agent run can verify the API still returns what the contract promises.
For agents that orchestrate other tools through MCP servers, the MCP server testing workflow with Apidog is the matching guide. You get end-to-end test coverage on the tools your agent calls.
The bigger picture is in the design-first API workflow guide: when the agent has a contract to validate against, your time as a developer moves up the stack to writing better contracts and constraints, not chasing JSON schema bugs in agent output.
Download Apidog free if you want the contract layer to back your Agent SDK projects.
When you still want a separate API key
The plan-based credit is the right default for most builders. There are still cases where a standalone API key makes sense:
- Production agents that need predictable budgets. Plan credits cap at fixed dollar amounts. If you are running an agent that needs unbounded scaling, a usage-based API key gives finance and ops a cleaner billing line.
- Multi-org access. API keys are not tied to a single user. If a team wants shared access to one billing source, that is still an API key job.
- Enterprise Standard seats. These do not receive Agent SDK credits. If you are on an Enterprise Standard seat and need SDK access, an API key is the path.
The free Claude API access guide covers paths to Claude usage that do not require either a Pro plan or a paid API key.
A clean checklist before you start
- [ ] Confirm your plan is on the eligible list (Pro, Max 5x, Max 20x, Team Standard, Team Premium, Enterprise usage-based, Enterprise Premium seat)
- [ ] Claim the one-time opt-in for the Agent SDK credit
- [ ] Decide whether to enable extra usage (off for prototyping, on for production)
- [ ] Run
claude loginto authenticate the SDK against your plan - [ ] Install the Python or TypeScript SDK package
- [ ] Build a minimal agent and confirm it runs without
ANTHROPIC_API_KEYset - [ ] Check the credit balance in your account settings after the first few runs
FAQ
Do I need to remove my old ANTHROPIC_API_KEY for the plan credit to work? The SDK uses Claude Code’s local credentials when they exist, which means claude login is enough to switch the SDK to plan-based billing. If you have ANTHROPIC_API_KEY set in your environment for other tools, leave it; the SDK will prefer the plan auth when present.
What counts as one “request” against the credit? The credit is denominated in dollars, not requests. Each SDK call bills at the same rates Anthropic publishes for API usage; your credit balance ticks down by the cost of every model call, including tool use and context tokens. There is no per-request fee on top.
Can I share my credit with a teammate? No. Credits are per-user and non-transferable. Each Team or Enterprise seat has its own credit pool.
What happens to my old Anthropic API console balance? It stays where it is. The plan credit is a separate billing mechanism. If you had pre-paid balance on your API console, that still works for any API key workloads.
Is the Agent SDK the same as Claude Code? No. Claude Code is the official CLI and IDE extensions that Anthropic ships. The Agent SDK is a programming library (Python or TypeScript) for building custom agents. The credit covers the SDK plus the non-interactive claude -p command in Claude Code; interactive Claude Code stays on your regular plan usage.
Will my GitHub Actions bill change? If your Action uses the official Claude Code GitHub Actions integration and the credit is claimed on the installing user’s account, those runs now draw against the SDK credit instead of any API key billing.
Does the credit work outside the Agent SDK and claude -p? Not for the four covered surfaces (SDK in Python/TS, claude -p, GitHub Actions, third-party Agent SDK apps). Any other Claude usage falls back to your plan’s normal limits or your API key, depending on where the request originates.



