Create a Message
Changed onSend a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our user guide
Request
- Base URLhttps://api.anthropic.com
- Authnone declared
Headers
The version of the Claude API you want to use.
Read more about versioning and our version history here.
The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization.
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Request body
Example request
{
"max_tokens": 1024,
"messages": [
{
"content": "Hello, world",
"role": "user"
}
],
"model": "claude-opus-5-5"
}Response
Message object.
Example response
{
"content": [
{
"citations": null,
"text": "Hi! My name is Claude.",
"type": "text"
}
],
"diagnostics": null,
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"model": "claude-opus-5-5",
"role": "assistant",
"stop_details": null,
"stop_reason": "end_turn",
"stop_sequence": null,
"type": "message",
"usage": {
"input_tokens": 2095,
"output_tokens": 503,
"speed": "standard"
}
}Changes
- breaking
the
response's property type changed from no type toobjectfor status - info
added the optional property
/to the response with the status - info
added to the
/response propertyanyOflist for the response status - info
removed discriminator from
response property for the response status - info
removed from the
response propertyoneOflist for the response status - info
added the required property
/to the response with the status - info
added the required property
/to the response with the status
- breaking
- breaking
the
/request property type changed fromobjectto no type - warning
removed the request property
// - warning
removed the request property
// - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- info
added
assistantsystemuserdiscriminator mapping keys to the/request property - info
added to the
/request propertyoneOflist
- breaking