How to Use the Claude Agent SDK With Your Claude Plan?

From June 15, 2026, the Claude Agent SDK runs on your Pro, Max, Team, or Enterprise plan. How to opt in, what the credit covers, and how to set it up.

Ashley Innocent

Ashley Innocent

14 May 2026

How to Use the Claude Agent SDK With Your Claude Plan?

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.

button

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:

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:

Not covered (these still come out of your regular Claude plan, or stay separate):

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:

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.

  1. Log in to the Claude account that owns the subscription (the user account on Pro/Max, or the seat account on Team/Enterprise).
  2. Visit the Claude Agent SDK plan settings (linked from Anthropic’s official support article).
  3. 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:

  1. Define the API contract first in Apidog. Spec out endpoints, request/response schemas, and example payloads. This becomes the source of truth.
  2. Export OpenAPI and pass it to your agent as context.
  3. Use the SDK to wire the agent against the real endpoints. The agent calls your API using the schemas it knows are correct.
  4. 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:

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

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.

button

Explore more

How to Use the ERNIE 5.1 API?

How to Use the ERNIE 5.1 API?

Step-by-step guide to calling Baidu's ERNIE 5.1 via the Qianfan API: keys, curl, Python, Node.js, streaming, tool calls, and testing with Apidog.

14 May 2026

The /goal Command: How to Run Codex and Claude Code as 24/7 Autonomous Agents

The /goal Command: How to Run Codex and Claude Code as 24/7 Autonomous Agents

Learn how /goal works in Codex and Claude Code. A practical guide to autonomous AI agents, goal-prompt structure, and pairing them with Apidog.

14 May 2026

I Spent a Morning With Apidog's Spec-First Mode. The Visual Designer Is No Longer the Only Adult in the Room.

I Spent a Morning With Apidog's Spec-First Mode. The Visual Designer Is No Longer the Only Adult in the Room.

A hands-on walkthrough of Apidog's Spec-First Mode (Beta): code-first API design in raw YAML or JSON with two-way Git sync. Setup, tradeoffs, where it fits.

14 May 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs