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://aihubmix.com
- Auth
- API key in header x-api-key
- or HTTP bearer
Headers
The version of the Claude API you want to use.
Read more about versioning and our version history here.
Request body
Example request
{
"max_tokens": 1024,
"messages": [
{
"content": "Hello, world",
"role": "user"
}
],
"model": "claude-opus-4-6"
}Response
Message object.
Example response
{
"content": [
{
"citations": null,
"text": "Hi! My name is Claude.",
"type": "text"
}
],
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"model": "claude-opus-4-6",
"role": "assistant",
"stop_details": null,
"stop_reason": "end_turn",
"stop_sequence": null,
"type": "message",
"usage": {
"input_tokens": 2095,
"output_tokens": 503
}
}Changes
- breaking
added the new required request property
- breaking
the request's body type changed from no type to
object - breaking
the request property
became required - breaking
the request property
became required - breaking
the
request property type changed from no type toarray - breaking
added to the response body
oneOflist for the response status (media type: text/event-stream) - breaking
the response's body type changed from no type to
objectfor status (media type: application/json) - info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added
subschema #1subschema #2subschema #3subschema #4subschema #5subschema #6subschema #7subschema #8subschema #9subschema #10subschema #11subschema #12subschema #13subschema #14subschema #15subschema #16subschema #17subschema #18subschema #19to therequest propertyanyOflist - info
added response discriminator for the response status (media type: text/event-stream)
- info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json) - info
added the required property
to the response with the status (media type: application/json)
- breaking