251
All tools

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)

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

RouteSourceCallRequiredDocs
CLIOfficialclaude -pOAuthDocs
APIOfficialPOST /v1/messagesAPI key in $ANTHROPIC_API_KEYDocs

Workflows using Create a message