Metadata-Version: 2.1
Name: klyuchora
Version: 0.1.0
Summary: Python SDK for the Klyuchora API gateway: chat, responses, embeddings, images, audio, models, key limits and account balance.
Home-page: https://klyuchora.ru/sdk
Author: Klyuchora
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# klyuchora (Python)

SDK for the Klyuchora API gateway. No dependencies, Python 3.8+.

    pip install https://klyuchora.ru/sdk/downloads/klyuchora-0.1.0-py3-none-any.whl

```python
from klyuchora import Klyuchora
client = Klyuchora()  # KLYUCHORA_API_KEY
r = client.chat.completions.create(model="gpt-4o-mini", messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)

for text in client.chat.completions.create(model="gpt-4o-mini", messages=[...], stream=True).text_deltas():
    print(text, end="")

print(client.models.ids())             # models your key can call
print(client.key.usage())              # key limits and spend
print(client.account.balance())        # needs KLYUCHORA_ACCESS_TOKEN
print(client.estimate_cost("gpt-4o-mini", input_tokens=1000, output_tokens=500))
```

Async: `AsyncKlyuchora`. CLI: `klyuchora models | price MODEL | usage | balance | keys | rate | chat MODEL "text"`.
Docs: https://klyuchora.ru/sdk. License: MIT.


