The absolute minimum — join an X Space with an AI agent in ~15 lines of code.
-
Install dependencies:
npm install
-
Copy
.env.exampleto.envand fill in your credentials:cp .env.example .env
-
Run the agent:
npm start https://x.com/i/spaces/1eaKbrPAqbwKX
- Joins the specified X Space as a speaker
- Listens to other speakers via speech-to-text
- Responds using GPT-4o-mini with text-to-speech
- Prints all transcriptions and agent responses to the console
Edit index.ts to customize:
ai.model— Change the LLM modelai.systemPrompt— Change the agent's personalityai.provider— Switch to'claude'or'groq'