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
    instructions
    Type
    string
    Required
    Description

    Instructions provided in a Run override instructions provided in an Assistant.

  • Name
    model
    Type
    string
    Required
    Description

    Name of the Mind that you created.

  • Name
    tools
    Type
    array
    Required
    Description

    Tools to be used in a Run.

  • Name
    metadata
    Type
    array
    Required
    Description

    Metadata for a Run.

Request

POST
/threads/{thread_id}/runs/{run_id}
curl -X POST "https://mdb.ai/threads/mdb_thread_cfa0fac64cd94faab3ae269d768c0cb0/runs" \
  -H "Authorization: Bearer MINDS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistant_id": "<name of the mind that you created>",
    "instructions": "Run the assistant to list all planets in the solar system.",
    "tools": [],
    "metadata": {}
  }'

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?