| Name | Type | Description |
|---|---|---|
name* | str | Sandbox name. |
port* | int | Port the service is listening on inside the sandbox. |
expires_in_seconds | int | Default: 600Token TTL in seconds (1--86400, default 600). |
access | Optional[ServiceAccess] | Default: None |
embed_origins | Optional[Sequence[str]] | Default: None |
headers | RequestHeaders | Default: None |
Get an authenticated URL for a service running inside a sandbox.
Returns a :class:ServiceURL whose properties auto-refresh the
token transparently before it expires. The object also provides
HTTP helper methods (.get, .post, etc.) that inject the
authentication header automatically.
Gate the URL behind LangSmith login instead of a token,
returning a :class:ServiceLoginURL. "restricted" admits
anyone with sandboxes:read on the sandbox, "workspace"
any member of the owning workspace. Neither carries a token or
expires, so expires_in_seconds does not apply. Omit for
token mode; a login grant is durable, so token mode is refused
with 409 while one is in place.
Origins whose pages may show the URL in an iframe,
besides LangSmith itself: at most 5, each https://host[:port]
(http only on localhost). In token mode they are signed
into each token, so every refresh keeps them; open
embed_url in the frame. With access they are stored on
the grant, and each call replaces the grant's list.
Optional per-request header overrides.