Back to Mindsdb

Retrieve Mind

docs/minds/rest_api/retrieve_run.mdx

26.1.04.7 KB
Original Source

This API endpoint retrieves a Run using the GET method.

Body

None.

Response

<ResponseField name="id" type="string" required> Unique identifier for the run. </ResponseField> <ResponseField name="assistant_id" type="string" required> ID of the Assistant associated with the run. </ResponseField> <ResponseField name="cancelled_at" type="number"> Timestamp when the run was cancelled. </ResponseField> <ResponseField name="completed_at" type="number"> Timestamp when the run was completed. </ResponseField> <ResponseField name="created_at" type="number" required> Timestamp when the run was created. </ResponseField> <ResponseField name="expires_at" type="number"> Expiration time for the run. </ResponseField> <ResponseField name="failed_at" type="number"> Timestamp when the run failed. </ResponseField> <ResponseField name="incomplete_details" type="object"> Details about why the run was incomplete, if applicable. </ResponseField> <ResponseField name="instructions" type="string"> Instructions sent to the Assistant. </ResponseField> <ResponseField name="last_error" type="object"> Details about the last error, if any. </ResponseField> <ResponseField name="max_completion_tokens" type="number"> Maximum number of tokens for the completion. </ResponseField> <ResponseField name="max_prompt_tokens" type="number"> Maximum number of tokens for the prompt. </ResponseField> <ResponseField name="metadata" type="object"> Additional metadata for the run. </ResponseField> <ResponseField name="model" type="string"> Model name used for the run. </ResponseField> <ResponseField name="object" type="string" required> Type of the returned object (e.g., "thread.run"). </ResponseField> <ResponseField name="required_action" type="object"> Actions required before proceeding. </ResponseField> <ResponseField name="response_format" type="string"> Format of the response. </ResponseField> <ResponseField name="started_at" type="number"> Timestamp when the run started. </ResponseField> <ResponseField name="status" type="string" required> Current status of the run (e.g., "queued", "in_progress"). </ResponseField> <ResponseField name="thread_id" type="string" required> ID of the thread associated with the run. </ResponseField> <ResponseField name="tool_choice" type="string"> Chosen tool for the run. </ResponseField> <ResponseField name="tools" type="array"> List of tools used during the run. </ResponseField> <ResponseField name="truncation_strategy" type="string"> Strategy used to truncate input. </ResponseField> <ResponseField name="usage" type="object"> Usage statistics for the run. </ResponseField> <ResponseField name="temperature" type="number"> Sampling temperature for randomness. </ResponseField> <ResponseField name="top_p" type="number"> Top-p sampling parameter. </ResponseField>

Authorization

A valid API key must be passed in the Authorization header:

Authorization: Bearer MINDS_API_KEY

Generate your API key here.

Path Parameters

<ParamField body='thread_id' type='string' required> ID of a Thread to be listed. </ParamField> <ParamField body='run_id' type='string' required> ID of a Run to be listed. </ParamField> <RequestExample>
shell
curl -X GET "https://mdb.ai/threads/mdb_thread_cfa0fac64cd94faab3ae269d768c0cb0/runs/mdb_run_8b425f3bf0a04ca584ad11106d37330c" \
  -H "Authorization: Bearer MINDS_API_KEY" \
  -H "Content-Type: application/json"
python
from openai import OpenAI
client = OpenAI(
    api_key='MINDS_API_KEY',
    base_url='https://mdb.ai/'
)

runs = client.beta.threads.runs.list("thread_abc123")
print(runs)
js
import OpenAI from "openai";

const openai = new OpenAI(
    api_key='MINDS_API_KEY',
    baseURL='https://mdb.ai/'
);

async function main() {
  const runs = await openai.beta.threads.runs.list("thread_abc123");
  console.log(runs);
}

main();
</RequestExample> <ResponseExample>
json
{
  "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
}
</ResponseExample>