Follow combined process output
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow', 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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow",
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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow"
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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow")
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"<string>"Process Management
Follow Process Output
Replay captured output and follow live combined output over Server-Sent Events.
GET
/
api
/
v1
/
processes
/
{pid}
/
output
/
follow
Follow combined process output
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow', 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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow",
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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow"
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://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}/output/follow")
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"<string>"Replay captured output and follow new output over Server-Sent Events.
Use
Endpoint
GET /api/v1/processes/{pid}/output/follow
curl -N or an SSE client so the connection stays open.
Example Request
curl -N https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/processes/42/output/follow \
-H "Authorization: Bearer $TENSORLAKE_API_KEY"
SSE Events
Tensorlake first replays any captured output, then streams live events:event: output
data: {"line":"Processing item 1/10","timestamp":1710000000000,"stream":"stdout"}
event: output
data: {"line":"Processing item 2/10","timestamp":1710000001000,"stream":"stdout"}
event: eof
data: {}
/output/follow follows combined output and includes stream set to stdout or stderr.
If you need a single stream, use Follow Process Stdout or Follow Process Stderr. When the process exits and the output stream closes, Tensorlake sends event: eof.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The operating system PID of the process.
Response
200 - text/event-stream
Output event stream
The response is of type string.
Was this page helpful?