v1
latestOpenAPI 3.1.02026-07-224941145.6 KBCreate a Message
Send a structured list of input messages with text and/or image content, and Claude Sonnet 5 will generate the next message in the conversation.
post/v1/messages
Request body
Example request
{
"model": "claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"temperature": 1
}Response
Message created successfully
Example response
{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"model": "claude-sonnet-5"
}