Table of Contents
The Claude API lets an application send messages to Anthropic models and use the returned content inside a product, workflow, or internal tool. This guide uses Postman to show the underlying HTTP request before you move to an official software development kit.
Model IDs, prices, account screens, and rate limits change. Use Anthropic's current quickstart and Messages API reference as the source of truth.
What you need
- An Anthropic Console account with API access
- An API key created for a specific project or workspace
- Available billing credit or an approved organization billing method
- Postman, curl, or another HTTP client
- Basic familiarity with JSON
Claude subscriptions and Claude API billing are separate products. Having access to the Claude chat application does not necessarily include API usage.
1. Configure billing
Open the Anthropic Console billing area and review the available funding or invoicing options for your account. Do not rely on an old minimum-purchase amount; the current Console shows the applicable terms.


After setup, confirm that the Console displays the expected balance or billing status.

2. Create an API key
Open API Keys in the Console.

Select Create Key.

Give the key a name that identifies its environment and purpose, such as postman-development. Assign it to the narrowest suitable workspace.

Copy the secret once and store it in a password manager or secrets manager. Do not put it in source code, screenshots, chat messages, browser-side JavaScript, mobile apps, public repositories, or shared documentation.

If a key is exposed, disable or delete it and create a replacement. Rotating the secret is safer than trying to determine whether it was used.

3. Create a Postman request
The Messages API endpoint is:
https://api.anthropic.com/v1/messages
Check the current reference before using the endpoint in production.

Create a new request in Postman.


Select HTTP.

Paste the endpoint into the request URL field.

4. Add the required headers
A direct HTTP request normally includes:
x-api-key: {{ANTHROPIC_API_KEY}}
anthropic-version: 2023-06-01
content-type: application/json
Use the API version required by the current documentation. Do not invent a newer date.

Open Postman's Headers tab.

Add the three headers.

Store the secret in a Postman environment variable rather than pasting it into a collection that may be exported or synchronized.

5. Change the method to POST
The Messages endpoint accepts a POST request.

Change Postman's method selector from GET to POST.

6. Understand an empty-body error
If you send the request before adding JSON, the API should reject it because required fields are missing.


Read the HTTP status and structured error message. A 400 usually points to invalid or missing request data; 401 indicates an authentication problem; 429 indicates a rate or usage limit. Use the returned error details rather than guessing.
7. Add the JSON body
The current reference provides examples for curl and SDKs.

A minimal Postman body has this shape:
{
"model": "CURRENT_MODEL_ID",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Explain what an API is in two sentences."
}
]
}
Replace CURRENT_MODEL_ID with a model ID copied from the current Anthropic documentation or Console. Model display names and API identifiers are not always interchangeable.

In Postman, open Body, select raw, choose JSON if the selector is available, and paste the object.

8. Send the request and read the response
Select Send.

A successful response returns an HTTP 200 status and a JSON message object. Text appears inside content blocks rather than as an unstructured page.

Each successful call consumes billable input and output tokens according to the selected model's current price. Set usage alerts and limits before testing loops or production traffic.
9. Change the user message
Edit only the content value and send again.

The response content should reflect the new request.

10. Add system instructions
The optional top-level system field describes persistent behavior for that request. It is not placed as a message with a system role in the Messages API.

{
"model": "CURRENT_MODEL_ID",
"max_tokens": 256,
"system": "Answer in concise plain language. If a required fact is missing, say so.",
"messages": [
{
"role": "user",
"content": "Explain what an API is in two sentences."
}
]
}

Send the request again.

Compare the output, but test across many representative inputs before concluding that an instruction is reliable.

11. Treat sampling controls as test parameters
The reference may expose parameters such as temperature. Their permitted range and interaction with other settings can change, so follow the current API reference.


Higher randomness is not the same as higher quality. For extraction, classification, or policy-driven responses, consistency is usually more important. Evaluate several outputs with a fixed test set.
Move from Postman to production
- Use an official Anthropic SDK where practical.
- Keep the API key on a trusted server, never in client-side code.
- Set timeouts, retry only transient failures, and use exponential backoff.
- Validate user input and model output.
- Log request identifiers and errors without logging secrets or unnecessary personal data.
- Enforce per-user limits and monitor cost.
- Use version control for prompts and evaluation cases.
- Define a fallback when the API is unavailable or uncertain.
Common problems
- 401: check that the key is active, correctly loaded, and sent in
x-api-key. - 400: validate JSON, required fields, model ID, and parameter types.
- 404: check the endpoint and model availability for the account.
- 429: slow the request rate and inspect account or workspace limits.
- Unexpected output: reduce ambiguity, add examples, and evaluate the prompt against representative cases.
Once the basic request works, save it as a development example, replace the secret with an environment variable, and build tests before connecting it to real customer or business data.
Reader Comments 0
Sign in with email or Google to join the discussion.