What Is an API in Claude?
A beginner-friendly guide to the Claude API: what an API is, how it differs from the Claude app, how a request travels to Claude and back, what tokens, keys and models mean, how billing and limits work, and how to start safely.
Imagine sitting in a restaurant. You do not walk into the kitchen, find the ingredients and start cooking. Instead, you tell the waiter what you would like, the waiter carries your order to the kitchen in a form the chefs understand, and then brings the finished dish back to your table. You never need to know how the kitchen works. You only need to know how to place an order and what to expect in return.
An API works like that waiter. It is a standard way for one piece of software to place an order with another and get a response. The Claude API lets developers place orders with Claude from their own programs, websites and apps, so that Claude’s abilities can be built into products. This guide explains the idea from scratch. No technical knowledge is needed. Every new word is explained when it first appears, and each big idea comes with an everyday comparison.
The Claude API and its documentation change often. Model names, prices, limits, features and even website addresses have been updated during 2025 and 2026. For example, the developer console and documentation moved to platform.claude.com. The details here reflect Anthropic’s documentation and recent coverage at the time of writing. Before you build anything or budget any money, check the current documentation and pricing pages.
1What Is an API?
Before talking about Claude, let us understand the general idea.
API stands for application programming interface. That is a long phrase for a simple idea: a defined way for programs to talk to each other. One program sends a request, which is a structured message asking for something. The other program sends back a response, which is the answer. The rules about what a request must look like and what a response will contain are the “interface”.
You use APIs every day without noticing. A weather widget on your phone asks a weather service for today’s forecast. A travel site asks airlines for ticket prices. A payment page asks a bank to confirm a card. In each case, one program asks and another answers, using agreed rules.
API
A set of rules that lets one program ask another program for something and receive an answer.
Request
The message one program sends to ask for something, following the API’s rules.
Response
The answer that comes back to the program that asked.
Developer
A person who builds software, and who uses APIs to add abilities to what they build.
Think of a vending machine. You do not need to know how it is stocked or wired. You press the right buttons, insert the right coins and get your snack. The buttons and the coin slot are the interface. An API is the buttons and coin slot for software.
An API is not a product you chat with. It is a doorway that programs use to reach a service.
2What Is the Claude API?
Now we can apply the idea to Claude.
According to Anthropic’s documentation, the Claude API is a web-based interface, of the kind called RESTful, located at api.anthropic.com. It provides programmatic access to Claude models. Programmatic means that a program, not a person typing in a chat window, sends the requests. The main part of the API is the Messages API, which is used to send messages to Claude and receive its replies.
The documentation also describes a second general-availability API, the Message Batches API, which processes large numbers of message requests asynchronously, meaning you submit them and collect the results later, at a reduced cost. The overall set of tools for developers, including the API, the software development kits and the web console, is called the Claude Developer Platform.
| Piece | What it is |
|---|---|
| Claude API | The programmatic doorway to Claude models |
| Messages API | The main part of the API, for sending messages to Claude and receiving replies |
| Message Batches API | For processing many requests asynchronously at a lower cost |
| Client SDKs | Ready-made code libraries that make calling the API easier |
| Claude Console | The web dashboard for keys, workspaces, usage and billing |
If Claude is a very skilled chef, the Claude API is the order window and the Console is the manager’s office, where accounts, keys and bills are looked after. The window lets other businesses serve Claude’s dishes to their own customers.
3The Claude App Versus the Claude API
This is the most common point of confusion, so let us make it clear.
The Claude app on the web, desktop and mobile is a ready-made product. You open it, type or speak, and Claude replies. It comes with features such as projects, memory, file uploads and settings, all designed for people. The Claude API is different. It is the raw doorway that developers use to build their own products. When you use a company’s customer-support chatbot or a writing tool that is powered by Claude, the company’s software is probably calling the Claude API behind the scenes.
The two are also paid for differently. The Claude app uses subscription plans with usage limits. The API is billed by how much you use it, measured in tokens, which we explain shortly. A subscription to the app does not automatically cover API usage, and API use does not require an app subscription.
| Aspect | Claude app | Claude API |
|---|---|---|
| Who uses it | People chatting and working | Developers building products |
| How you use it | Type or speak in the app | Send requests from software |
| What you get | A finished product with features | Building blocks you assemble yourself |
| Payment | Subscription plans with usage limits | Pay for what you use, measured in tokens |
| Sign-up | A Claude account | A Console account and an API key |
Eating at a restaurant is the Claude app. Buying ingredients from the same kitchen to cook your own menu is the API. In the first case, you receive a finished meal. In the second, you decide what to make and how to serve it.
The API uses a Claude Console account. Do not assume your chat subscription gives you API access, or the other way round. Check each one’s billing separately.
4How a Request Travels to Claude and Back
Following one request from start to finish makes the whole idea concrete.
Your program prepares a request
It gathers the model name, the messages to send and a few settings, such as the maximum length of the reply.
The request is sent with your key
It travels over the internet to the Claude API, carrying your API key in a header so Anthropic knows who is asking.
Claude reads and responds
The chosen model processes the messages and writes a reply, one token at a time.
The response comes back
Your program receives the reply along with information such as how many tokens were used.
Your program uses the answer
It shows the text to a user, saves it, or passes it to the next step of the product.
flowchart LR
A["Your app or program"] --> B["Request with model, messages and key"]
B --> C["Claude API"]
C --> D["Claude model writes a reply"]
D --> E["Response returned"]
E --> A
Sending a letter with a return address and a stamp is much like this. The request is the letter, the key is your stamp and address, and the response is the reply that comes back to your mailbox.
Each request is separate. Claude does not remember earlier requests by itself. If a developer wants a conversation, their program sends the earlier messages again with each new request.
5What Goes Into a Request
A request is a bundle of a few simple ingredients.
The model
Which Claude model should answer, named by its model string, such as the identifiers for Haiku, Sonnet, Opus or Fable.
The messages
The conversation so far: what the user said and, in longer chats, what Claude said before.
A system prompt
Optional standing instructions that set Claude’s role, tone and rules for the whole conversation.
A length limit
The maximum number of tokens Claude may write in its reply.
Optional settings
Extras such as tools Claude may use, or other behaviour controls described in the documentation.
Headers
Administrative details, including your key, an API version and the type of content being sent.
Anthropic’s documentation lists the required headers for direct requests: your API key from the Console, an API version, and a content type. When Claude is accessed through a cloud platform, authentication is instead integrated with that provider’s identity system.
Ordering a custom cake involves choosing the bakery, describing the cake, giving house rules like “no nuts”, and setting a size limit. The model, the messages, the system prompt and the length limit are the parts of the cake order.
The documentation lists maximum request sizes for each endpoint. Very large inputs may need to be split or sent differently, so check the current limits.
6Tokens: The Unit of Everything
Tokens explain both how much text fits in a request and how you are billed.
A token is a small chunk of text, such as a short word or a piece of a longer word. Claude reads and writes in tokens. Everything you send, called input, and everything Claude writes back, called output, is measured in tokens. The total amount of material Claude can consider at once, including your messages and its reply, is limited by its context window, which is measured in tokens too.
Tokens matter for two practical reasons. First, they set the size of what you can send: a very long document may not fit. Second, they set the price: the API is billed by tokens used, rather than by seat or by subscription. Output tokens usually cost more than input tokens, and different models have different rates.
flowchart TD
A["Your messages and instructions"] --> B["Input tokens"]
C["Claude's reply"] --> D["Output tokens"]
B --> E["Billed by usage"]
D --> E
B --> F["Counts toward the context window"]
D --> F
A taxi meter measures the distance travelled and charges accordingly. Tokens are the meter for AI: the more text you send and receive, the more the meter ticks.
7Getting Started: Console, Keys and Workbench
The first steps happen in a web dashboard rather than in code.
Anthropic’s documentation says that to use the Claude API you need a Claude Console account and an API key. The Console is the web dashboard where you manage your developer account. It includes a tool called the Workbench, which lets you try the API in your browser, and a settings area where you can generate API keys. You can also use workspaces to separate your keys and control spending by project or use case.
Create a Console account
Sign up on the developer platform, which is separate from the Claude chat app.
Set up billing or credits
API usage is paid for by consumption, so add a payment method or credits as the platform asks.
Try the Workbench
Experiment with prompts in the browser to see how Claude responds, before writing any code.
Create an API key
Generate a key in the account settings, give it a clear name and store it safely.
Use workspaces for control
Separate projects with workspaces so keys and spending can be managed for each.
Make your first call
Follow the official Get started guide, which walks through prerequisites and a first request.
Opening a trade account at a wholesaler involves signing up, adding payment and getting an account card. The Console account, billing and API key are those three things for the Claude API.
Try ideas in the Workbench first. It is a gentle way to learn what a good request looks like before building anything.
8SDKs, Documentation and Where to Learn
You rarely need to build requests entirely by hand.
A client SDK, short for software development kit, is a ready-made code library that makes it easier to call an API from a particular programming language. Instead of assembling every detail of a request yourself, you use simple commands from the library. Anthropic provides client SDKs, and the documentation includes examples. Reading your key from an environment setting, rather than writing it into your code, is the pattern the documentation shows.
Anthropic’s developer documentation lives at platform.claude.com/docs, alongside the Console. An older address, docs.claude.com, redirects there, and the Console that used to be at console.anthropic.com now redirects to platform.claude.com. The documentation includes a Get started guide, a guide to working with messages, a complete API reference and release notes.
Get started
Prerequisites and your first API call, step by step.
Working with messages
Request and response patterns, multi-turn conversations and best practices.
API reference
The complete specification of parameters, responses and error codes.
Release notes
Updates to models, features and the platform, useful because things change often.
A power drill comes with a manual and a set of drill bits. The SDK is like the set of ready-made bits, and the documentation is the manual that explains which to use for which job.
9What You Can Build with It
Almost anything that benefits from understanding or writing language can use Claude through the API.
Customer support assistants
A chat window on a company website that answers questions using the company’s own information.
Writing and editing tools
Apps that draft emails, tidy documents or adapt text for different audiences.
Document processing
Programs that summarise reports, extract details from forms and classify large volumes of text.
Coding helpers
Tools that explain, review or generate code inside a developer’s own environment.
Search and question answering
Systems that find relevant material in a company’s documents and answer questions about it.
Agents that take actions
Programs where Claude uses tools to look things up, run calculations or call other services as part of a task.
Electricity powers kettles, lamps and factories. An API makes Claude available as a kind of power source for many different products, each built for its own purpose.
10Useful Features Beyond Simple Chat
The API offers building blocks that the chat app hides or packages differently.
Tool use
Lets Claude request that your program run a function, such as looking up an order or a price, and then use the result in its reply.
Message Batches
Submit many requests together to be processed asynchronously, at a lower price, when you do not need instant answers.
Prompt caching
Reuse repeated context, such as a long set of instructions, at a reduced cost on later requests.
Built-in tools
Some tools, such as web search, are offered as options within the API, with their own pricing rules.
Anthropic’s pricing materials and third-party guides describe the Batch API as giving a 50 percent reduction in token costs for work that can wait, and prompt caching as making repeated input much cheaper to read back. Exact discounts, which features are generally available and which are in beta change over time, so check the current documentation before planning around them.
flowchart TD
A["Your task"] --> B{"Need an instant answer?"}
B -- "Yes" --> C["Standard Messages API request"]
B -- "No, large volume" --> D["Message Batches API at lower cost"]
C --> E{"Same long context repeated?"}
E -- "Yes" --> F["Consider prompt caching"]
E -- "No" --> G["Send as normal"]
Express delivery costs more than the standard post, and bulk shipping is cheaper if you can wait. Choosing between an immediate request and a batch is like choosing between delivery speeds.
11Choosing a Model Through the API
With the API, you choose which Claude model answers each request.
Claude comes in tiers. At the time of writing, the most recent publicly available models are Claude Haiku 5.5, Claude Sonnet 5.5, Claude Opus 5.5 and Claude Fable 5.1, which Anthropic identifies with model strings such as claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5 and claude-fable-5-1. In general, lighter models are quicker and cheaper, and more capable models are better suited to harder tasks. Because model lineups and strings change, always copy the current names from the documentation.
| Tier | General character | Typical use through the API |
|---|---|---|
| Haiku | Light and quick | High-volume, simple tasks such as tagging and short replies |
| Sonnet | Balanced | Everyday assistants, drafting, analysis and coding help |
| Opus | More capable | Complex reasoning and longer, demanding tasks |
| Fable, Mythos tier | Top tier, with extra safeguards in sensitive areas | The hardest problems, where available and appropriate |
Start with the lighter model
Test whether it handles your task well enough.
Compare on real examples
Run the same realistic inputs through neighbouring tiers.
Weigh quality against cost and speed
Move up only if the extra quality is worth the extra cost and delay.
You would hire a courier for a simple parcel and a specialist for a fragile antique. Choosing a model is matching the helper to the job.
12Other Ways to Reach Claude: Cloud Platforms
Besides Anthropic’s own API, Claude is offered through some cloud providers.
Anthropic’s documentation lists several platforms through which Claude can be reached, including options on Amazon Web Services, Google Cloud and Microsoft’s Azure environment. On these, authentication is integrated with the cloud provider’s identity and access system, and feature availability can differ from the direct API. Organisations already working inside one of these clouds often choose this route for billing and security reasons.
Why teams choose a cloud route
- Fits existing cloud billing and procurement
- Uses the cloud provider’s identity and access controls
- Keeps workloads in one familiar environment
- May suit compliance requirements
Things to check
- Not every feature is available on every platform
- Model availability and timing may differ
- Documentation and pricing may be platform-specific
- Setup steps differ from the direct API
You can buy a product from the maker directly or through a large retailer you already trust. The product is the same, but ordering, delivery and extras can differ. Cloud platforms are the retailers for Claude.
Anthropic’s documentation includes a features overview that shows which features are available across platforms. Consult it before choosing.
13Costs, Limits and Errors
Understanding the meter and the speed limits helps you avoid surprises.
API pricing is described as usage-based: you pay for tokens consumed rather than a monthly seat fee, with different rates for input and output and for each model. Many guides note that discounts exist for batch processing and for cached repeated input. Because prices differ across models and have changed over time, avoid relying on a number from an article without checking its date, and confirm on Anthropic’s pricing page.
The API also has rate limits, which cap how many requests and tokens you can use per minute. Guides describe a tier system in which limits rise as your account’s usage and spending grow. Workspaces let you set spending controls by project. If you exceed a limit, or something goes wrong, the API returns an error, a response that explains the problem. The documentation includes a page on errors.
Rate limits
Caps on requests and tokens per minute, which rise as your account grows.
Spend limits
Budget controls, applied through workspaces and settings, to keep costs predictable.
Usage reports
Reports in the Console that show how many tokens each key or workspace has used.
Error messages
Responses that explain what went wrong, so your program can react sensibly.
A water meter shows what you have used, and a pressure limit stops the pipe being overloaded. Spend controls and rate limits are the meter and the pressure limit for the API.
Programs that call the API repeatedly, especially with many helper agents or large inputs, can use a lot of tokens quickly. Set budgets and monitor usage when you start.
14Keeping Your API Key Safe
An API key is like a password plus a credit card, so it deserves careful handling.
Anyone who has your API key can make requests that are billed to your account. That makes it important to keep the key secret. Do not paste it into public places, share it in chat messages or put it directly into code that others can see, such as in a public website. Documentation examples read the key from an environment setting for this reason. A common approach for websites is to keep the key on a server you control, so that visitors never see it.
Store keys outside your code
Use environment settings or a secrets manager rather than writing keys into files.
Never expose keys to visitors
Keep keys on a server you control, not inside a public web page or app.
Use separate keys per project
If one is exposed, you can turn it off without disrupting everything else.
Rotate and delete unused keys
Replace keys occasionally and remove any you no longer need.
Set spend limits
Limits reduce the damage if a key is ever misused.
Disable or delete the key in the Console straight away and create a replacement. Then review your usage for anything unexpected.
You would not leave your house keys taped to the front door. An API key is the key to your account, and it belongs in a safe place only you control.
15Common Mistakes
These errors appear often, and each has an easy fix.
Problem
Assuming a Claude chat subscription includes API access.
Why It’s Harmful
You may build a project and then find that no API billing is set up, or be surprised by separate charges.
Correct Approach
Treat the app and the API as separate. Set up a Console account, billing and keys for API work.
Problem
Putting an API key inside a public web page or shared code.
Why It’s Harmful
Anyone can copy it and run up charges on your account.
Correct Approach
Keep keys on a server, in environment settings or a secrets manager, and never share them.
Problem
Always using the largest model.
Why It’s Harmful
It raises cost and delay for tasks that a lighter model handles perfectly well.
Correct Approach
Test lighter tiers first and move up only where quality needs it.
Problem
Expecting Claude to remember earlier requests automatically.
Why It’s Harmful
Each request is separate, so the product will behave as though the earlier conversation never happened.
Correct Approach
Send the relevant earlier messages with each new request, or store and retrieve context yourself.
Problem
Relying on old articles for prices, model names or addresses.
Why It’s Harmful
Models are retired, prices change and websites move, so copied details may fail or mislead.
Correct Approach
Check the date on every guide and use the current documentation and pricing pages.
Problem
Launching a product without spend limits or monitoring.
Why It’s Harmful
A bug or a surge in traffic can create a surprise bill very quickly.
Correct Approach
Set budgets with workspaces, watch usage reports and test with small volumes first.
16Benefits and Trade-offs
Here is the whole picture in one place.
Advantages
- Build Claude into your own products and workflows
- Choose exactly which model answers each request
- Pay for what you use, with no per-seat fee
- Access features such as tool use, batching and caching
- Available directly and through some cloud platforms
Disadvantages / Trade-offs
- Needs some technical skill to set up
- You build and maintain the product around it
- Costs scale with usage and need monitoring
- Keys must be protected carefully
- Models, prices and features change often
Buying a ready meal is easy and quick, while cooking from scratch gives you control but needs skill and care. The API gives control, and the app gives convenience.
17Frequently Asked Questions
A set of rules that lets one program ask another program for something and get an answer back, like a waiter carrying orders between a customer and a kitchen.
It is Anthropic’s programmatic doorway to Claude models. Its main part is the Messages API for sending messages to Claude and receiving replies, and there is also a Message Batches API for large volumes of asynchronous requests.
The app is a finished product for people. The API is a building block for developers who want to add Claude to their own software. They have separate accounts and separate billing.
Anthropic’s documentation says you need a Claude Console account and an API key, which you create in the Console. The Workbench lets you try things in the browser first.
A small chunk of text, such as a short word or part of a word. Claude reads and writes in tokens, and the API bills by the tokens you send and receive.
It is usage-based and depends on the model, with separate rates for input and output tokens, and discounts for certain features such as batching and caching. Prices change, so check Anthropic’s current pricing page.
Not automatically. Each request is separate. To continue a conversation, your program sends the earlier messages along with the new one, or supplies saved context itself.
Keep it out of public code and web pages, store it in environment settings or a secrets manager, use separate keys per project, set spend limits and delete or replace a key immediately if it leaks.
Yes. Anthropic’s documentation lists several cloud platforms that offer Claude, with authentication through the provider’s own system. Feature availability can differ, so check the features overview.
The developer documentation at platform.claude.com/docs, including the Get started guide, the API reference and release notes, and Anthropic’s pricing page. Details change often, so check dates.
18Summary and Key Takeaways
An API is a standard way for one program to ask another for something and receive a response. The Claude API is Anthropic’s programmatic doorway to Claude models, with the Messages API at its heart and a Batches API for large asynchronous jobs. It is different from the Claude app: the app is a finished product for people, while the API is a set of building blocks for developers, accessed with a Console account and an API key, and paid for by the tokens you use rather than by subscription. Each request names a model, carries messages and settings, and returns a reply, and each request is separate unless your program supplies earlier context. You can start in the Workbench, use client SDKs and the documentation, choose a model tier to balance quality, cost and speed, and, if you prefer, reach Claude through certain cloud platforms. Keep your key secret, set spend limits, expect rate limits and check current documentation, because models, prices and features change often.
Key Takeaways
- An API is a doorway for programs — one program sends a request and another sends back a response, following agreed rules.
- The Claude API is separate from the app — it uses a Console account and API key and is billed by usage, not by chat subscription.
- Requests are simple bundles — a model, messages, optional instructions and settings go in, and a reply comes out.
- Tokens measure everything — they set both what fits in a request and what you pay, with output usually costing more than input.
- Each request is separate — Claude does not remember earlier requests unless your program sends the context again.
- Choose models and features wisely — start with lighter models, use batching for work that can wait and consider caching for repeated context.
- Protect keys and watch costs — keep keys secret, set spend limits, expect rate limits and rely on current documentation as things change.