Skip to main content

Async Python wrapper for the chataibot.pro web app

Project description

ChatAIBotPro-API

Unofficial async Python client for chataibot.pro.

Disclaimer: This library reverse-engineers the chataibot.pro browser API. It is not affiliated with or endorsed by chataibot.pro.

Installation

pip install chataibotpro-webapi

Authentication

Get your JWT token from the token cookie after logging in at chataibot.pro.

import asyncio
from chataibotpro_webapi import ChatAIBotProClient

async def main():
    async with ChatAIBotProClient("YOUR_JWT_TOKEN") as client:
        async for chunk in client.stream_message("Hello!"):
            print(chunk.delta, end="", flush=True)
        print()

asyncio.run(main())

Usage

Single-turn (non-streaming)

r = await client.send_message("What is the capital of Poland?")
print(r.text)

Streaming

async for chunk in client.stream_message("Write me a haiku."):
    print(chunk.delta, end="", flush=True)
print()

Multi-turn session

chat = client.start_chat()
r1 = await chat.send("My name is Alice.")
r2 = await chat.send("What is my name?")
print(r2.text)  # "Your name is Alice."

# Streaming within a session
async for chunk in chat.stream("Tell me a story."):
    print(chunk.delta, end="", flush=True)

Image generation

from chataibotpro_webapi import ImageModel

img = await client.generate_image(
    "A golden sunset over Warsaw, oil painting",
    model=ImageModel.FLUX_PRO,
)
await img.save("./outputs")

Video generation

from chataibotpro_webapi import VideoModel

video = await client.generate_video(
    "A drone shot flying over Warsaw at sunset",
    model=VideoModel.KLING_2_6_PRO,
    duration="5",
)
await video.save("./outputs")

# Image to video
video2 = await client.image_to_video(
    "https://example.com/frame.jpg",
    prompt="Camera slowly pans left",
)

Gallery

images = await client.get_image_gallery()
videos = await client.get_video_gallery()

for item in images:
    await item.save("./gallery")

File upload

rec = await client.upload_file("report.pdf")
r   = await client.send_message("Summarise this document.")

Token estimation

usage = await client.calculate_tokens("Write me an essay", model="gpt-4.1-nano")
print(usage.token_count, usage.credit_cost)

Pricing

prices = await client.get_subscription_prices()
tariff = await client.get_subscription_tariff()

User info

user = await client.get_current_user()
print(user.email, user.plan)

stats = await client.get_answers_count()

API Reference

Method Description
stream_message(text, ...) Stream a chat response
send_message(text, ...) Send message, collect full response
start_chat(model, ...) Create a ChatSession
create_context(title, model) Create server-side chat thread
get_context(chat_id) Fetch chat metadata
calculate_tokens(text, ...) Estimate token cost
change_context_model(chat_id, model) Change model for a chat
get_chat_messages(chat_id) Fetch message history
generate_image(prompt, model, ...) Generate image
generate_video(prompt, model, ...) Generate video
image_to_video(image_url, prompt, ...) Animate image to video
get_gallery(...) Fetch media gallery
get_image_gallery(...) Images only
get_video_gallery(...) Videos only
upload_file(file_path, ...) Upload & parse file
get_current_user() Fetch user profile
get_answers_count() Fetch usage stats
get_subscription_prices(...) Fetch pricing
get_subscription_tariff(...) Fetch tariff details
get_telegram_link(...) Get Telegram deep-link
landing_hello() Ping / landing data
logout() Invalidate server session

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chataibotpro_webapi-1.0.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chataibotpro_webapi-1.0.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file chataibotpro_webapi-1.0.0.tar.gz.

File metadata

  • Download URL: chataibotpro_webapi-1.0.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chataibotpro_webapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 80710af0f97221da0e90e115c75924fee99e161bb97dbee01de67179ac2bc9fc
MD5 888bcd4206e625446fdb08795954ce1b
BLAKE2b-256 80238636874d39e095725998374e33d04897fe3c6216ca3996b78f9ade4c9c4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for chataibotpro_webapi-1.0.0.tar.gz:

Publisher: python-publish.yml on cyber-wojtek/ChatAIBotPro-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chataibotpro_webapi-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chataibotpro_webapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5837b0218eca2f87c321fe088d36a63a74de46476566034ad7310fc1f17bca
MD5 46eab9c64c0c20c24858482fa46189e2
BLAKE2b-256 ab539c012d17b889303591ff7c45f9b5abccccc2e939e0faa44f28f6e2ed10e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for chataibotpro_webapi-1.0.0-py3-none-any.whl:

Publisher: python-publish.yml on cyber-wojtek/ChatAIBotPro-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page