Create a new computer instance
computers.create(ComputerCreateParams**kwargs) -> ComputerResponse
POST/computers
Create a new automation session. Set kind to "browser" for web automation or "desktop" for OS-level automation. Defaults to "browser" if not specified. timeout_seconds controls max lifetime, inactivity_timeout_seconds controls idle timeout, and auto_kill disables only the idle timeout (max lifetime still applies).
Parameters
If true (default), kill session after inactivity
context_id: Optional[str]
environment_id: Optional[str]
inactivity_timeout_seconds: Optional[int]
Idle timeout before auto-kill
kind: Optional[str]
"browser" (default) or "desktop"
Persist cookies/storage state to DB on session teardown only if true
timeout_seconds: Optional[int]
If true (browser sessions), use ADVANCED_PROXY_URL on session start
Returns
Create a new computer instance
import os
from tzafon import Lightcone
client = Lightcone(
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
)
computer_response = client.computers.create()
print(computer_response.id){
"id": "id",
"auto_kill": true,
"created_at": "created_at",
"endpoints": {
"foo": "string"
},
"expires_at": "expires_at",
"idle_expires_at": "idle_expires_at",
"inactivity_timeout_seconds": 0,
"kind": "kind",
"last_activity_at": "last_activity_at",
"max_lifetime_seconds": 0,
"status": "status"
}Returns Examples
{
"id": "id",
"auto_kill": true,
"created_at": "created_at",
"endpoints": {
"foo": "string"
},
"expires_at": "expires_at",
"idle_expires_at": "idle_expires_at",
"inactivity_timeout_seconds": 0,
"kind": "kind",
"last_activity_at": "last_activity_at",
"max_lifetime_seconds": 0,
"status": "status"
}