AI Tool

H by Hatchable

An input→AI→result tool with history and a spend dashboard.

AI Tool

The wrapper around an AI model is always the same: take some input, send it to the model with the right system prompt, parse the response, show it cleanly, save it, and — if anyone's paying — watch what it costs. The model call is one line. Everything around it is the product, and it's the part that's tedious to get right every time.

This starter is that whole shell, working. It ships as a headline generator: type a description, pick one of five tones, and get five copy-ready headlines back. Under the hood it's a clean, reshapeable AI-tool skeleton — a public generate endpoint that calls ai.generateText with a tone-selected system prompt, response parsing, input validation, a honeypot for bots, and a 'recent generations' feed. Every call is saved with its cost.

Because it's built on Hatchable's AI layer, you don't pick a provider or hardcode a model: the owner pastes any supported key (Anthropic, OpenAI, Google) once in Setup, and the model alias tracks the current generation automatically. An admin-only dashboard wraps ai.usage() so you can see calls, spend, and a per-model/per-tone breakdown — gated to the project owner with no login to build.

To make it your own tool, edit one constant: the system prompt in api/generate.js. Five prompts become a cover-letter writer, an ad-copy generator, a code explainer, a recipe maker — anything input-to-output shaped. Copy & Launch it, change the prompt, and you've shipped an AI product with billing-grade observability already in place.

Features

Reshape by editing one prompt

The whole tool is defined by the system prompt in api/generate.js. Swap it and the headline generator becomes a cover-letter writer, ad-copy generator, code explainer, or recipe maker — anything input-to-output shaped.

Provider-agnostic by default

Built on ai.generateText with a model alias, not a hardcoded model. The owner pastes any supported key (Anthropic, OpenAI, Google) once in Setup, and the alias tracks the current model generation — no code change when a new one ships.

Spend dashboard included

An admin-only page wraps ai.usage(): calls, cost, input/output tokens, and a per-model and per-tone breakdown over 24h / 7d / 30d / month-to-date. You always know what the tool is costing.

Production-minded out of the box

Input validation, a hidden honeypot that drops bots, graceful handling of provider errors and truncated or refused responses, and every generation saved with its cost and source IP.

Public tool, private dashboard

The generate endpoint is public so anyone can use the tool (owner pays via their own key); the usage dashboard and full history are gated to the project owner — no separate login to build.

What you get

  • Source code, deployed to your account on Hatchable
  • Your own subdomain (or BYO custom domain on the Pro plan)
  • A real Postgres database, scoped to this app
  • The ability to make a copy, edit it, and redeploy via your AI tool
  • CSV export of your data, any time