Grok Chat Application

A ChatGPT-like interface using xAI's Grok API.

Features

  • Real-time chat interface
  • Message history
  • Streaming responses
  • Clean, modern UI with TailwindCSS
  • Responsive design

Setup

  1. Set the environment variable XAI_API_KEY with your xAI API key
  2. Deploy the backend as an HTTP val
  3. Access the chat interface at the root URL

Project Structure

  • backend/index.ts - Main Hono server with API routes
  • frontend/index.html - Chat interface
  • frontend/app.js - Frontend JavaScript logic
  • frontend/style.css - Custom styles

API Endpoints

  • GET / - Serves the chat interface
  • POST /api/chat - Handles chat messages and returns Grok responses