# endpoint_cache_identity

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/cold_cache/endpoint_cache_identity)

Return a stable identity for the endpoint that owns a prompt cache.

A missing endpoint means the provider's default API. Only scheme, host,
port, path and a digest of the query are significant; every other spelling
detail is normalized away, including host/scheme case, a trailing slash, a
default port, a trailing root dot, fragments, userinfo, and `;params`.
Path and query stay significant because proxies can route them to separate
backends; the query does so via `_opaque_digest`, which keeps a
credential-bearing query out of the checkpoint. Path case is preserved --
proxies may route on it -- which also means a credential embedded in a path
is recorded verbatim; see `_opaque_digest` for why that residual is
accepted.

The result is opaque: compare it for equality, never parse it.

## Signature

```python
endpoint_cache_identity(
    base_url: str | None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `base_url` | `str \| None` | Yes | Resolved provider endpoint, or `None` for its default API. |

## Returns

`str`

A checkpoint-safe endpoint identity.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/cold_cache.py#L429)