cURL
curl --request POST \ --url https://api.matterai.so/v1/chat/completions \ --header 'Content-Type: application/json' \ --data '{ "model": "<string>", "messages": [ { "role": "<string>", "content": "<string>" } ], "stream": true, "max_tokens": 123, "reasoning": { "effort": "<string>" }, "response_format": { "type": "<string>" }, "temperature": 123, "top_p": 123 }'
{ "400": {}, "401": {}, "429": {}, "500": {}, "id": "<string>", "object": "<string>", "created": 123, "model": "<string>", "choices": [ { "index": 123, "message": { "role": "<string>", "content": "<string>" }, "finish_reason": "<string>" } ], "usage": { "prompt_tokens": 123, "completion_tokens": 123, "total_tokens": 123 } }
Create a chat completion using the Matter AI API
Authorization: Bearer MATTER_API_KEY
"axon"
Show Message Object
"system"
"user"
"assistant"
Show Reasoning Object
"none"
"low"
"medium"
"high"
Show Response Format Object
"text"
json
"chat.completion"
Show Choice Object
"stop"
"length"
"content_filter"
Show Usage Object
curl --location 'https://api.matterai.so/v1/chat/completions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer MATTER_API_KEY' \ --data '{ "model": "axon-code", "messages": [ { "role": "system", "content": "You are a helpful assistant" }, { "role": "user", "content": "Hi" } ], "stream": true, "max_tokens": 2000, "reasoning": { "effort": "none" }, "response_format": { "type": "text" }, "temperature": 0.1, "top_p": 1 }'
{ "id": "chatcmpl-cd3ac60c-9746-457b-b4fa-aca53a993249", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Axon is an Agentic LLM Model for coding by MatterAI, designed as an elite software engineering assistant for architecting mission-critical systems." }, "finish_reason": "stop" } ], "created": 1756372473, "model": "axon-code", "object": "chat.completion", "usage": { "prompt_tokens": 34, "completion_tokens": 1031, "total_tokens": 1065, "completion_tokens_details": { "reasoning_tokens": 1001 }, "prompt_tokens_details": { "cached_tokens": 0 } } }
stream
true
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1677652288,"model":"axon","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]} data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1677652288,"model":"axon","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]} data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1677652288,"model":"axon","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: [DONE]
{ "error": { "message": "Invalid API key provided", "type": "invalid_request_error", "code": "invalid_api_key" } }