Metadata-Version: 2.2
Name: projectblock
Version: 0.2.0
Summary: AI usage metering & EU AI Act-ready audit trails — 3 lines of code.
Author-email: Saad Kaicar <robertkiller23@gmail.com>
License: MIT
Project-URL: Homepage, https://project-block.com
Project-URL: Documentation, https://api.project-block.com/docs
Project-URL: Repository, https://github.com/Artkill24/projectblock
Keywords: ai,llm,metering,audit,compliance,eu-ai-act,openai,anthropic
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.2.0; extra == "langchain"

# ProjectBlock

AI usage metering & EU AI Act-ready audit trails. The infrastructure layer between your app and your LLM — 3 lines of code.

## Install

```bash
pip install projectblock
```

## Quickstart

```python
import os
os.environ["PROJECTBLOCK_API_KEY"] = "pb_your_key_here"

from projectblock import gate, record

# 1. Check budget before calling your LLM
await gate("user_123", budget_usd=5.00)

# 2. Call your LLM as usual
response = await openai.chat.completions.create(model="gpt-4o", messages=messages)

# 3. Meter + audit in one call
await record(
    "user_123",
    model="gpt-4o",
    cost_usd=0.0023,
    tokens_input=response.usage.prompt_tokens,
    tokens_output=response.usage.completion_tokens,
)
```

`gate()` fails open by default — if ProjectBlock is unreachable, your app keeps working.

## Get an API key

Sign up at [project-block.com](https://project-block.com).

## Docs

Full API reference: [api.project-block.com/docs](https://api.project-block.com/docs)
