Type-safe APIs without codegen.

Define contracts once. Get clients, handlers, hooks, and docs.

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

const listTodos = contract({
  method: "GET",
  path: "/api/todos",
  query: z.object({ limit: z.number(), offset: z.number() }),
  response: z.object({
    todos: z.array(TodoSchema),
    total: z.number(),
  }),
});