---
title: "Generate a service access token"
method: POST
path: "/v2/sandboxes/boxes/{name}/service-url"
tags: ["sandboxes"]
---

# Generate a service access token

`POST /v2/sandboxes/boxes/{name}/service-url`

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.

## Path parameters

- `name` string, required

## Request body

- SandboxesServiceURLPayload
  - `expires_in_seconds` integer
  - `port` integer

## Response `200`

OK

- SandboxesServiceURLResponse
  - `browser_url` string
  - `expires_at` string
  - `service_url` string
  - `token` string

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `422` — Unprocessable Entity
- `500` — Internal Server Error
- `501` — Not Implemented

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
