Metadata-Version: 2.4
Name: certivu
Version: 2.1.0
Summary: Python SDK for Certivu — quantum-resistant trust infrastructure for AI-generated content
License: Proprietary
Project-URL: Homepage, https://certivu.ai
Project-URL: Documentation, https://docs.certivu.ai
Project-URL: API Reference, https://api.certivu.ai/docs
Keywords: certivu,ai,provenance,ml-dsa,dilithium,post-quantum,verification,watermark
Classifier: Development Status :: 5 - Production/Stable
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 :: Security :: Cryptography
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: signing
Requires-Dist: dilithium-py>=0.0.6; extra == "signing"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Requires-Dist: dilithium-py>=0.0.6; extra == "dev"

# certivu-python

Python SDK for [Certivu](https://certivu.ai) — quantum-resistant trust infrastructure for AI-generated content.

## Install

```bash
pip install certivu
```

## Quick start

```python
from certivu import CertivuClient

client = CertivuClient(
    api_key="ctv_key_abc123",
    generator_id="your-generator-uuid",
)

# Sign AI-generated content — images, audio, or text; format auto-detected
result = client.sign(content=image_bytes, model="stable-diffusion-xl")
# result.signed_content — bytes of the signed file (serve this, not the original)
# result.token         — ctv_ provenance token
# result.format        — 'image' | 'audio' | 'text'

# Sign audio or text explicitly
result = client.sign(content=pdf_bytes, model="gpt-4o", format="text")

# Verify — no API key needed, always free
result = client.verify(content=image_bytes)
if result.authentic and result.confidence == "high":
    print(result.provenance.org, result.provenance.signed_at)

# Verify without re-uploading the image
status = client.get_token_status("ctv_7f3kx9mq2...")

# Batch verify
results = client.verify_batch([
    {"content": image1_bytes},
    {"content": image2_bytes, "token": "ctv_..."},
])

# Audit log
page = client.get_audit_log(page=1, limit=50)
```

## Async

```python
from certivu import AsyncCertivuClient

async with AsyncCertivuClient(api_key="ctv_key_abc123") as client:
    result = await client.verify(content=image_bytes)
    results = await client.verify_batch([{"content": img} for img in images])
```

## Generator setup

1. Create a generator in the [dashboard](https://dashboard.certivu.ai) and select its supported formats (image, audio, text).

2. Copy the generator ID and your org API key.

3. Sign content — all cryptography (ML-DSA, watermarking, hashing) is handled server-side:
   ```python
   result = client.sign(
       content=file_bytes,
       model="stable-diffusion-xl",
       generator_id="gen_xyz",
   )
   output_file.write(result.signed_content)
   ```

## Confidence levels

| Confidence | Meaning |
|------------|---------|
| `high` | Watermark ✓ + Record ✓ + Signature ✓ — full chain intact |
| `medium` | Record ✓ + Signature ✓ — re-uploaded without watermark |
| `low` | Partial signals — something is off |
| `none` | Not signed by Certivu — no claim either way |

## Links

- [API Reference](https://api.certivu.ai/docs)
- [Documentation](https://docs.certivu.ai)
- [Pricing](https://certivu.ai/pricing)
