Ship analytics across your entire stack
Define metrics once in TypeScript. Reuse across APIs, jobs, dashboards, and AI agents. Authentication and multi-tenancy baked in.
One definition. Any context. Zero drift.
No YAML · No string-concatenated SQL · No duplicated metrics
Everything is code
From ClickHouse schema to governed APIs in minutes
A quick path from your ClickHouse schema to a typed, governed API without YAML, without SQL strings.
Scaffold new or drop into your existing codebase.
Define
Define type-safe queries with our ClickHouse-native query builder.
Consume
Run via our built-in server or embed in your backend, then consume across your stack.
import { initServe } from '@hypequery/serve';import { z } from 'zod';import { db } from './analytics/client';const { define, query } = initServe({ context: () => ({ db }),});export const api = define({ queries: { weeklyRevenue: query .describe('Weekly revenue totals') .input(z.object({ startDate: z.string() })) .query(({ ctx, input }) => ctx.db .table('orders') .where('created_at', 'gte', input.startDate) .groupBy(['week']) .sum('total', 'revenue') .execute() ), },});AI Agent
Callable by AI agent
Give agents governed, typed access to metrics without raw SQL.
const catalog = api.describe();const tools = new Set(catalog.queries.map((q) => q.key));const result = await api.run('weeklyRevenue', { request: { headers: { authorization: 'Bearer token' } },});HTTP
Expose via HTTP
Auto-generated endpoints with auth and OpenAPI baked in.
import { createFetchHandler } from '@hypequery/serve/adapters/fetch';api.route('/weekly-revenue', api.queries.weeklyRevenue);const handler = createFetchHandler(api.handler);React
Consume in React
Typed hooks and SDKs keep UI and metrics in sync.
import { createHooks } from '@hypequery/react';export const { useQuery } = createHooks<ApiDefinition>({ baseUrl: '/api/hypequery',});const { data } = useQuery('weeklyRevenue', { startDate: '2026-01-01' });In-Process
Run in process
Call metrics directly inside jobs, scripts, or services.
const latest = await api.run('activeUsers', { input: { limit: 25 }, request: { headers: { authorization: 'Bearer token' } },});Raw SQL breaks teams at scale
When every dashboard, service, and script ships its own SQL, metrics drift and trust disappears. The same definition should power every surface.
The old way
YAML. SQL strings.
- Query logic scattered across dashboards, scripts, and services.
- String‑concatenated SQL that drifts as schemas evolve.
- Metrics definitions duplicated and re‑implemented per team.
The hypequery way
Everything is code.
- Type‑safe metrics defined once in TypeScript.
- Reusable definitions power APIs, jobs, dashboards, and agents.
- Auth, multi‑tenancy, and caching stay consistent everywhere.
See it in action
Click through these examples to see how hypequery works across different use cases.
Backend & platform
Backend and platform engineers pull the same hypequery definition into cron jobs, queues, and HTTP handlers so every service agrees on revenue math.
Why orgs keep rebuilding this layer
ClickHouse teams that centralize semantics with hypequery stop firefighting mismatched dashboards because every consumer reuses the same governed module, so velocity goes into shipping metrics instead of reconciling them.
Without hypequery
- APIs, dashboards, and bots each reinvent metric logic.
- Tenant filters and auth patches drift per team.
- Analytics changes go through Slack debates, not code review.
With hypequery
- One TypeScript definition per metric, versioned and tested.
- Governed runtime injects auth, tenancy, caching everywhere.
- APIs, jobs, dashboards, and agents call the exact same endpoint.

An end-to-end platform for analytics development
Catch breaking schema changes before deploy
Your ClickHouse schema becomes a TypeScript SDK. Columns become types, tables become interfaces, so CI tells you when analytics logic drifts.
Run governed metrics everywhere, not just HTTP
Jobs, APIs, scripts, or agents import the exact same definition. HTTP is optional, your metrics travel to whatever surface needs them.
Metrics as first-class code citizens
Import definitions like any other module. The same query powers your API, dashboard, cron job, and agent without reimplementation.
Ship APIs with OpenAPI and authentication out of the box
Every query becomes an HTTP endpoint complete with validation and typed SDKs. No controllers, routing glue, or YAML hand wiring.
Bake tenant isolation into the platform
Declare tenant patterns once. The runtime auto-injects filters, validates auth, and guarantees isolation—making cross-tenant leaks impossible.
Ship-ready authentication, caching, and observability primitives
Verify sessions, inject user context, control access, and cache at the query level. You focus on metrics, the platform handles safety and insight.
Ship faster
Ship your first governed metric in 5 minutes
Point hypequery at your ClickHouse cluster and ship a governed metric in under five minutes. Teams use it to keep product analytics, finance APIs, and AI agents perfectly in sync.
Early adopter? DM us @hypequery — let's build this together.
