docs/minds/rest_api/create_run.mdx
This API endpoint creates a Run on a specific Thread using the POST method.
ID of the Assistant (Mind) that will be used to run the Thread.
</ParamField> <ParamField body='stream' type='array'>Stream Mind's thoughts by setting this parameter to true.
</ParamField>A valid API key must be passed in the Authorization header:
Authorization: Bearer MINDS_API_KEY
Generate your API key here.
ID of the Thread to run.
</ParamField> <RequestExample>curl -X POST "https://mdb.ai/threads/mdb_thread_4d3f3805c95f4c1a9d77d32cbdfbe3d9/runs" \
-H "Authorization: Bearer MINDS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": "<name of the mind that you created>",
"stream": true
}'
from openai import OpenAI
client = OpenAI(
api_key='MINDS_API_KEY',
base_url='https://mdb.ai/'
)
run = client.beta.threads.runs.create(
thread_id="thread_abc123",
assistant_id="<name of the mind that you created>"
)
print(run)
import OpenAI from "openai";
const openai = new OpenAI(
api_key='MINDS_API_KEY',
baseURL='https://mdb.ai/'
);
async function main() {
const run = await openai.beta.threads.runs.create(
"thread_abc123",
{ assistant_id: "<name of the mind that you created>" }
);
console.log(run);
}
main();
{
"id": "mdb_run_8b425f3bf0a04ca584ad11106d37330c",
"assistant_id": "mdb_asst_cfde04f34a5e47548b705fbf091e06bc",
"cancelled_at": null,
"completed_at": null,
"created_at": 1718885800,
"expires_at": null,
"failed_at": null,
"incomplete_details": null,
"instructions": "",
"last_error": null,
"max_completion_tokens": null,
"max_prompt_tokens": null,
"metadata": null,
"model": "",
"object": "thread.run",
"required_action": null,
"response_format": null,
"started_at": null,
"status": "queued",
"thread_id": "mdb_thread_cfa0fac64cd94faab3ae269d768c0cb0",
"tool_choice": null,
"tools": [],
"truncation_strategy": null,
"usage": null,
"temperature": null,
"top_p": null
}