Public
OpenRouter OpenMic joke battle.
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.
A comedy roast eval: 10 LLMs each tell one joke. You rate them 1–10. Highest score wins.
Models are called via OpenRouter; each gets a distinct ElevenLabs voice for delivery. Falls back to canned jokes and the browser's Web Speech API when keys aren't configured.
Rendering mermaid diagram...
| File | Purpose |
|---|---|
main.tsx | Hono server, routes, OpenRouter + ElevenLabs proxies |
shared/models.ts | MODELS lineup, PROMPT, FAKE_JOKES, cleanJoke — shared between server and (via /api/lineup) client |
frontend/index.html | Stage scaffold |
frontend/script.ts | Client logic — fetches lineup, prepares show, plays audio, scores |
frontend/style.css | Theme |
| Var | Effect when missing |
|---|---|
OPENROUTER_API_KEY | Falls back to canned jokes from FAKE_JOKES |
ELEVENLABS_API_KEY (or XI_API_KEY) | Falls back to browser TTS via SpeechSynthesisUtterance |
- Test mode (default): canned jokes, no API calls to OpenRouter.
- Live mode: toggle the "live jokes" checkbox in the UI, or append
?live=1. Hits OpenRouter for real model jokes.
| Method | Path | Returns |
|---|---|---|
| GET | / | The stage UI |
| GET | /frontend/* | Static assets (CSS, transpiled TS) |
| GET | /source | Redirect to this val's source on Val Town |
| GET | /api/lineup | { prompt, models } |
| POST | /api/joke | { joke, mode, model } |
| POST | /api/audio | audio/mpeg stream (or JSON error with browserVoiceFallback) |
Click "view source" in the bottom-right of the live page, or fork from Val Town directly.