Get a process
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}")
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{
"handle": 123,
"pid": 123,
"status": "running",
"stdin_writable": true,
"command": "<string>",
"args": [
"<string>"
],
"started_at": 123,
"exit_code": 123,
"signal": 123,
"ended_at": 123
}{
"error": "<string>",
"code": "<string>"
}Process Management
Get Process
Retrieve process metadata and current status for a sandbox process.
GET
/
api
/
v1
/
processes
/
{pid}
Get a process
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}"
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}', 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}",
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}"
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/processes/{pid}")
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{
"handle": 123,
"pid": 123,
"status": "running",
"stdin_writable": true,
"command": "<string>",
"args": [
"<string>"
],
"started_at": 123,
"exit_code": 123,
"signal": 123,
"ended_at": 123
}{
"error": "<string>",
"code": "<string>"
}Get the current status and metadata for one process.
Endpoint
GET /api/v1/processes/{pid}
Example Request
curl https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/processes/42 \
-H "Authorization: Bearer $TENSORLAKE_API_KEY"
Response
Tensorlake returns200 OK with the process metadata:
{
"handle": 1,
"pid": 42,
"status": "running",
"exit_code": null,
"signal": null,
"stdin_writable": false,
"command": "python",
"args": ["-m", "http.server", "8080"],
"started_at": 1710000000000,
"ended_at": null
}
handle is a daemon-local stable identifier. Route paths use the operating-system pid.
If the process does not exist, Tensorlake returns 404 Not Found.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
Process metadata
Available options:
running, exited, signaled, oom_killed Was this page helpful?