Join Thread Stream
curl --request GET \
--url https://api.b-bot.space/api/v2/threads/{thread_id}/stream \
--header 'bbot-api-key: <api-key>'import requests
url = "https://api.b-bot.space/api/v2/threads/{thread_id}/stream"
headers = {"bbot-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'bbot-api-key': '<api-key>'}};
fetch('https://api.b-bot.space/api/v2/threads/{thread_id}/stream', 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.b-bot.space/api/v2/threads/{thread_id}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"bbot-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.b-bot.space/api/v2/threads/{thread_id}/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("bbot-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.b-bot.space/api/v2/threads/{thread_id}/stream")
.header("bbot-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.b-bot.space/api/v2/threads/{thread_id}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["bbot-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Threads
Join Thread Stream
This endpoint streams output in real-time from a thread. The stream will include the output of each run executed sequentially on the thread and will remain open indefinitely. It is the responsibility of the calling client to close the connection.
GET
/
threads
/
{thread_id}
/
stream
Join Thread Stream
curl --request GET \
--url https://api.b-bot.space/api/v2/threads/{thread_id}/stream \
--header 'bbot-api-key: <api-key>'import requests
url = "https://api.b-bot.space/api/v2/threads/{thread_id}/stream"
headers = {"bbot-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'bbot-api-key': '<api-key>'}};
fetch('https://api.b-bot.space/api/v2/threads/{thread_id}/stream', 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.b-bot.space/api/v2/threads/{thread_id}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"bbot-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.b-bot.space/api/v2/threads/{thread_id}/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("bbot-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.b-bot.space/api/v2/threads/{thread_id}/stream")
.header("bbot-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.b-bot.space/api/v2/threads/{thread_id}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["bbot-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Authorizations
API key for authentication
Headers
The ID of the last event received. Used to resume streaming from a specific point. Pass '-' to resume from the beginning.
Path Parameters
The ID of the thread.
Query Parameters
Stream modes to control which events are returned. 'lifecycle' returns only run start/end events, 'run_modes' returns all run events (default behavior), 'state_update' returns only state update events.
Available options:
lifecycle, run_modes, state_update Response
Success
The server will send a stream of events in SSE format.
Example event:
id: 1
event: message
data: {}