Anthropic · Messages
/v1/messages
Send 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
post/v1/messages
Request
- Base URLhttps://aihubmix.com
- Auth
- API key in header x-api-key
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
anthropic-versionstring
The version of the Claude API you want to use.
Read more about versioning and our version history here.
anthropic-user-profile-idstring
The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the user-profiles beta header.
Request body
Example request
{
"max_tokens": 1024,
"messages": [
{
"content": "Hello, world",
"role": "user"
}
],
"model": "claude-opus-5"
}Response
Message object.
Example response
{
"content": [
{
"citations": null,
"text": "Hi! My name is Claude.",
"type": "text"
}
],
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"model": "claude-opus-5",
"role": "assistant",
"stop_details": null,
"stop_reason": "end_turn",
"stop_sequence": null,
"type": "message",
"usage": {
"input_tokens": 2095,
"output_tokens": 503
}
}Changes
No recorded changes to this operation across all 1 revision of this API.