Your first browser
From a workspace key to a running cloud browser, with cleanup included.
1. Create a workspace
Open the Tabfleet dashboard, continue with Google, and give your workspace a name. Under API keys, create a Browser control key for your application. Copy it when it is shown; you will not be able to reveal it again.
Keep your key in a secret manager or local environment variable named TABFLEET_API_KEY. The examples below assume it is already set. Never place a workspace key in frontend code.
2. Launch a browser
This shell example requires curl and jq. It reserves up to five trial minutes, uses a two-minute inactivity timeout, and returns a session ID plus a temporary CDP URL.
Keep REQUEST_ID unchanged when retrying this launch after a network error. Use a new ID for a deliberate new browser.
REQUEST_ID=$(uuidgen)
SESSION=$(curl --fail-with-body -sS \
https://api.tabfleet.com/v1/sessions \
-H "Authorization: Bearer $TABFLEET_API_KEY" \
-H "Idempotency-Key: $REQUEST_ID" \
-H 'Content-Type: application/json' \
-d '{"durationSeconds":300,"idleTimeoutSeconds":120}')
SESSION_ID=$(printf '%s' "$SESSION" | jq -r '.id')3. Get a signed viewer
The returned url opens the browser without a Tabfleet sign-in. It is view-only by default and expires no later than the browser session. Treat it as a temporary credential. To visit a website, use the MCP tools or agent-browser.
curl --fail-with-body -sS -X POST \
"https://api.tabfleet.com/v1/sessions/$SESSION_ID/share" \
-H "Authorization: Bearer $TABFLEET_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"mode":"view","ttlSeconds":300}'4. Always close the browser
Closing the viewer or disconnecting your agent leaves the browser running until its idle or hard timeout. End the session explicitly when you finish. In application code, put this call in a finally block.
A 200 response confirms closure. 202 means cleanup is still retrying; poll the session status until it reaches closed.
curl --fail-with-body -sS -X DELETE \
"https://api.tabfleet.com/v1/sessions/$SESSION_ID" \
-H "Authorization: Bearer $TABFLEET_API_KEY"