Official Python client for the TitanGPT API
Project description
TitanGPT Python Client
Official Python SDK for the TitanGPT API.
Public API
The package includes:
chat.completionsmodels.listfilesmoderationsthreadsusageaudio.transcriptionsmusic.youtubemusic.yandex- sync and async clients
images has been removed from the public SDK surface.
Installation
pip install titangpt
Python 3.8+ is supported.
Quick Start
Sync Client
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
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
client = TitanGPT(
api_key="YOUR_API_KEY",
base_url="https://api.titangpt.ru",
timeout=60,
max_retries=3,
user_id="12345",
product="api",
)
Build
python -m build
python -m twine check dist/*
Links
- Website: titangpt.ru
- Documentation: platform.titangpt.ru
- API endpoint:
https://api.titangpt.ru - Telegram: @titangpt_channel
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
titangpt-0.2.2.tar.gz
(11.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
titangpt-0.2.2-py3-none-any.whl
(14.1 kB
view details)
File details
Details for the file titangpt-0.2.2.tar.gz.
File metadata
- Download URL: titangpt-0.2.2.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ff020884255972df0e63e2811382607b61123a10116de618d614d333f131ebb
|
|
| MD5 |
150d2fcf844e6af883d34839ebf808a8
|
|
| BLAKE2b-256 |
e0c92195a42b5da390feeb9cddb7b8fb066b7175f6fb1af47deddc8b5e6ce692
|
File details
Details for the file titangpt-0.2.2-py3-none-any.whl.
File metadata
- Download URL: titangpt-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58ab9f026935f17d05f49b47f2ac3d98e3bf134326ad8db9a13bce411189d504
|
|
| MD5 |
c0e5f7eb05ce75438de8231c0b9ccfb1
|
|
| BLAKE2b-256 |
fc7fc986fa2db80036c0dfb8680e5a5ecdd375aff4ae4b7b1a2f994b096fb09b
|