The key was committed to three backends behind `|| DEFAULT_KEY` fallbacks, which also meant a misconfigured deploy silently billed the bundled key instead of failing. It is now read from the environment only: /api/ask answers 503 and /api/status reports hasKey:false when it is absent. hasKey was unreachable-false as well, via `|| true` in the Pages function and `|| DEFAULT_KEY` in the worker, so it could never signal a missing key. All responses now go through a shared json() helper, so error paths carry the same CORS headers and content type as success paths, and wrangler.json declares the ASSETS binding the worker's static fallback already referenced.
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
# jev8ball
|
|
|
|
a minimalist Magic 8-Ball oracle powered by TypeSafe Jev structured decision intelligence on OpenRouter.
|
|
|
|
## features
|
|
|
|
- minimal dark brutalist interface with ambient floating particles
|
|
- 3D interactive floating icosahedron die inside fluid viewport with mouse parallax
|
|
- realistic shake & liquid surfacing animations with procedural audio chimes
|
|
- powered by non-autoregressive `typesafe/jev-1.13` decisions API (calibrated `noul` probabilities, structured sentiment, zero hallucination)
|
|
- live decision telemetry: calibrated probability, confidence score, token cost, and latency
|
|
- query history log with instant clipboard copy
|
|
- fast sub-second responses (~300ms) with lightweight token footprint
|
|
|
|
## usage
|
|
|
|
```bash
|
|
# install dependencies
|
|
npm install
|
|
|
|
# start server
|
|
npm start
|
|
```
|
|
|
|
Runs by default on `http://localhost:3000`.
|
|
|
|
## configuration
|
|
|
|
Configure your OpenRouter API key in `.env`:
|
|
```env
|
|
PORT=3000
|
|
OPENROUTER_API_KEY=sk-or-v1-...
|
|
```
|
|
|
|
The key is **required** — there is no bundled fallback. Without it `POST /api/ask`
|
|
answers `503` and `GET /api/status` reports `"hasKey": false`. For Cloudflare, store
|
|
it as a secret instead of a plain variable:
|
|
|
|
```bash
|
|
wrangler secret put OPENROUTER_API_KEY
|
|
```
|
|
|
|
## endpoints
|
|
|
|
- `GET /api/status` - model status and whether the API key is configured
|
|
- `POST /api/ask` - submit query to Jev decisions pipeline
|
|
|
|
## tests
|
|
|
|
```bash
|
|
npm test
|
|
```
|
|
|
|
## license
|
|
|
|
MIT
|