Python SDK
Call the compatibility API from the supplied Python SDK build.
Obtain the SDK#
Use the supplied wheel or the approved SDK source checkout for your deployment. The provisional package name is tabs-sdk and its import is tabs_sdk. A public PyPI release is not assumed.
Create a Tab#
This example follows the SDK's explicit low-level compatibility interface. Set TABS_API_KEY in your environment. It creates an environment and leaves it present, with auto-pause enabled.
import os
from uuid import uuid4
from tabs_sdk import Tabs, RequestOptions
# Persist this key before sending if restart-safe retries are required.
create_attempt = str(uuid4())
with Tabs(os.environ["TABS_API_KEY"],
base_url="https://api.runtabs.dev", max_retries=0) as tabs:
result = tabs.api.request("POST", "/v2/sandboxes", {
"templateID": "ubuntu",
"timeout": 300,
"autoPause": True,
"metadata": {"name": "python-agent"},
}, RequestOptions(idempotency_key=create_attempt))
sandbox_id = result["sandboxID"]
print(sandbox_id)Handle uncertain results#
Retain the request key and identical body before retrying a create. Do not generate a replacement key after a lost response. Check fleet capacity before requesting another environment and explicitly delete acknowledged Tabs when finished.
Guest operations#
This acknowledgement is not an envd connection. Native commands, files and fork remain unavailable on this deployment. See capabilities.
