Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

KirbyRedius/KirbacterAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Typing SVG

This is the unofficial API




Installation

  pip install kirbacterai



Code example

import asyncio
from kirbacterai import Client

async def main():

    client = Client()

    await client.auth_as_guest()
    # You can use client.auth_with_token(token) instead

    link = "https://c.ai/c/0FGHpcylr6O0l46xHrTMzRGnqAU6beVz0k3i294wbUQ"

    character = await client.get_character_from_link(link)

    chat = await character.chat_create()

    character_reply = await chat.send_message("Hello!")

    print(character_reply)


asyncio.get_event_loop().run_until_complete(main())



Using an Access Token

❗ Some parts of the API, like managing a conversation requires for you to be logged in using an accessToken. To get it, you can open your browser, go to the character.ai website in localStorage.

— To do so:
❒ Open the Character AI website in your browser

❒ Open the developer tools F12 and go to the Application tab.

❒ Go to the Storage section and click on Local Storage.

❒ Look for the @@auth0spajs@@::dyD3gE281MqgISG7FuIXYhL2WEknqZzv::https://auth0.character.ai/::openid profile email offline_access key.

❒ Open the body and copy the access token.

image



Node.js version


Most of the stuff was taken from another JavaScript repository:




About

API for beta.character.ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages