| Name | Type | Description |
|---|---|---|
api_endpoint | Optional[str] | Default: NoneFull URL of the sandbox API endpoint. If not provided, derived from LANGSMITH_ENDPOINT environment variable. |
timeout | float | Default: 10.0Default HTTP timeout in seconds. |
api_key | Optional[str] | Default: None |
max_retries | int | Default: 3 |
headers | Optional[Mapping[str, str]] | Default: None |
Async client for interacting with the Sandbox Server API.
This client provides an async interface for managing sandboxes and snapshots.
Example:
async with AsyncSandboxClient() as client: # Create a sandbox with the default runtime and run commands async with await client.sandbox() as sandbox: result = await sandbox.run("python --version") print(result.stdout)
API key for authentication. If not provided, uses LANGSMITH_API_KEY environment variable.
Maximum number of retries for transient errors (502, 503, 504), rate limits (429), and connection failures. Set to 0 to disable retries. Default: 3.
Optional default headers attached to every request on this
client, including the data-plane /execute HTTP endpoint
and the /execute/ws WebSocket upgrade. Use this to pass
additional auth headers (e.g. X-Service-Key).