Create Chat Completion
Generates a model response for the given chat conversation.
Bearer token authentication. Use format "Bearer your-api-key"
ID of the model to use.
dmind/dmind-1If set, partial message deltas will be sent.
falseThe maximum number of tokens to generate in the chat completion.
16384What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1Example: 0.6An alternative to sampling with temperature, called nucleus sampling. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
1Example: 0.95Limits the number of tokens to consider for each step. Use -1 for no limit.
-1Example: -1Minimum probability threshold for token sampling. Tokens with probability below this threshold are filtered out.
0Example: 0.1Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
0Example: 0Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
0Example: 0Up to 4 sequences where the API will stop generating further tokens.
Controls which (if any) tool is called by the model.
Whether to return log probabilities of the output tokens.
falseHow many log probabilities to return per token.
OK
Bad Request
Unauthorized
Rate Limit Exceeded
Internal Server Error
POST /v1/chat/completions HTTP/1.1
Host: brainchat.dmind.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 203
{
"model": "dmind/dmind-1",
"messages": [
{
"role": "user",
"content": "hello"
}
],
"stream": false,
"temperature": 0.6,
"top_p": 0.95,
"top_k": -1,
"min_p": 0.1,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_tokens": 16384
}{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1702685778,
"model": "dmind/dmind-1",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I assist you today?",
"tool_calls": [
{
"id": "text",
"type": "function",
"function": {
"name": "text",
"arguments": "text"
}
}
]
},
"logprobs": {
"content": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
],
"top_logprobs": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
]
}
]
}
]
},
"finish_reason": "stop"
}
],
"prompt_logprobs": {
"content": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
]
}
],
"top_logprobs": []
},
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": "text"
}
}Last updated