Quickstart
Go from zero to a working browser session in under 5 minutes.
1. Install the SDK
Section titled “1. Install the SDK”pip install tzafonnpm install @tzafon/lightcone2. Get your API key
Section titled “2. Get your API key”Sign up at lightcone.ai and copy your API key from the dashboard.
Set it as an environment variable:
export TZAFON_API_KEY=sk_your_api_key_here3. Create a browser and take a screenshot
Section titled “3. Create a browser and take a screenshot”from tzafon import Lightcone
client = Lightcone()
with client.computer.create(kind="browser") as computer: computer.navigate("https://wikipedia.org") computer.wait(2)
result = computer.screenshot() print(computer.get_screenshot_url(result)) # The session terminates automatically when the block exitsimport Lightcone from "@tzafon/lightcone";
const client = new Lightcone();const computer = await client.computers.create({ kind: "browser" });
await client.computers.navigate(computer.id!, { url: "https://wikipedia.org" });
const result = await client.computers.screenshot(computer.id!);console.log(result.result?.screenshot_url);
await client.computers.delete(computer.id!);Run it:
python your_script.pynpx tsx your_script.tsYou should see a screenshot URL printed to the console. Open it in your browser to see the captured page.
The output looks something like:
https://screenshots.tzafon.ai/abc123-def456.pngWhat just happened?
Section titled “What just happened?”- Created a sandboxed Chromium browser session in the cloud
- Navigated to Wikipedia
- Captured a screenshot and got back a URL
- Terminated the session (automatically in Python, explicitly in TypeScript)
The whole process takes about 3–5 seconds.
Customize the session
Section titled “Customize the session”You can configure the session when you create it:
with client.computer.create( kind="browser", timeout_seconds=3600, inactivity_timeout_seconds=120, display={"width": 1280, "height": 720, "scale": 1.0},) as computer: # ...const computer = await client.computers.create({ kind: "browser", timeout_seconds: 3600, inactivity_timeout_seconds: 120, display: { width: 1280, height: 720, scale: 1.0 },});| Parameter | Description |
|---|---|
kind | "browser" for web automation, "desktop" for full Linux desktop |
timeout_seconds | Maximum session lifetime (default: plan-dependent) |
inactivity_timeout_seconds | Idle timeout before auto-termination (default: plan-dependent) |
display | Viewport dimensions and scale factor |
persistent | Save cookies/storage for reuse across sessions (default: false) |
use_advanced_proxy | Route through residential proxy for stealth (default: false) |
Next steps
Section titled “Next steps”- Computers — understand sessions, lifecycle, and all available actions
- Automate a browser — end-to-end browser automation walkthrough
- Run an agent — let AI complete tasks autonomously
- How Lightcone works — architecture and the three API layers