Skip to main content
POST
Messages

Authentication

All API requests require authentication using a Bearer token. You can obtain your API key from the MatterAI Console.
Keep your API key secure and never expose it in client-side code. Get your API key from the MatterAI console.

Request

string
required
The model used for the completion. Available models: "axon-2-5-pro", "axon-2-5-mini".
array
required
An array of message objects that make up the conversation.
array
System prompts to provide context or instructions.
integer
default:"512"
The maximum number of tokens to generate in the completion.
boolean
default:"false"
Whether to stream the response as it’s generated.
object
Configuration for thinking/reasoning capabilities.
number
default:"0.1"
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.
number
default:"1"
Controls diversity via nucleus sampling. Range: 0.0 to 1.0.

Response

string
A unique identifier for the message completion.
string
The object type, which is always "message".
string
The role of the response, always "assistant".
array
The content blocks in the response.
string
The model used for the completion. Available models: "axon-2-5-pro", "axon-2-5-mini".
string
The reason the model stopped generating tokens. Possible values: "end_turn", "stop_sequence", "max_tokens".
string
The stop sequence that triggered the stop, if any.
object
Usage statistics for the completion request.

Example Request

Example Response

Streaming

When stream 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:
Bad Request
Invalid request parameters or malformed JSON.
Unauthorized
Invalid or missing API key.
Rate Limited
Too many requests. Please slow down.
Internal Server Error
Server error. Please try again later.
Example error response: