Skip to main content

Start Session Tape

POST /v1/sessions/{session_id}/tape/start

Start recording a tape for one of your sessions.

A tape is a step-by-step record of what happens on the session's VM (executions, HTTP egress, LLM calls, file changes) that you can read, diff and branch from later. If the session or its VM already has a tape recording, that tape is returned and no new one is started. retention_days sets when the tape expires (0 keeps it until you delete it). To record a VM directly, use POST /v1/vms/\{vm_id\}/tape/start.

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
session_idpathstringYes
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"record_egress_content": {
"type": "boolean",
"title": "Record Egress Content",
"default": false
},
"record_fs": {
"type": "boolean",
"title": "Record Fs",
"default": true
},
"retention_days": {
"type": "integer",
"maximum": 365,
"minimum": 0,
"title": "Retention Days",
"default": 7
}
},
"type": "object",
"title": "TapeStartRequest"
}

Field details:

FieldTypeRequiredDescriptionConstraints
record_egress_contentbooleanNodefault=false
record_fsbooleanNodefault=true
retention_daysintegerNodefault=7, min=0, max=365

Responses​

200​

Successful Response

application/json​

Resolved schema:

{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Session Id"
},
"vm_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vm Id"
},
"parent_tape_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Parent Tape Id"
},
"parent_step_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Parent Step Id"
},
"status": {
"type": "string",
"title": "Status"
},
"started_at": {
"type": "string",
"title": "Started At"
},
"stopped_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Stopped At"
},
"total_steps": {
"type": "integer",
"title": "Total Steps",
"default": 0
},
"total_size_bytes": {
"type": "integer",
"title": "Total Size Bytes",
"default": 0
},
"record_egress_content": {
"type": "boolean",
"title": "Record Egress Content",
"default": false
},
"record_fs": {
"type": "boolean",
"title": "Record Fs",
"default": true
},
"retention_until": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Retention Until"
},
"s3_prefix": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "S3 Prefix"
},
"workspace_volume_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Workspace Volume Id"
}
},
"type": "object",
"required": [
"id",
"status",
"started_at"
],
"title": "TapeInfo"
}

Field details:

FieldTypeRequiredDescriptionConstraints
idstringYes
session_idstring | nullNonullable
vm_idstring | nullNonullable
parent_tape_idstring | nullNonullable
parent_step_idinteger | nullNonullable
statusstringYes
started_atstringYes
stopped_atstring | nullNonullable
total_stepsintegerNodefault=0
total_size_bytesintegerNodefault=0
record_egress_contentbooleanNodefault=false
record_fsbooleanNodefault=true
retention_untilstring | nullNonullable
s3_prefixstring | nullNonullable
workspace_volume_idstring | nullNonullable

400​

session_id is not a valid UUID.

No response body.

401​

No credentials, or the Bearer token / X-API-Key is invalid.

No response body.

403​

The account is disabled, or a guest token was used.

No response body.

404​

Session not found, or not yours.

No response body.

422​

Validation Error

application/json​

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo

429​

Rate limit exceeded. Retry later; or your plan's per-minute API request limit was exceeded.

No response body.