Read the timeline
curl --request GET \
--url https://api.zode.dev/v1/sandboxes/{id}/timeline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zode.dev/v1/sandboxes/{id}/timeline"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zode.dev/v1/sandboxes/{id}/timeline', 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.zode.dev/v1/sandboxes/{id}/timeline",
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.zode.dev/v1/sandboxes/{id}/timeline"
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.zode.dev/v1/sandboxes/{id}/timeline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/sandboxes/{id}/timeline")
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{
"entries": [
{
"ts": "2023-11-07T05:31:56Z",
"track": "metrics",
"event_id": "<string>",
"source": "guest",
"metric": {
"cpu_pct": 123,
"ram_used_mb": 123,
"psi_mem_some": 123,
"disk_read_iops": 123,
"disk_write_iops": 123,
"net_rx_bytes": 123,
"net_tx_bytes": 123
},
"process": {
"pid": 123,
"cmd": "<string>",
"cwd": "<string>",
"sealed": true,
"end_ts": "2023-11-07T05:31:56Z",
"exit_code": 123,
"peak_rss_mb": 123,
"oom_killed": true
},
"ai": {
"git_branch": "<string>",
"provider": "<string>",
"model": "<string>",
"key_id": "<string>",
"failover_attempt": 123,
"input_tokens": 123,
"cached_tokens": 123,
"output_tokens": 123,
"cost_micros": 123,
"latency_ms": 123,
"status_code": 123
},
"net": {
"kind": "<string>",
"host": "<string>",
"status_code": 123,
"blocked": true,
"reason": "<string>",
"secret_key": "<string>"
}
}
],
"next": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Flight recorder
Read the timeline
Read a sandbox’s flight recorder timeline.
One page of the merged timeline (metrics, process, AI and network rows)
in (ts, track, event_id) order, read back from the flight recorder.
Deleted sandboxes stay readable until the recorder purges them.
Process rows have source: guest (reported from inside the VM,
untrusted); the rest are host. Process cmd/cwd come back with
sealed: true when the org key cannot open them. 501
recorder_unavailable when this API has no recorder connected.
GET
/
v1
/
sandboxes
/
{id}
/
timeline
Read the timeline
curl --request GET \
--url https://api.zode.dev/v1/sandboxes/{id}/timeline \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zode.dev/v1/sandboxes/{id}/timeline"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zode.dev/v1/sandboxes/{id}/timeline', 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.zode.dev/v1/sandboxes/{id}/timeline",
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.zode.dev/v1/sandboxes/{id}/timeline"
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.zode.dev/v1/sandboxes/{id}/timeline")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zode.dev/v1/sandboxes/{id}/timeline")
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{
"entries": [
{
"ts": "2023-11-07T05:31:56Z",
"track": "metrics",
"event_id": "<string>",
"source": "guest",
"metric": {
"cpu_pct": 123,
"ram_used_mb": 123,
"psi_mem_some": 123,
"disk_read_iops": 123,
"disk_write_iops": 123,
"net_rx_bytes": 123,
"net_tx_bytes": 123
},
"process": {
"pid": 123,
"cmd": "<string>",
"cwd": "<string>",
"sealed": true,
"end_ts": "2023-11-07T05:31:56Z",
"exit_code": 123,
"peak_rss_mb": 123,
"oom_killed": true
},
"ai": {
"git_branch": "<string>",
"provider": "<string>",
"model": "<string>",
"key_id": "<string>",
"failover_attempt": 123,
"input_tokens": 123,
"cached_tokens": 123,
"output_tokens": 123,
"cost_micros": 123,
"latency_ms": 123,
"status_code": 123
},
"net": {
"kind": "<string>",
"host": "<string>",
"status_code": 123,
"blocked": true,
"reason": "<string>",
"secret_key": "<string>"
}
}
],
"next": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}{
"error": {
"code": "not_found",
"message": "<string>"
}
}Authorizations
An API key (zode_tok_...). Create one in the console under API keys (https://console.zode.dev/tokens), or with zode login.
Query Parameters
⌘I