Connect
Connect LangSmith on Integrations, and CostGraph starts sandboxes in your LangSmith account. You don’t run anything yourself.- In CostGraph, go to Integrations > Sandbox > LangSmith.
-
Enter these fields:
- API key (
LANGSMITH_API_KEY, required): A LangSmith service key from Settings > API Keys. - Sandbox endpoint (
LANGSMITH_SANDBOX_ENDPOINT, optional): A different LangSmith sandbox address, if you do not use the default.
- API key (
- Click Connect.
Your own dispatcher
To keep the key out of CostGraph or reach a private network, run your own dispatcher instead. Setprovider to langsmith and the preceding fields as environment variables, as described in Run your own dispatcher.
To see what LangSmith costs, connect the LangSmith integration.
Key and permissions
LANGSMITH_API_KEY is a LangSmith API key, created in Settings > API Keys: a service key (scoped to specific workspaces or the full organization, recommended for services) or a personal access token (inherits its creator’s permissions). Workspace permissions sandboxes:create, sandboxes:read, sandboxes:delete (lifecycle) are needed; exec and file ops are allowed for the sandbox’s creator by default, so a single key that creates and execs needs no sandboxes:exec (other identities need sandboxes:exec). Use a service key scoped to the one workspace; Enterprise can assign a specific workspace role to a service key. Which built-in roles include these permissions is not documented. Sources: docs.langchain.com: sandbox permissions, docs.langchain.com: create account api key, docs.langchain.com: sandboxes, docs.langchain.com: sandbox sdk.Limits
- CPU 0.05 to 16 vCPU; memory up to 64 GiB within 50% of 4 GiB per vCPU; disk up to 16 GiB per vCPU for non-persistent sandboxes. (source)
- idle_ttl_seconds default 600 (10 minutes) stops the sandbox after inactivity (any command or file I/O resets it; 0 disables); stop discards filesystem writes on non-persistent sandboxes. delete_after_stop_seconds max 30 days. (source)
- Generally available on GCP US/EU/APAC, AWS US and BYOC; non-Enterprise orgs get restricted egress (allowlist) by default. (source)