# treeship-sdk

Cryptographic attestations for AI agents.

## Installation

```bash
pip install treeship-sdk
```

## Quick Start

```python
from treeship import Treeship

# Initialize (uses TREESHIP_API_KEY and TREESHIP_AGENT env vars)
ts = Treeship()

# Create an attestation
result = ts.attest(
    action="Approved loan application #12345",
    inputs_hash=ts.hash({"customer_id": "cust_123", "amount": 50000})
)

print(f"Attestation: {result.attestation_id}")
print(f"Verify at: {result.url}")
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `TREESHIP_API_KEY` | Your API key (required for attest) |
| `TREESHIP_AGENT` | Default agent slug |
| `TREESHIP_API_URL` | API URL (default: https://api.treeship.dev) |

## Async Support

```python
from treeship import AsyncTreeship

async with AsyncTreeship() as ts:
    result = await ts.attest(
        action="Processed request",
        inputs_hash=ts.hash(request_data)
    )
```

## Verification

```python
# Verify an attestation
result = ts.verify("attestation-id-here")
print(f"Valid: {result['valid']}")
```

## Documentation

- [Full Documentation](https://docs.treeship.dev)
- [API Reference](https://docs.treeship.dev/api-reference)

## License

MIT
