AI 4 min

What is the Claude API and What Can You Use It For?

Short answer

The Claude API is Anthropic's interface for accessing Claude models programmatically. You send text or files via HTTP requests and receive a response you can use in your own application. You are charged per token. It is the right choice when you want to build AI features into your own product or automation workflow, rather than using Claude manually via the website.

The Claude API gives developers direct access to Claude models to build AI features into their own applications, without using the claude.ai chat interface.

What the Claude API Is

The API gives you direct access to Anthropic’s models without using the claude.ai website. You send an HTTP request containing your input text (a prompt) and receive a text response. This works the same way Claude does when you chat with it manually, but you control every part of the interaction: what model to use, what instructions to give, and how long responses can be. Any application that can make an HTTP request can use the API. For an overview of what Claude is, read What is Claude by Anthropic.

What You Can Build With It

The API lets you add AI capabilities to your own products. Common uses include: an internal tool that analyses customer feedback and categorises it automatically, a document processing pipeline that extracts key fields from uploaded PDFs, a chatbot on your website that answers questions based on your knowledge base, or an automation that reads incoming emails and drafts replies. If you want to connect Claude to an automation workflow without writing code, read how to connect an AI model to your n8n workflow.

How It Works Technically

You authenticate with an API key, select a model (haiku, sonnet, or opus), and send a JSON request containing your messages. The request includes a system prompt (background instructions for Claude, such as “You are a helpful assistant specialised in Dutch tax law”) and the user message. You can also send files such as PDFs or images. The response comes back as JSON, and you extract the text from it. The API is stateless, meaning each request is independent unless you include previous messages in the conversation history yourself.

Pricing and Tokens

You pay per token. A token is roughly three-quarters of a word, so a 1,000-word document is approximately 1,300 tokens. Pricing differs by model tier: Haiku is cheapest, Opus most expensive. Input (what you send) and output (what Claude generates) are priced separately. For most use cases, cost is not a significant concern at low to moderate volumes. At very high volumes it is worth calculating upfront. Anthropic provides a usage dashboard in the console so you can monitor spending.

API vs Web App: When to Use Which

Use claude.ai when you want to interact with Claude manually for one-off tasks. Use the API when you need Claude to run automatically as part of a larger system, when you want to build Claude into your own product, or when you need to process many documents without manual input. The web app is also fine for prototyping: once you have a prompt that works reliably, you can move it to the API for production use.

Our tip: Test your prompts in claude.ai first. Iterate until the output is consistently good, then copy that exact prompt as your system prompt in the API. This saves a lot of trial and error when building integrations.

Frequently asked questions

How do I get access to the Claude API?

Create an account at console.anthropic.com. Anthropic provides trial credits when you first sign up, which lets you test the API without a payment method. To use it in production, you add a credit card and pay per token. You can set usage limits to avoid unexpected costs. Once you have an API key, you include it in HTTP request headers to authenticate your calls.

How much does the Claude API cost?

Pricing is per million tokens, where a token is roughly three-quarters of a word. Haiku is the cheapest tier, followed by Sonnet and Opus. Input tokens (what you send) and output tokens (what Claude generates) are priced differently, with output typically costing more. Exact pricing is on Anthropic's website and changes periodically. For most business use cases, the cost per request is a fraction of a cent, making it affordable at moderate volumes.

What is the difference between the API and claude.ai?

Claude.ai is a web application for individual users to interact with Claude through a chat interface. The API is for developers who want to integrate Claude into their own software. With the API you control everything: the system prompt, the model version, the context you send, and how you handle the response. There is no fixed interface, so you can embed Claude's capabilities in any product or workflow.

Can I use the Claude API with n8n or other automation tools?

Yes. n8n has a built-in Anthropic node that connects to the Claude API without you writing HTTP calls manually. Other automation platforms like Make also have Claude integrations. For n8n specifically, see the article on connecting an AI model to your n8n workflow for a step-by-step guide.

Want a dashboard or automation built for you?

Stuurboard BI builds custom Power BI dashboards and workflow automations. Pragmatic, fast, and without the fuss.