Skip to main content
POST
Chat

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 chat completion. Available models: "axon-2-5-pro", "axon-2-5-mini".
array
required
An array of message objects that make up the conversation.
boolean
default:"false"
Whether to stream the response as it’s generated.
array
A list of tools the model may call. Currently, only functions are supported as a tool type.
string
default:"auto"
Controls which (if any) tool is called by the model. Options: "none" means the model will not call any tool and instead generates a message. "auto" means the model can pick between generating a message or calling one or more tools. "required" means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
integer
default:"2048"
The maximum number of tokens to generate in the completion.
object
Configuration for reasoning capabilities.
object
The format of the response.
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 chat completion.
string
The object type, which is always "chat.completion".
integer
The Unix timestamp (in seconds) of when the chat completion was created.
string
The model used for the chat completion. Available models: "axon-2-5-pro", "axon-2-5-mini".
array
A list of chat completion choices.
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: