Metadata-Version: 2.4
Name: kynth
Version: 0.1.0
Summary: Official Python SDK for Kynth Core — the AI back-end for your product.
Project-URL: Homepage, https://api.kynth.studio
Project-URL: Documentation, https://api.kynth.studio/docs
Project-URL: Source, https://github.com/kyisaiah47/kynth-os
Author: Kynth Studios
License: MIT
Keywords: ai,api,chargeback,contract,document-parsing,kynth,llm,ocr,pii
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# kynth

Official Python SDK for **[Kynth Core](https://api.kynth.studio)** — the AI back-end for your product. Parse documents, extract fields, redact PII, analyze contracts, fight chargebacks, and enrich companies.

```bash
pip install kynth
```

## Quickstart

```python
from kynth import Kynth

client = Kynth(api_key="ksk_live_...")

doc = client.parse(file_url="https://.../invoice.pdf")
print(doc["totalAmount"])              # 4820.5
print(doc["usage"]["balanceRemaining"])  # 490
```

Get a key (and 500 free credits) at **[api.kynth.studio](https://api.kynth.studio)**. Zero dependencies — stdlib only, Python 3.8+.

## Methods

Every method returns the endpoint result as a dict, including a `usage` envelope. A non-2xx response raises a typed `KynthError` (and never burns credits).

```python
client.parse(file_url=...)                                  # documents → JSON
client.extract(text=..., fields=["order", "total"])         # pull named fields
client.classify(text=..., labels=["billing", "tech"])       # label text
client.summarize(text=..., length="standard")               # summary + actions
client.redact(text=...)                                      # strip PII/PHI
client.sentiment(text=..., aspects=["product"])             # sentiment + aspects
client.contract(file_url=...)                               # contract → terms + risks
client.chargeback(reason=..., transaction={"amount": 129})  # representment packet
client.enrich(email="sam@stripe.com")                       # company profile
client.account()                                            # balance
```

## Error handling

```python
from kynth import Kynth, KynthError

client = Kynth(api_key="ksk_live_...")
try:
    client.parse(file_url="https://.../invoice.pdf")
except KynthError as err:
    # err.code: "insufficient_credits" | "rate_limited" | "unauthorized" | ...
    print(err.code, err.status, err.message)
```

MIT © Kynth Studios
