Metadata-Version: 2.4
Name: claritty-sdk
Version: 2.0.0
Summary: Official SDK for building apps on the Claritty Platform
Author: Claritty Platform
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx<1.0.0,>=0.26.0
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: PyYAML<7.0,>=6.0

# claritty-sdk

Official Python SDK for building apps on the [Claritty Platform](https://claritty.ai).

Generated apps deployed on Claritty automatically get a `CLARITTY_PLATFORM_URL`
and `CLARITTY_AUTH_TOKEN` injected at runtime. The SDK reads those env vars and
routes all LLM calls through the platform proxy — metering them against the app
owner's plan, supporting BYOK (bring-your-own-key) when configured.

## Installation

```bash
pip install claritty-sdk
```

## Quick start

```python
from claritty_sdk.llm import get_llm_client

client = get_llm_client("claude-sonnet-4-6")
result = client.chat([{"role": "user", "content": "Explain quantum computing"}])
print(result.content)
```

Streaming:

```python
for delta in client.chat_stream(messages=[
    {"role": "user", "content": "Write me a haiku about kubernetes"}
]):
    print(delta, end="", flush=True)
```

## Wire format

The proxy speaks OpenAI Chat Completions, so you can also point the official
`openai` Python package at `${CLARITTY_PLATFORM_URL}/api/v1` if you want a
drop-in replacement. The surface here just gives you sensible Python defaults
(env-var auto-config, dict messages, generator-based streaming).

## License

MIT
