Skip to main content
GET
/
threads
/
{thread_id}
/
runs
List Runs
curl --request GET \
  --url https://api.example.com/threads/{thread_id}/runs
import requests

url = "https://api.example.com/threads/{thread_id}/runs"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/threads/{thread_id}/runs', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/threads/{thread_id}/runs",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/threads/{thread_id}/runs"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.example.com/threads/{thread_id}/runs")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/threads/{thread_id}/runs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
[
  {
    "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "metadata": {},
    "kwargs": {}
  }
]
{
  "detail": "<string>"
}
{
  "detail": "<string>"
}

Path Parameters

thread_id
string<uuid>
required

The ID of the thread.

Query Parameters

limit
integer
default:10
offset
integer
default:0
status
enum<string>
Available options:
pending,
running,
error,
success,
timeout,
interrupted
select
enum<string>[]

Specify which fields to return. If not provided, all fields are returned.

Available options:
run_id,
thread_id,
assistant_id,
created_at,
updated_at,
status,
metadata,
kwargs,
multitask_strategy

Response

Success

run_id
string<uuid>
required

The ID of the run.

thread_id
string<uuid>
required

The ID of the thread.

assistant_id
string<uuid>
required

The assistant that was used for this run.

created_at
string<date-time>
required

The time the run was created.

updated_at
string<date-time>
required

The last time the run was updated.

status
enum<string>
required

The status of the run. One of 'pending', 'running', 'error', 'success', 'timeout', 'interrupted'.

Available options:
pending,
running,
error,
success,
timeout,
interrupted
metadata
Metadata · object
required

The run metadata.

kwargs
Kwargs · object
required
multitask_strategy
enum<string>
required

Strategy to handle concurrent runs on the same thread.

Available options:
reject,
rollback,
interrupt,
enqueue