> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sutro.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Configure a Sutro deployment URL and API key.

# Authentication

Create a deployment key in the Sutro app under **API Keys**. Keys are scoped to
one deployment.

```bash theme={null}
export SUTRO_API_URL="https://your-sutro-deployment.example.com"
export SUTRO_API_KEY="sk_..."
```

`SUTRO_API_URL` accepts the deployment origin with or without `/v1`.

To store both values in `~/.sutro/config.json` instead:

```bash theme={null}
sutro login
```

The SDK resolves credentials in this order:

1. Explicit `Sutro(api_url=..., api_key=...)` values or setters
2. `SUTRO_API_URL` and `SUTRO_API_KEY`
3. Values saved by `sutro login`

You can also update the shared client at runtime:

```python theme={null}
import sutro as so

so.set_api_url("https://your-sutro-deployment.example.com")
so.set_api_key("sk_...")
```

A partial environment pair never borrows its missing value from saved
configuration. Changing the deployment URL clears the current key so it cannot
be sent to another deployment.

Direct API calls use the same key:

```http theme={null}
Authorization: Key sk_...
```
