POST/threads/{thread_id}/runs/{run_id}

Create Run

This endpoint creates a Run.

Path Parameters

  • Name
    thread_id
    Type
    string
    Required
    Description

    Id of a Thread to run.

  • Name
    run_id
    Type
    string
    Required
    Description

    Id of a Run to execute.

Authorization

Request Body

  • Name
    assistant_id
    Type
    string
    Required
    Description

    Id of an Assistant created earlier.

  • Name
    stream
    Type
    array
    Required
    Description

    Stream Mind's thoughts by setting this parameter to true.

Request

POST
/threads/{thread_id}/runs/{run_id}
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
  }'

Response

{
    "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
}

GET/threads/{thread_id}/runs/{run_id}

Retrieve Run

This endpoint retrieves a Run.

Path Parameters

  • Name
    thread_id
    Type
    string
    Required
    Description

    Id of a Thread to be listed.

  • Name
    run_id
    Type
    string
    Required
    Description

    Id of a Run to be listed.

Authorization

Request

GET
/threads/{thread_id}/runs/{run_id}
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"

Response

{
  "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
}

Was this page helpful?