curl --request GET \
--url https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe', 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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"id": "<string>",
"thread_id": "<string>",
"type": "model.message",
"content": "<string>",
"finish_reason": "stop",
"name": "<string>",
"reasoning_content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function",
"tool_info": {
"name": "<string>",
"type": "truefoundry-system"
},
"provider_specific_fields": {}
}
],
"usage": {
"input_tokens": 1,
"input_tokens_breakdown": {
"harness": 1,
"instructions": 1,
"messages": 1,
"skills": 1,
"tool_definitions": 1
},
"output_tokens": 1,
"cache_read_tokens": 1,
"cache_write_tokens": 1
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}Subscribe to a running turn
Subscribe to the live SSE stream for a turn. Only the session creator may subscribe. Pass after_sequence_number to resume after a disconnect (exclusive — events after this sequence number are replayed).
curl --request GET \
--url https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe', 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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/sessions/{session_id}/turns/{turn_id}/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"id": "<string>",
"thread_id": "<string>",
"type": "model.message",
"content": "<string>",
"finish_reason": "stop",
"name": "<string>",
"reasoning_content": "<string>",
"refusal": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function",
"tool_info": {
"name": "<string>",
"type": "truefoundry-system"
},
"provider_specific_fields": {}
}
],
"usage": {
"input_tokens": 1,
"input_tokens_breakdown": {
"harness": 1,
"instructions": 1,
"messages": 1,
"skills": 1,
"tool_definitions": 1
},
"output_tokens": 1,
"cache_read_tokens": 1,
"cache_write_tokens": 1
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}Authorizations
Caller credential (Authorization: Bearer <token>). Required on protected routes when auth is enabled. Browser sessions may use the HttpOnly id_token or accessToken cookie instead.
Path Parameters
Session identifier.
1 - 64Turn identifier.
1Query Parameters
Exclusive resume cursor: replay only events with a sequence number greater than this value. Omit to start from the beginning of the live buffer.
x >= 0Response
Server-Sent Events stream of turn events (deltas and lifecycle).
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
ISO 8601 event timestamp.
Unique identifier for the event (monotonic ULID).
Thread that emitted this message (main for the root agent).
Complete assistant model message.
model.message Assistant message content as text or content parts.
Model finish reason; null when the provider omitted it.
stop, length, tool_calls, content_filter, function_call Optional participant name.
Optional refusal text.
Show child attributes
Show child attributes
Show child attributes
Show child attributes