A production-ready Hono + OpenAPI + Scalar starter template for Bun. Pre-wired for kitn AI agents.
bun create kitn-ai/hono my-app
cd my-app
cp .env.example .env # Add your OpenRouter API key
bun devOpen http://localhost:4000/docs for the interactive API documentation.
- Hono with zod-openapi for typed routes
- Scalar API docs at
/docs - OpenRouter AI provider with connection test at
POST /check - @t3-oss/env-core for type-safe environment variables
- kitn-ready stub — run
kitn initto add AI agents
| Method | Path | Description |
|---|---|---|
| GET | / |
Health check |
| GET | /hello/:name |
Sample OpenAPI route |
| POST | /check |
Test AI model connection |
| GET | /docs |
Scalar API documentation |
| GET | /openapi |
OpenAPI JSON spec |
| * | /api/* |
kitn AI routes (stub until kitn init) |
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
No | 4000 |
Server port |
NODE_ENV |
No | development |
Environment |
OPENROUTER_API_KEY |
Yes | — | Get one here |
DEFAULT_MODEL |
No | openai/gpt-4o-mini |
AI model for /check |
bun add -g @kitn/cli # Install the CLI
kitn init # Set up kitn in src/ai/Then replace src/ai.ts with:
export { ai } from "@kitn/plugin";Your AI routes are now live at /api/ai. Add agents with:
kitn add weather-agentbun dev # Start with hot reload
bun start # Start production server
bun run typecheck # TypeScript type checking