Metadata-Version: 2.4
Name: sarovi-sdk
Version: 0.1.0
Summary: Sarovi Python API client (preview)
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Sarovi Python SDK — 0.1.0 preview

Download the archive from Sarovi's SDK guide and run `pip install ./sarovi_sdk-0.1.0.tar.gz`. This package has not been published to PyPI. Python 3.10+ is required; runtime uses the standard library.

```python
from sarovi import Sarovi
with Sarovi() as client:  # reads SAROVI_API_KEY
    response = client.responses.create(
        model="z-ai/glm-5.3-flash", input="Hello", max_output_tokens=512,
    )
    print(response["output_text"])
```

This is a synchronous preview. `responses.stream(...)` yields SSE dictionaries and raises on errors or early EOF. Keep the client inside a `with` block; when stopping a stream early, call its generator's `close()` or close the client to close open connections.

`models.list`, `studio.image/audio/text/video`, `studio.video_status/video_content`, `work.create/retrieve/wait/cancel/files`, `agents.list/create/run`, `files.retrieve`, `balance` and `usage` wrap the documented endpoints. Creation methods accept keyword fields. Video status/content accept `id` and `providerJobId` from the original job. Downloads return bytes. `work.wait` reads the same job and stops on terminal, review or user/budget intervention states; inspect the returned job. Poll timeout does not cancel the job.

Pass `idempotency_key` and `timeout` as request options. Paid operations are never automatically retried. Preserve the same idempotency key when intentionally retrying one operation; check the request receipt after uncertain connection failures. `SaroviError` exposes `status`, `code`, `request_id`, and `retry_after`. Keep API keys on the server. No redirects are followed with credentials.

Run checks from this folder: `PYTHONPATH=. python -m unittest discover -s tests`. Fixtures do not call providers or spend credits. The preview has not been certified against every model or production workload.
