# environ

Python API: `hubai_sdk.utils.environ`

Resolve HubAI connection settings and securely stored credentials.

## Classes

### Environ

HubAI settings loaded from environment variables and keyring.

#### Methods

##### validate_hubai_api_key

```python
def validate_hubai_api_key(self) -> Self:
```

Populate `HUBAI_API_KEY` from keyring when available.

#### Attributes

##### HUBAI_API_KEY

API key used to authenticate requests. A key stored by `hubai login` takes precedence over the environment variable.

##### HUBAI_URL

Base URL for HubAI services. Override this for staging or a self-hosted environment.

## Functions

### get_password_with_timeout

```python
def get_password_with_timeout(service_name: str, username: str, timeout: float = 5) -> str | None:
```

Read a keyring password with a timeout using multiprocessing.

### get_password_with_timeout_win

```python
def get_password_with_timeout_win(service_name: str, username: str, timeout: float = 5) -> str | None:
```

Read a keyring password with a timeout using a subprocess.

## Attributes

### environ
