LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
PythonlangsmithresourcessandboxesboxesAsyncBoxesResourcegenerate_service_url
Method●Since v0.14

generate_service_url

Copy
generate_service_url(
  self,
  name: str,
  *,
  access: Literal['restricted', 'workspace', 'off'
View source on GitHub
]
|
Omit
=
omit
,
expires_in_seconds
:
int
|
Omit
=
omit
,
port
:
int
|
Omit
=
omit
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
ServiceURLResponse

Parameters

NameTypeDescription
accessLiteral['restricted', 'workspace', 'off'] | Omit
Default:omit

Access selects the login mode, mutually exclusive with the minted token. Omit the field for token mode: mint a short-lived service token (default). "restricted" — LangSmith login: the sandbox's creator, or any user with SandboxesExec on it (admins by default). "workspace" — LangSmith login: any member of the owning workspace. "off" — remove an existing LangSmith login grant and mint a token. A LangSmith login grant is durable; token mode is refused (409) while one exists.

extra_headersHeaders | None
Default:None

Send extra headers

extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Create a short-lived JWT for accessing an HTTP service running on a specific port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw token, and its expiry. Set access=restricted|workspace to instead enable durable LangSmith login (no token; users authenticate with their normal LangSmith session), or access=off to disable it. LangSmith login and token access are mutually exclusive per service URL.

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds