Messages
Messages
Create a message completion using the MatterAI API (Anthropic-compatible)
POST
Messages
Authentication
All API requests require authentication using a Bearer token. You can obtain your API key from the MatterAI Console.Request
The model used for the completion. Available models:
"axon-2-5-pro",
"axon-2-5-mini".An array of message objects that make up the conversation.
System prompts to provide context or instructions.
The maximum number of tokens to generate in the completion.
Whether to stream the response as it’s generated.
Configuration for thinking/reasoning capabilities.
Controls randomness in the output. Higher values make output more random,
lower values make it more focused and deterministic. Range: 0.0 to 2.0.
Controls diversity via nucleus sampling. Range: 0.0 to 1.0.
Response
A unique identifier for the message completion.
The object type, which is always
"message".The role of the response, always
"assistant".The content blocks in the response.
The model used for the completion. Available models:
"axon-2-5-pro",
"axon-2-5-mini".The reason the model stopped generating tokens. Possible values:
"end_turn",
"stop_sequence", "max_tokens".The stop sequence that triggered the stop, if any.
Usage statistics for the completion request.
Example Request
Example Response
Streaming
Whenstream is set to true, the API will return a stream of Server-Sent Events (SSE). Each event contains a JSON object with the partial response:
Error Responses
The API returns standard HTTP status codes to indicate success or failure:Invalid request parameters or malformed JSON.
Invalid or missing API key.
Too many requests. Please slow down.
Server error. Please try again later.