# Claude API

> Claude's own web service. Your code sends it a chat and gets a reply.

**Field:** Software Development  
**Category:** AI Engineering  
**Also known as:** Anthropic API, Claude Messages API, Claude Developer API

## Think of it like

It is like a phone line to one smart helper. You call, ask, and hear the answer.

## Definition

The Claude API is Anthropic's web service for using Claude models in your code. Your app sends a request to api.anthropic.com/v1/messages. It holds a key, a model name, a limit on reply length and the messages. A header called anthropic-version must be sent too. It fixes how the API acts. The reply holds Claude's answer and a count of the tokens used.

## Example

Lucy's note app sends each page to the Claude API and asks for a three-line summary. The usage block in each reply tells her how many tokens the page took.

## Example code

```bash
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "content-type: application/json" \
  -d '{"model": "claude-opus-5-5", "max_tokens": 1000,
       "messages": [{"role": "user", "content": "Hello, Claude"}]}'
```

One call to the Messages API. The key, the version and the content type go in headers.

## Why it matters

It is the most direct way to reach Claude, with the newest models and features in one place. Clouds that also sell Claude may not have every feature.

## Common mistake

Leaving out the anthropic-version header when calling it by hand. The header is required, so the request is turned away. The official code kits add it for you.

## Three principles

- **One main endpoint.** POST /v1/messages sends the chat.
- **A version header.** Fixes how the API behaves.
- **Official code kits.** Python, TypeScript, Go, Java and more.

## Related terms

- [LLM API](https://learn.benibix.com/term/development/llm-api)
- [OpenAI API](https://learn.benibix.com/term/development/openai-api)
- [Claude Managed Agents](https://learn.benibix.com/term/development/claude-managed-agents)
- [Token Usage](https://learn.benibix.com/term/development/token-usage)
- [LLM Batch API](https://learn.benibix.com/term/development/batch-api)
- [Claude](https://learn.benibix.com/term/ai/claude)
- [Anthropic](https://learn.benibix.com/term/ai/anthropic)

![Two request cards side by side. On the left, the Claude API: POST to api.anthropic.com/v1/messages, with an x-api-key header, an anthropic-version header and a JSON body with model, max_tokens and messages. On the right, the OpenAI API: POST to api.openai.com/v1/responses, with an Authorization Bearer header and a JSON body with model and input. Under both, the same thing comes back: the reply text and a count of tokens.](https://learn.benibix.com/diagrams/dev6-provider-apis.svg)

---

Source: https://learn.benibix.com/term/development/claude-api
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
