# client.whoami

> The whoami methods of the morevoice Python SDK: The API key making the request.

The API key making the request. These methods are on `client.whoami`, where `client` is a `MoreVoice` client (see [the Python SDK](https://docs.morevoice.ai/sdk/python/#connect)). On `AsyncMoreVoice` the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.

## `retrieve()`

**Retrieve the caller.** Returns the organisation, key, mode, scopes and API version of the key that authenticated the request.

```python
# client.whoami
def retrieve(self, *, more_voice_version: str | Unset = UNSET) -> _m.ApiKeyPrincipal
```

`client.whoami.retrieve()` · `await async_client.whoami.retrieve()` · `GET /whoami` · [API reference](https://docs.morevoice.ai/api/operations/whoami_retrieve/)

### Returns

`ApiKeyPrincipal`:

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"api_key_principal"` | Always `api_key_principal`. |
| `org_id` | `string` | The organisation the key belongs to (`org_…`). |
| `key_id` | `string \| null` | The API key (`key_…`); null for OAuth app tokens. |
| `livemode` | `boolean` | false for test-mode keys (`mv_test_…`). |
| `scopes` | `string[]` | The scopes granted to the key; ["*"] means every scope. |
| `api_version` | `string` | The API version this request was answered in (MoreVoice-Version header, else the key's pinned version). |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

api_key_principal = client.whoami.retrieve()
print(api_key_principal)
```
