This project is a chat application that integrates Character.ai's unofficial API for generating AI responses and PlayHT for converting those responses into audio files. It is built using Node.js, HTML, CSS, and JavaScript.
- Real-time chat with AI using Character.ai
- Generate and play audio from AI responses using PlayHT
- Dark mode support
- Responsive design
Before you begin, ensure you have the following installed:
- Node.js (>= 14.x)
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/faizonly5953/chat-app-character-ai-playht.git cd chat-app-character-ai-playht
-
Install dependencies:
npm install
-
Set up your API keys:
-
Change The All API Key From
server.js
-
How To Get C.AI Token See This Python Docs : CLICK HERE
OR
Open the Character.AI website in your browser (https://old.character.ai) Open the developer tools (F12, Ctrl+Shift+I, or Cmd+J) Go to the
Application
tab Go to theStorage
section and click onLocal Storage
Look for thechar_token
key Open the object, right click on value and copy your session token.CHARACTER_AI_TOKEN=your_character_ai_token PLAYHT_API_KEY=your_playht_api_key PLAYHT_USER_ID=your_playht_user_id
-
-
Change Character ID
- In
server.js
inline 35
, change character id from Character Ai as You Likeconst characterId = "your_character_id";
-
Run the server:
npm start
The application will be running at
http://localhost:3000
.
-
Open the application in your browser:
Navigate to
http://localhost:3000
. -
Chat with the AI:
Type your messages in the input field and click "Send" or press "Enter" to send them.
-
Generate audio:
After receiving a response from the AI, a "Generate Audio" button will appear below the AI's message. Click this button to convert the response into an audio file.
-
Listen to the audio:
The audio file will be automatically appended below the chat box, where you can play it.
public/
- Contains static files such as HTML, CSS, and JavaScript.server.js
- The Node.js server file for handling chat and audio generation.index.html
- Interface Of the ChatAppstyles.css
- Styles for the chat application.scripts.js
- JavaScript for handling chat interactions and audio generation.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
- Connecting ChatApp with image generation (Stable Diffusion)
- Create a function where for every conversation, AI will generate an 'Emotion' image of its own face
- Make More Responsive WebUI
- Make A Detection Emotion for every audio conversation
- I Think create a deepfake so that AI from the image generation results, to combine audio and image generation, create an AI representation via Video source (but that is if I already have enough logic to make it 💀 )
- realcoloride for Unofficial API
- Character.ai
- PlayHT for their text-to-speech service.
- Node.js for the runtime environment.
- Socket.io for real-time communication.
- kramcat for Authorization
- Claude.Ai For Base Design
- ChatGPT For Base Code Generation