Metadata-Version: 2.4
Name: qosmos-sdk
Version: 0.4.2
Summary: Python SDK for Qosmos entropy-as-a-service
Author: Qnu Labs
License: MIT
Project-URL: Homepage, https://qosmos.qnulabs.com
Keywords: qosmos,entropy,qrng,random,sdk
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# qosmos-sdk

Python SDK for Qosmos entropy-as-a-service.

```python
from qosmos_sdk import QosmosClient

client = QosmosClient()
entropy = client.random_hex(4)
print(entropy["value"])
```

The client reads `QOSMOS_KEY_ID`, `QOSMOS_API_SECRET`, `QOSMOS_ENV` and
`QOSMOS_BASE_URL` by default.

**There is no `QOSMOS_API_KEY`.** Qosmos replaced single long-lived API keys
with a **pair**: a public key id (`qk_...`) sent as `x-api-key` on every
request, and a secret (`qs_...`) presented only to `POST /v1/auth/token` in
exchange for a short-lived access token. The SDK does that exchange, caches the
token and renews it for you; the secret never travels on an entropy request.
Keys issued before the change stopped working and must be reissued from the
dashboard.

## Lengths

The count is **raw bytes** for every format, including base64 and bin. The
StreamLine endpoints accept one shared set of byte lengths:

```
4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
```

Anything else needs a dynamic method, which accepts any positive byte count but draws on
your plan's daily dynamic quota.
