Poll a Thread
curl --request GET \
--url https://api.consensus.app/v1/threads/{thread_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.consensus.app/v1/threads/{thread_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.consensus.app/v1/threads/{thread_id}', 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.consensus.app/v1/threads/{thread_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.consensus.app/v1/threads/{thread_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.consensus.app/v1/threads/{thread_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.consensus.app/v1/threads/{thread_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"status": "running",
"url": "<string>",
"interactions": [
{
"interaction_id": "<string>",
"status": "running",
"mode": "pro",
"input_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"skill": "<string>",
"response": "<string>",
"agent_trace": "<string>",
"citations": [
{
"n": 123,
"paper_id": "<string>",
"title": "<string>",
"authors": [
"<string>"
],
"year": 123,
"journal": "<string>",
"doi": "<string>",
"url": "<string>",
"institutional_access_url": "<string>",
"snippets": [
{
"marker": "<string>",
"quote": "<string>",
"section": "<string>"
}
]
}
],
"stats": {
"retrieved": 123,
"screened": 123,
"included": 123
}
}
],
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Threads
Poll a Thread
The polling half of create-then-poll. While status is running, wait poll_after_seconds from the dispatch response between polls (5 for pro, 20 for deep); faster polling is rate-limited (hard cap 3/s per account, shared across all of its Threads). Readable for any Thread the key can access, including ones shared with the caller, not only Threads it created. Only the target interaction (interaction_id, or the latest) carries response/citations; earlier turns are metadata unless requested explicitly.
GET
/
v1
/
threads
/
{thread_id}
Poll a Thread
curl --request GET \
--url https://api.consensus.app/v1/threads/{thread_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.consensus.app/v1/threads/{thread_id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.consensus.app/v1/threads/{thread_id}', 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.consensus.app/v1/threads/{thread_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.consensus.app/v1/threads/{thread_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.consensus.app/v1/threads/{thread_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.consensus.app/v1/threads/{thread_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"status": "running",
"url": "<string>",
"interactions": [
{
"interaction_id": "<string>",
"status": "running",
"mode": "pro",
"input_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"skill": "<string>",
"response": "<string>",
"agent_trace": "<string>",
"citations": [
{
"n": 123,
"paper_id": "<string>",
"title": "<string>",
"authors": [
"<string>"
],
"year": 123,
"journal": "<string>",
"doi": "<string>",
"url": "<string>",
"institutional_access_url": "<string>",
"snippets": [
{
"marker": "<string>",
"quote": "<string>",
"section": "<string>"
}
]
}
],
"stats": {
"retrieved": 123,
"screened": 123,
"included": 123
}
}
],
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
Response
Successful Response
GET /v1/threads/{thread_id} — the polling half of create-then-poll.