Sessions
Start a session
Creates a session pinned to an environment version and starts its sandbox. The session is provisioning until the runtime reports ready; watch the stream or poll GET. The response comes within 90 s: a sandbox still starting then is returned provisioning and keeps starting, as it does when the client disconnects. A session still provisioning after 10 minutes is failed with failure_code provisioning_timeout.
POST
/
v1
/
sessions
Start a session
curl --request POST \
--url https://api.veri.studio/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment_id": "<string>",
"environment_version": 123,
"title": "<string>",
"budget_usd": 123
}
'import requests
url = "https://api.veri.studio/v1/sessions"
payload = {
"environment_id": "<string>",
"environment_version": 123,
"title": "<string>",
"budget_usd": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment_id: '<string>',
environment_version: 123,
title: '<string>',
budget_usd: 123
})
};
fetch('https://api.veri.studio/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "<string>",
"id": "<string>",
"environment_id": "<string>",
"environment_version": 123,
"harness": "<string>",
"status": "<string>",
"awake_seconds": 123,
"total_cost_usd": 123,
"rate_usd_per_hour": 123,
"egress_bytes": 123,
"egress_usd_per_gb": 123,
"tool_calls": 123,
"tool_call_usd_per_1k": 123,
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"budget_usd": 123,
"started_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"error_message": "<string>",
"parent_session_id": "<string>",
"forked_from_checkpoint_id": "<string>",
"usage": {
"runs": 123,
"run_duration_ms": {
"p50": 123,
"max": 123
},
"interrupts": 123,
"pauses": 123,
"llm_calls": 123,
"tokens": {
"input": 123,
"output": 123,
"cache_read": 123,
"cache_creation": 123
},
"permission_denials": 123,
"approvals": {
"requested": 123,
"approved": 123,
"denied": 123,
"wait_ms_total": 123
},
"tool_calls": 123,
"boot_ms": 123,
"restore_ms": 123,
"snapshot_ms": 123,
"model_cost_usd": 123,
"harness_estimated_cost_usd": 123
},
"resources": {
"sampled_at": "2023-11-07T05:31:56Z",
"load1": 123,
"mem_bytes": 123,
"mem_limit_bytes": 123,
"disk_bytes": 123
}
}Authorizations
Body
application/json
Response
The new session
Start a session
curl --request POST \
--url https://api.veri.studio/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment_id": "<string>",
"environment_version": 123,
"title": "<string>",
"budget_usd": 123
}
'import requests
url = "https://api.veri.studio/v1/sessions"
payload = {
"environment_id": "<string>",
"environment_version": 123,
"title": "<string>",
"budget_usd": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment_id: '<string>',
environment_version: 123,
title: '<string>',
budget_usd: 123
})
};
fetch('https://api.veri.studio/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"object": "<string>",
"id": "<string>",
"environment_id": "<string>",
"environment_version": 123,
"harness": "<string>",
"status": "<string>",
"awake_seconds": 123,
"total_cost_usd": 123,
"rate_usd_per_hour": 123,
"egress_bytes": 123,
"egress_usd_per_gb": 123,
"tool_calls": 123,
"tool_call_usd_per_1k": 123,
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"budget_usd": 123,
"started_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"failure_code": "<string>",
"error_message": "<string>",
"parent_session_id": "<string>",
"forked_from_checkpoint_id": "<string>",
"usage": {
"runs": 123,
"run_duration_ms": {
"p50": 123,
"max": 123
},
"interrupts": 123,
"pauses": 123,
"llm_calls": 123,
"tokens": {
"input": 123,
"output": 123,
"cache_read": 123,
"cache_creation": 123
},
"permission_denials": 123,
"approvals": {
"requested": 123,
"approved": 123,
"denied": 123,
"wait_ms_total": 123
},
"tool_calls": 123,
"boot_ms": 123,
"restore_ms": 123,
"snapshot_ms": 123,
"model_cost_usd": 123,
"harness_estimated_cost_usd": 123
},
"resources": {
"sampled_at": "2023-11-07T05:31:56Z",
"load1": 123,
"mem_bytes": 123,
"mem_limit_bytes": 123,
"disk_bytes": 123
}
}
