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

# Python

> Learn more about using Oneloop Python SDK

[Link to PYPI package](https://pypi.org/project/oneloop-python/)

## Installation

```bash bash theme={null}
pip3 install oneloop-python
```

## Authentication

```python theme={null}
from oneloop_client.client import OneloopApi

# Initialize the SDK client

oneloop_client = OneloopApi(token="your-oneloop-api-key")
```

## Verify API Keys

When your user calls your endpoints and you need to verify their API Key then you use the following:

```python theme={null}
from oneloop_client.types import VerifyApiKeyResponse

# Verify the API key
verify_response: VerifyApiKeyResponse = None
try:
    verify_response = oneloop_client.verify_api_key(
      key="<API_KEY>", # The Api Key that was generated for the user (either through the SDK or dashboard)
      requested_scopes=[
        {
            "id": "balance_transfer", # The requested scope
            "representation": "balance_transfer",
            "read": False,
            "create": True, # Allow creation
            "update": False,
            "del": False
        }
    ])
except Exception as e:
    error: ErrorResponse = json.loads(e.body)
    code = error['error']['code']
    message = error['error']['message']
    raise HTTPException(status_code=code, detail=message)

if verify_response and verify_response.status != "VALID":
    raise HTTPException(status_code=401, detail=verify_response.status)
```
