"I want to put Claude in my product, where do I start?" The answer is here: the API, the Agent SDK or Managed Agents, and what each one costs.
Who it's for
Devs, tech teams and solo builders who want to put Claude inside their own product. You only use the Claude app or Claude Code? You can skip this chapter.
If you have a repo, a backend or a product in production, you're in the right place. You're going to expose Claude to your users, or have it work in the background for you.
The three building blocks
Claude API. Direct calls to the model: you send a prompt, you get a response. Everything else is built on it. You get structured outputs (a response in a JSON format you define), streaming (the response shows up as it's written), tools (Claude calls your functions) and prompt caching (more on that below). Since August 19, 2026, the Files API (you upload a file once and reuse it across several calls) and the Skills API are generally available.
Claude Agent SDK (TypeScript and Python). The Claude Code loop, inside your own code: planning, tool calls, subagents, hooks, skills, MCP. You build your agents with your own scope and your own tools, on your own infrastructure.
npm install @anthropic-ai/claude-agent-sdk
pip install claude-agent-sdk
The maxBudgetUsd option caps what a run can spend. The total_cost_usd field returned at the end is an estimate calculated on the client side: the Anthropic invoice is what counts.
Claude Managed Agents. The version hosted by Anthropic, in public beta since April 8, 2026. Since April, the platform has added memory stores, multi-agent, self-hosted sandboxes, scheduled deployments, vaults for secrets and a per-agent effort setting.
Both run the same thing: an agent that thinks, calls tools and comes back with a result. With the Agent SDK, it's a library in your code, on your machine or your server: you handle hosting, retries on errors and scaling. With Managed Agents, Anthropic provides the sandbox (the isolated environment where the agent runs its code) and runs the machine, for $0.08 per hour of active session.
Pricing
Everything is paid per token, a chunk of a word (chapter 11 explains what that means in practice). Input is what you send. Output is what Claude writes. A cache read is input you already sent that Claude rereads for much less.
Price per million tokens, as of October 2026:
| Model | Input | Output | Cache read |
|---|---|---|---|
| Fable 5.1 | $10 | $50 | $0.25 |
| Opus 5.5 | $4 | $20 | $0.20 |
| Sonnet 5.5 | $2 | $10 | $0.10 |
| Haiku 5.5 | $0.10 | $0.50 | $0.01 |
All four models accept 1 million tokens of context and 128,000 tokens of output. The Haiku 5.5 price applies to prompts of up to 100,000 tokens. Above that, it goes up to $0.50 for input, $2.50 for output and $0.05 for cache reads.
A few rules that change the bill:
- Batch cuts it in half. You send your requests as a batch and Anthropic processes them later (most in under an hour, 24 hours at most). You can combine it with caching.
- Writing to the cache costs a bit more than normal input: 1.25 times the price for a 5-minute cache, 2 times for a 1-hour cache.
- Reasoning counts as output. Effort (how much Claude thinks before answering, from
lowtomax) therefore weighs directly on the bill. By default on the API, it's set tohighfor Fable 5.1 and Sonnet 5.5, and tomediumfor Opus 5.5 and Haiku 5.5. - Fast mode (same model, faster responses): $8 for input and $40 for output on Opus 5.5.
- Web search: $10 per 1,000 searches, on top of tokens.
Since Opus 4.7, Anthropic uses a new tokenizer (the tool that splits text into tokens). The same text produces about 30% more tokens than before. If you're comparing with a 2025 invoice, look mainly at the cost per task.
How much a Managed Agent costs
Tokens at the standard rate, plus $0.08 per hour of active session. Only the time the agent is actually running is counted. An agent that works 2 hours a day for 30 days is 60 hours, so $4.80 of hosting, plus its tokens. Batch pricing doesn't apply to Managed Agents.
Since August 2026, you can set a dollar budget per session to cap spending. Set one from your very first deployment.
API credits included with Max and Team
Since October 7, 2026, some subscriptions come with API credits every month:
| Plan | API credits per month |
|---|---|
| Max 5x | $100 |
| Max 20x | $200 |
| Team | $20 per Standard seat, $100 per Premium seat, pooled, capped at $500 |
They cover the API, Managed Agents, the Agent SDK and the playground. They don't cover Claude Code. Unused credits don't roll over to the next month. Free, Pro and Enterprise don't get them.
For a Max subscriber, that's enough to prototype an integration without pulling out your credit card.
When to use what
| Tool | You want... |
|---|---|
| Direct API | To send a prompt from your app and display the response. |
| Agent SDK | The full loop (planning, tools, subagents, hooks) in your code. |
| Managed Agents | An agent that runs without you and without a server to manage (monitoring, long tasks). |
Simple rule: if one call is enough, stay on the API. As soon as you need an agent that thinks, calls tools and comes back with a result, move to the Agent SDK, or to Managed Agents if that agent has to run without you.
Example on a site like mine (Next.js):
- A "summarize this chapter" button: one direct API call. Haiku 5.5 is more than enough for this kind of task.
- A script that, every Monday, reads the contact form messages, sorts them and prepares draft replies: Agent SDK, triggered by your own cron.
- The same agent, with no server of your own: Managed Agents with a scheduled deployment and a session budget.
Caching, the first lever in production
Prompt caching keeps the start of your prompt in memory (system instructions, docs, tool definitions) when it doesn't change from one call to the next. The following calls reread that start at the cache read price: 10 times cheaper than input on most models, 20 times on Opus 5.5 and Sonnet 5.5, 40 times on Fable 5.1.
Three conditions for it to work:
- Put what doesn't change first (tools, then system instructions, then messages) and what changes at the end.
- Don't touch tool definitions along the way: that invalidates the whole cache.
- Aim for at least 512 tokens in the part you want cached on recent models. Below that, nothing gets cached, and the API won't tell you.
The cache lasts 5 minutes by default, 1 hour as an option, and every read resets the timer. The mechanism is explained without jargon in chapter 11.
Question
As a Max 5x subscriber, you get $100 of API credits per month since October 7, 2026. Do these credits pay for your Claude Code usage?
Pick an answer to see the explanation.
Key takeaways
- The API for a single call, the Agent SDK as soon as you need an agent loop in your code, Managed Agents if you don't want infrastructure.
- Per million tokens (input / output): $4 / $20 on Opus 5.5, $0.10 / $0.50 on Haiku 5.5.
- Since Opus 4.7, the same text makes about 30% more tokens.
- Max and Team include API credits since October 7, 2026, excluding Claude Code.
- Before looking for other savings, turn on caching and batch.