# ServiceURL

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL)

Authenticated URL for accessing an HTTP service running in a sandbox.

Properties auto-refresh the token transparently when it nears expiry.
HTTP helper methods (``.get``, ``.post``, etc.) inject the auth header
automatically.

When constructed by :meth:`SandboxClient.service` or
:meth:`Sandbox.service`, the object holds an internal refresher that
re-calls the API to obtain a fresh token before the current one expires.

Example::

    svc = sb.service(port=3000)

    resp = svc.get("/api/data")  # token injected + auto-refreshed
    print(svc.browser_url)  # always-fresh URL

## Signature

```python
ServiceURL(
    self,
    browser_url: str,
    service_url: str,
    token: str,
    expires_at: str,
    *,
    _refresher: Optional[Callable[[], ServiceURL]] = None,
)
```

## Constructors

```python
__init__(
    self,
    browser_url: str,
    service_url: str,
    token: str,
    expires_at: str,
    *,
    _refresher: Optional[Callable[[], ServiceURL]] = None,
) -> None
```

| Name | Type |
|------|------|
| `browser_url` | `str` |
| `service_url` | `str` |
| `token` | `str` |
| `expires_at` | `str` |
| `_refresher` | `Optional[Callable[[], ServiceURL]]` |


## Properties

- `token`
- `service_url`
- `browser_url`
- `expires_at`

## Methods

- [`request()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/request)
- [`get()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/get)
- [`post()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/post)
- [`put()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/put)
- [`patch()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/patch)
- [`delete()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/delete)
- [`from_dict()`](https://reference.langchain.com/python/langsmith/sandbox/_models/ServiceURL/from_dict)

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/70260f8db5b02e286a22f9524fba283a2513859a/python/langsmith/sandbox/_models.py#L127)