Contract Kit

Define your API contract once. Get type-safe servers, typed clients, and runtime validation — no codegen.

import { createContractGroup } from "contract-kit";
import { z } from "zod";

const todos = createContractGroup().namespace("todos");

export const getTodo = todos
  .get("/api/todos/:id")
  .path(z.object({ id: z.string() }))
  .response(200, z.object({
    id: z.string(),
    title: z.string(),
    completed: z.boolean(),
  }));

Contract Kit is a contract-first TypeScript framework. You define a contract — the shape of an HTTP endpoint — and reuse it across your server, client, and validation layer. Everything stays in sync through TypeScript inference. No build step, no code generation.

Get started

Contract Kit is pre-1.0. APIs may change between releases.