This library provides a simple way to interact with a GPT-based chat API. It allows you to create multiple chat instances and send messages to them.
To showcase the usage of this library, you can visit our demo page:
To use this library in your project, include the following script tag in your HTML file:
<script src="https://ciptik.github.io/free-api-gpt.js"></script>Here's a basic example of how to use the library:
(async () => {
const bot = await Bot.init();
const chat1 = await bot.createChat();
console.log(await chat1.sendMessage("Hello, first chat!"));
const chat2 = await bot.createChat();
console.log(await chat2.sendMessage("Привет, second chat!"));
const anotherBot = await Bot.init();
console.log(bot === anotherBot); // true
})();