# get_default_base_url_env

> **Function** in `deepagents_code`

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

Return the env var that supplies a provider's endpoint when none is stored.

Answers "what does leaving the `/auth` base-URL field blank fall back to?"
A blank save clears the *plain* endpoint env vars (so an inherited gateway
URL can't leak through — see `apply_stored_credentials`), so the only env
var that still supplies a value afterward is the `DEEPAGENTS_CODE_`-prefixed
one. The name is returned (not its value) for display next to the field, so
the user sees the knob rather than a long or sensitive URL.

Returns `None` when that variable holds no value — the endpoint then comes
from a `config.toml` literal or the provider SDK's own default, neither of
which is a single env var to name here.

## Signature

```python
get_default_base_url_env(
    provider: str,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `provider` | `str` | Yes | Provider name. |

## Returns

`str | None`

The `DEEPAGENTS_CODE_`-prefixed env var name still in effect after a

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e14e0adcbe78565ed3650e7f24b2a775d5437d25/libs/code/deepagents_code/model_config.py#L2170)