Choose Claude chat when you want to work through a task interactively. Choose the Claude API when your software needs to send requests to Claude and process its responses. The chat walkthrough is for using Claude as a person; the API walkthrough is a separate developer workflow using a Claude Console account and API key. Anthropic describes the Messages API as a way to send conversational messages directly to Claude. (API overview)
Chat or API: which should you use?
- Use Claude chat to ask questions, draft or revise content, analyze material, and refine a result through conversation. You can start at Claude’s web app or use its desktop and mobile apps. Access depends on being in a supported location.
- Use the Claude API when an application or backend needs to send Claude a structured request and use its response in software. Anthropic’s Messages API is a direct model-access route; API access requires a Claude Console account and credentials. (Using the Messages API)
If you are not building software, start with chat. If you are building software, use the API—not a person’s chat session—as the integration route. These are distinct workflows: a chat prompt is typed into Claude’s interface, while an API request is sent by a program to an endpoint.
Use Claude chat for your first task
- Open Claude and start a conversation. Type your prompt into the chat interface and submit it. Claude’s Help Center describes natural, conversational requests as a way to communicate with Claude.
- Give the task enough context. Say what you want done, who the result is for, and any relevant constraints. If your task depends on a document, provide relevant background or attach the file when the interface offers that option. Anthropic’s beginner material recommends setting the scene, stating the task, and specifying rules such as style or format.
- Review the answer, then ask for a specific change. Treat the first response as a draft. If it is too broad, identify which audience, details, or constraints are missing. If the format or length is wrong, name the format or target length. Independently check important facts, especially for high-stakes or niche topics.
Try this prompt:
I’m preparing for a project meeting. Turn the notes below into: (1) decisions made, (2) action items with owners if named, and (3) questions still unresolved. Use concise bullets. If the notes do not say who owns an action, write “owner not specified.” Notes: [paste notes]
Then check whether the answer separates decisions from action items and avoids inventing missing owners. If it misses something, follow up with a targeted instruction such as: “Keep the same sections, but include the deadline mentioned in the third paragraph and mark any inferred detail as an inference.” Specific feedback is more useful than simply asking for a better answer.
Make a first Claude API request
This is a minimal API smoke test, not a complete production application. It sends one user message to the Messages API. The endpoint is POST https://api.anthropic.com/v1/messages. (API migration example; Create a Message reference)
1. Create and store an API key
Sign in to the Claude Console, open its API keys page, create a key, and copy it when shown. Anthropic recommends storing the key somewhere safe, such as a secrets manager. For a shared workload or production service, use an appropriately managed service credential rather than exposing a personal key. (API overview)
In a local macOS or Linux shell, set the key as an environment variable. Replace the placeholder with your actual key; do not include the placeholder literally:
export ANTHROPIC_API_KEY="your-api-key"
Do not commit the key to source control or expose it in browser-side code. Keep API calls on a server you control. Anthropic’s error guidance notes that browser-originated requests can be disallowed for an organization; consult its current documentation if building a browser-based application. (API errors documentation)
2. Send a test request
This request follows Anthropic’s cURL example for API version 2026-10-21, including its endpoint, headers, model, and required JSON fields: model, max_tokens, and messages. Each message has a role and content; this example sends one user message. (API migration example; Create a Message reference)
curl -sS https://api.anthropic.com/v1/messages \\
-D response.headers \\
-o response.json \\
-w 'HTTP %{http_code}\\n' \\
-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": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude"}
]
}'
The command prints the HTTP status and saves the response headers and JSON body to response.headers and response.json. Check the returned status and response body; this guide does not assume a specific success status. Use Anthropic’s API reference and error documentation for current status-code details.
3. Check the result
A Messages API response includes a content array containing typed blocks. Text blocks have type: "text" and a text field. This jq command prints all text blocks:
jq -r '.content[]? | select(.type == "text") | .text' response.json
Anthropic’s example response shows this content-array and text-block structure. A successful HTTP response does not prove that the answer is factually correct; review the content for the task you intend to perform. If the request fails, use the HTTP status and response body to identify the issue, then check Anthropic’s API errors documentation. Its documented 401 authentication error indicates an issue with the API key, such as a malformed, revoked, or expired key. (Using the Messages API)
Improve and verify Claude’s answers
Use this short loop in either chat or your application:
- State the outcome: describe what a useful answer should accomplish.
- Add relevant context: include the source material, audience, and constraints the task depends on.
- Specify the output: request a format and level of detail, such as a short summary or a table.
- Check the result: compare it with source material, test generated code, and independently verify consequential facts.
- Revise with concrete feedback: point to what needs changing rather than repeating the original request unchanged.
Anthropic’s learning materials describe iteration as part of using Claude effectively and advise checking important answers. A third-party author reports using Claude to produce a clean copy, change log, and diff for proofreading; that is an attributed example, not a guaranteed feature or result.
Quick reference
| If you want to… | Use… | First step |
|---|---|---|
| Ask a question, draft something, or refine a result interactively | Claude chat | Start a conversation and submit a clear prompt |
| Add Claude responses to software or a service | Claude API | Create a Console API key and send a Messages API request from your backend |
Keep the API key server-side and review important outputs before relying on them. Use Anthropic’s Help Center and Claude Academy for beginner chat guidance, and the Claude Platform documentation for current API implementation details.
Sources
Migrating to API version 2026-10-21
Create a Message | Claude API Reference
Using the Messages API | Claude Platform Docs
