Skip to main content

An unofficial API for Character AI for Python

Project description

Total Downloads MIT License Discord Stars

Welcome to the documentation for a synchronous/asynchronous unofficial library for CharacterAI using curl_cffi

⚠️ Warning

This version of the library is in alpha version, there may be bugs and errors. The library was developed without the participation of Character AI developers or their knowledge. To work with the library you need to know how to work with asyncio

🔥 Features

  • Supports logging in via email or as a guest

  • Does not use web browsers like: Pypeeter, Playwright, etc.

  • Supports uploading/downloading pictures

  • Has detailed documentation

  • Uses Pydantic

  • Asynchronous

📙 Simple Example

from characterai import aiocai
import asyncio

async def main():
    char = input('CHAR ID: ')

    client = aiocai.Client('TOKEN')

    me = await client.get_me()

    async with await client.connect() as chat:
        new, answer = await chat.new_chat(
            char, me.id
        )

        print(f'{answer.name}: {answer.text}')

        while True:
            text = input('YOU: ')

            message = await chat.send_message(
                char, new.chat_id, text
            )

            print(f'{message.name}: {message.text}')

asyncio.run(main())

👥 Community

If you have any questions about our library or would like to discuss CharacterAI, LLM, or Neural Networks topics, please visit our Discord channel

discord.gg/ZHJe3tXQkf

📝 TODO List

  • Character voice work

  • Community tab support

  • Add logging

  • Group chat support

  • Improved work with uploading pictures

💵 Support

TON - UQBlGz8aw5tWaocR8gPppQe6SgTx-kkh5keInKtEzVOqPhdY
BTC - bc1qghtyl43jd6xr66wwtrxkpe04sglqlwgcp04yl9
ETH - 0x1489B0DDCE07C029040331e4c66F5aA94D7B4d4e
USDT (TRC20) - TJpvALv9YiL2khFBb7xfWrUDpvL5nYFs8u

You can contact me via Telegram or Discord if you need help with parsing services or want to write a library. I can also create bots and userbots for Telegram

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

characterai-1.0.1.tar.gz (30.5 kB view details)

Uploaded Source

File details

Details for the file characterai-1.0.1.tar.gz.

File metadata

  • Download URL: characterai-1.0.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for characterai-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3e404fc4ec6281f8e67aad97cb6cacc1a4c2908d85ab30b28eea0f40d78b7b16
MD5 28e3172ba46d0d0720e6642b93be9381
BLAKE2b-256 17299730a6e43ca76342b95a25d6b656be7b2a862e0f413390e4f1c2636a711b

See more details on using hashes here.

Supported by

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