curl https://mdb.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MINDS_API_KEY" \
-d '{
  "model": "<name of the mind that you created>",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Can you summarize the data you have access to?"
    }
  ],
  "stream": false
}'
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1702685778,
  "model": "<name of the mind that you created>",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I have access to sales data, customer info, and website analytics. Let me know if you need details!"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 9,
    "total_tokens": 18
  },
  "system_fingerprint": null
}
This API endpoint creates a model response for the given chat conversation using the POST method.

Body

messages
array
required
A list of messages comprising the conversation so far.
model
string
required
Name of the Mind that you created.
stream
boolean
If set, Minds’ thoughts will be streamed before the final response.
frequency_penalty
number
This setting ranges from -2.0 to 2.0. Positive values make the model less likely to repeat phrases it has already used.
max_tokens
integer
This parameter sets the maximum number of tokens that can be generated in the chat completion.
temperature
number
This parameter controls the randomness of the output with values ranging from 0 to 2. A higher value increases randomness in the output, while a lower value, like 0.1, results in more focused and deterministic output.
tools
array
This setting allows you to specify a list of tools that the model can call, currently limited to functions.

Response

id
string
required
Unique identifier for the completion.
object
string
required
Type of the returned object (e.g., “chat.completion”).
created
integer
required
Timestamp for when the completion was created.
model
string
required
Name of the model that generated the response.
choices
array
required
An array of response choices. Each choice includes an index and the assistant’s message.
usage
object
Token usage statistics for the prompt and response.
system_fingerprint
string
Optional fingerprint of the backend system.

Authorization

A valid API key must be passed in the Authorization header:
Authorization: Bearer MINDS_API_KEY
Generate your API key here.

Path Parameters

None.
curl https://mdb.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MINDS_API_KEY" \
-d '{
  "model": "<name of the mind that you created>",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Can you summarize the data you have access to?"
    }
  ],
  "stream": false
}'
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1702685778,
  "model": "<name of the mind that you created>",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I have access to sales data, customer info, and website analytics. Let me know if you need details!"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 9,
    "total_tokens": 18
  },
  "system_fingerprint": null
}