Metadata-Version: 2.4
Name: credit01
Version: 0.1.5
Summary: Official Python SDK for the 01credit platform — risk control, credit, and lifecycle management for AI agents performing on-chain actions
License: MIT
Project-URL: Homepage, https://01credit.xyz
Project-URL: Repository, https://github.com/01credit/sdk
Keywords: ai-agents,crypto,credit,risk-control,web3,01credit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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

# credit01 — 01credit Python SDK

Official Python SDK for 01credit.

## Install

```bash
pip install credit01
```

## Quickstart

```python
from credit01 import CreditClient

client = CreditClient(api_key="01l_live_xxx")
config = client.get_config()

decision = client.check(action="swap", amountUSD=250, venue="Uniswap V3")

if decision["result"] == "REVIEW":
    resolution = client.wait_for_approval(decision["checkId"])
    if resolution != "approved":
        raise SystemExit("Operator denied the action")
```

## Credit Flow

```python
approval = client.request_credit(amount=30, chain_id=11155111)
if approval["approved"]:
    draw = client.draw_credit(amount=30, chain_id=approval["chainId"])
    outstanding = client.get_outstanding(draw["loanId"])
    client.repay_credit(draw["loanId"], "0xrepay...")
```

## Methods

- `get_config()`
- `is_kill_switch_active()`
- `set_status(status)`
- `update_metrics(**kwargs)`
- `report_transaction(**kwargs)`
- `log(level, message, **kwargs)`
- `log_batch(entries)`
- `request_credit(amount, chain_id=None)`
- `draw_credit(amount, chain_id=None)`
- `get_outstanding(loan_id)`
- `repay_credit(loan_id, tx_hash)`
- `check(**context)`
- `resolve(log_id, resolved_by)`
- `get_approval_status(check_id)`
- `wait_for_approval(check_id, timeout=300, interval=5)`
