• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jiushangx

jiushangx

gf

Public
Like
gf
Home
Code
3
backend
1
frontend
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

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
Code
backendfrontendREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.