Chat
Chat
Create a chat completion using the MatterAI API
POST
Chat
Documentation Index
Fetch the complete documentation index at: https://docs.matterai.so/llms.txt
Use this file to discover all available pages before exploring further.
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 chat completion. Available models:
"axon-2-5-pro", "axon-2-5-mini".An array of message objects that make up the conversation.
Whether to stream the response as it’s generated.
A list of tools the model may call. Currently, only functions are supported as
a tool type.
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.The maximum number of tokens to generate in the completion.
Configuration for reasoning capabilities.
The format of the response.
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 chat completion.
The object type, which is always
"chat.completion".The Unix timestamp (in seconds) of when the chat completion was created.
The model used for the chat completion. Available models:
"axon-2-5-pro", "axon-2-5-mini".A list of chat completion choices.
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.