Skip to main content
POST
/
computers
curl -X POST https://api.tzafon.ai/computers \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "browser",
    "timeout_seconds": 3600,
    "inactivity_timeout_seconds": 120,
    "display": {
      "width": 1920,
      "height": 1080
    }
  }'
{
  "id": "comp_a1b2c3d4e5f6",
  "kind": "browser",
  "status": "ready",
  "created_at": "2025-01-16T12:00:00Z",
  "expires_at": "2025-01-16T13:00:00Z",
  "idle_expires_at": "2025-01-16T12:02:00Z",
  "max_lifetime_seconds": 3600,
  "inactivity_timeout_seconds": 120,
  "auto_kill": true
}

Request

kind
string
default:"browser"
Session type: browser or desktop
timeout_seconds
integer
Maximum session lifetime in seconds. Defaults to plan maximum.
inactivity_timeout_seconds
integer
default:"120"
Seconds of inactivity before auto-termination (if auto_kill is true)
auto_kill
boolean
default:"true"
Automatically terminate session after inactivity timeout
display
object
Display configuration
context_id
string
Custom identifier for request correlation and logging
persistent
boolean
default:"false"
If true, saves session state when the session ends. For browser sessions, this saves cookies and storage state. For desktop sessions, this saves a full VM snapshot. The returned session id can then be passed as environment_id in future sessions to restore state.
environment_id
string
ID of a previously created persistent session (e.g., comp_abc123). For browser sessions, restores cookies, localStorage, and other browser state. For desktop sessions, restores the full VM snapshot including files, installed software, and system configuration. If you pass environment_id without persistent: true, the session starts from the saved state but does not save changes when it ends.
use_advanced_proxy
boolean
default:"false"
If true, routes browser traffic through an advanced residential proxy. Browser sessions only.

Response

id
string
required
Session ID (format: comp_<hex>)
kind
string
required
Session type: browser or desktop
status
string
required
Session status: ready
created_at
string
required
ISO 8601 timestamp
expires_at
string
When max lifetime expires
idle_expires_at
string
When inactivity timeout expires
max_lifetime_seconds
integer
Configured max lifetime
inactivity_timeout_seconds
integer
Configured inactivity timeout
auto_kill
boolean
Whether auto-termination is enabled
curl -X POST https://api.tzafon.ai/computers \
  -H "Authorization: Bearer sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "browser",
    "timeout_seconds": 3600,
    "inactivity_timeout_seconds": 120,
    "display": {
      "width": 1920,
      "height": 1080
    }
  }'
{
  "id": "comp_a1b2c3d4e5f6",
  "kind": "browser",
  "status": "ready",
  "created_at": "2025-01-16T12:00:00Z",
  "expires_at": "2025-01-16T13:00:00Z",
  "idle_expires_at": "2025-01-16T12:02:00Z",
  "max_lifetime_seconds": 3600,
  "inactivity_timeout_seconds": 120,
  "auto_kill": true
}