Metadata-Version: 2.4
Name: spendlease
Version: 0.2.0b1
Summary: Thin Python helpers for the spendlease spend authorization gateway
Author: spendlease contributors
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/premhiru/spendlease
Project-URL: Documentation, https://premhiru.github.io/spendlease/
Project-URL: Changelog, https://github.com/premhiru/spendlease/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/premhiru/spendlease/issues
Keywords: ai,agents,spend,budget,gateway
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# spendlease Python SDK

Thin, dependency-free configuration helpers for vendor SDKs and the
spendlease admin surface. The package does not wrap model APIs; it gives the
official OpenAI and Anthropic clients the correct gateway URL and lease token.

Install the beta from PyPI after its release, or from a checkout:

```bash
python -m pip install 'spendlease==0.2.0b1'
# From a checkout instead:
python -m pip install ./sdk/python openai
```

Set `SPENDLEASE_LEASE_TOKEN` to an `sll_` token issued by the gateway.
`SPENDLEASE_URL` is optional and defaults to `http://localhost:4000`.

```python
from openai import OpenAI
from spendlease import Lease

lease = Lease.from_env()
client = OpenAI(**lease.openai_kwargs())
```

`AdminClient` manages runs and leases, reports effective remaining budget,
and verifies or exports the ledger through the guarded `/api/v1` operator API.

See the [examples](../../examples/) and
[getting-started guide](https://premhiru.github.io/spendlease/getting-started/)
for the complete gateway setup.
