Metadata-Version: 2.4
Name: titangpt
Version: 0.2.2
Summary: Official Python client for the TitanGPT API
Author-email: TitanGPT <info@titangpt.ru>
License-Expression: MIT
Project-URL: Homepage, https://titangpt.ru
Project-URL: Documentation, https://platform.titangpt.ru
Project-URL: Repository, https://github.com/TitanGPT/titangpt
Project-URL: Issues, https://github.com/TitanGPT/titangpt/issues
Keywords: titangpt,ai,llm,python-sdk,openai-compatible
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: httpx[http2]>=0.25.0
Requires-Dist: aiofiles>=23.0.0
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: twine>=6.1.0; extra == "dev"
Dynamic: license-file

# TitanGPT Python Client

[![PyPI version](https://badge.fury.io/py/titangpt.svg)](https://badge.fury.io/py/titangpt)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Official Python SDK for the TitanGPT API.

## Public API

The package includes:

- `chat.completions`
- `models.list`
- `files`
- `moderations`
- `threads`
- `usage`
- `audio.transcriptions`
- `music.youtube`
- `music.yandex`
- sync and async clients

`images` has been removed from the public SDK surface.

## Installation

```bash
pip install titangpt
```

Python 3.8+ is supported.

## Quick Start

### Sync Client

```python
from titangpt import TitanGPT

with TitanGPT(api_key="YOUR_API_KEY") as client:
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Explain quantum physics in one sentence."},
        ],
    )

    print(response.choices[0].message.content)
```

### Async Client

```python
import asyncio

from titangpt import AsyncTitanGPT


async def main():
    async with AsyncTitanGPT(api_key="YOUR_API_KEY") as client:
        response = await client.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": "Write a haiku about Python."}],
        )
        print(response.choices[0].message.content)


asyncio.run(main())
```

## Configuration

```python
client = TitanGPT(
    api_key="YOUR_API_KEY",
    base_url="https://api.titangpt.ru",
    timeout=60,
    max_retries=3,
    user_id="12345",
    product="api",
)
```

## Build

```bash
python -m build
python -m twine check dist/*
```

## Links

- Website: [titangpt.ru](https://titangpt.ru)
- Documentation: [platform.titangpt.ru](https://platform.titangpt.ru)
- API endpoint: `https://api.titangpt.ru`
- Telegram: [@titangpt_channel](https://t.me/titangpt_channel)

## License

MIT
