by Anthropic
Create a message
Returns Claude's next message for a prompt or conversation, such as a drafted email or a label for a record.
Updated Sep 29, 2026
create-message.md
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.
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.
Ways in
Workflows using Create a message
SContributed by shipgtmAnswer a GTM question from Notion, Slack and HubSpotSearches your docs, past conversations and CRM for the answer, drafts a cited response with Claude, and posts it back in Slack.
N
S
H+1
SContributed by shipgtmGate outbound drafts behind a Jev evaluation checkDrafts each message with Claude, saves it to Gmail, scores it with Jev, and revises or sends it once it passes.
A
G
T