---
ref: tool:anthropic/create-message
name: Create a message
company: company:anthropic
workflows: [workflow:gtm-knowledge-answers, workflow:outbound-draft-evaluation-gate]
access: [cli, api]
tags: [capability:write-copy, category:ai-model, has:api, has:cli]
docs: https://platform.claude.com/docs/en/api/messages/create
updated: 2026-09-29
---

# Create a message

Returns Claude's next message for a prompt or conversation, such as a drafted email or a label for a record.

Note: The API call needs the `anthropic-version: 2023-06-01` header alongside the key, and `max_tokens` is required in the body.

## Set up

Use the first option your agent supports.

### CLI (official)

Install the command and sign in with it, then confirm it runs.

```sh
curl -fsSL https://claude.ai/install.sh | bash
claude --version
```

Run `claude -p`.

### API (official)

- Base URL: https://api.anthropic.com
- Endpoint: `POST /v1/messages`
- Auth: send the header `x-api-key: $ANTHROPIC_API_KEY`
- Get a key: https://platform.claude.com/settings/keys
- Docs: https://platform.claude.com/docs/en/api/overview

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

## Rules

- Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
- Never print API keys.
