Prerequisites
Before you begin, make sure you have:- An Anthropic account at console.anthropic.com
- An API key from the API Keys page
- Postman or a terminal with
curlavailable
Your First API Call
You will send a message to Claude and receive a response. This is the foundation of every interaction with the Claude API.Using Postman
Set up your request with the following: Method:POST
URL: https://api.anthropic.com/v1/messages
Headers:
Body:
Using curl
Understanding the Response
A successful request returns a200 OK with a response body like this:
Stop Reasons
Thestop_reason field tells you why Claude stopped generating. Always check this field — a 200 OK does not guarantee a complete response.
Required Request Fields
Every request to/v1/messages requires these three fields:
Available Models
Next Steps
Core Concepts
Understand how the messages array works and how context is managed
System Prompts
Learn how to shape Claude’s behavior for your use case
Streaming
Stream responses in real time for a better user experience
Tool Use
Connect Claude to real-time data and external services