Skip to content

Create message

Anthropic

Anthropic

Create message

Create a message completion using Anthropic's /v1/messages API (Claude).

Action

Inputs

Name Type Required Description
modeltextRequiredThe model to use (e.g. claude-sonnet-4-20250514 (default), claude-opus-4-5-20251101, claude-sonnet-4-6, claude-opus-4-6). Supported model IDs only.
max_tokensnumberRequiredThe maximum number of tokens to generate before stopping.
messagesarray of objectRequiredInput messages with alternating user and assistant roles.
roleselectRequiredThe role of the message. (options: user, assistant)
contenttextRequiredThe content of the message.
systemtextOptionalOptional system prompt that sets the behavior of the assistant.
temperaturenumberOptionalAmount of randomness; use either temperature or top_p, not both.
top_pnumberOptionalNucleus sampling: consider tokens with top_p probability mass.
top_knumberOptionalOnly sample from the top K options for each token.

Outputs

Name Type Description
statusCodenumberHTTP status code from Anthropic API response.
bodyobjectAnthropic message response: id, content (blocks with text), usage.
idtextUnique message identifier.
typetextObject type (e.g. message).
roletextRole of the response (e.g. assistant).
contentarray of objectArray of content blocks (e.g. type text with text).
typetextBlock type (e.g. text).
texttextGenerated text content.
modeltextModel used for the completion.
stop_reasontextWhy the model stopped (e.g. end_turn, max_tokens).
stop_sequencetextStop sequence if present.
usageobjectToken usage.
input_tokensnumberInput tokens used.
output_tokensnumberOutput tokens generated.