🧬Claude API
Also known as Anthropic API, Claude Messages API, Claude Developer API
Claude's own web service. Your code sends it a chat and gets a reply.
Think of it like
It is like a phone line to one smart helper. You call, ask, and hear the answer.
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.
Definition
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"}]}'Common mistake
Key takeaways
- 1One main endpoint. POST /v1/messages sends the chat.
- 2A version header. Fixes how the API behaves.
- 3Official code kits. Python, TypeScript, Go, Java and more.