API Reference
Every function, schema and plugin kizuna exports, with its options and types.
Declaring an API
The pieces one API is built from, in the order a config usually meets them.
The authoring surface, typed by the Config that kizuna generate writes.
Assemble the routes, identities and plugins into the api you mount.
One route and the handler that answers it.
A group of routes under one tag.
The tags that group routes in the tree and the OpenAPI document.
Name a Zod schema so every client generates a named type.
Typed request-scoped values, such as a logger or the caller's locale.
A validation issue with a code your config declares.
Scheduled jobs, with their inputs and results.
Security
Who may call a route, and what they are allowed to do.
A kind of caller, the guard that authenticates it, and the context it provides.
The roles callers hold.
Every permission, for roles to hold and routes to require.
The RFC 9728 discovery document and its WWW-Authenticate challenge.
Calling an API
The TypeScript client and the guards that narrow its errors.
A typed fetch client from the file kizuna generate writes.
TanStack Query options from that client.
Tell a kizuna validation error from your own 400.
Catch a status the route does not declare.
Schemas
The Zod schemas kizuna ships for bodies every API shares.
The RFC 9457 body every error response carries.
Binary response bodies and multipart upload fields.
Generators and plugins
What kizuna writes and serves from your routes.
An OpenAPI 3.1.0 document.
Serve that document and a reference UI on any adapter.
A Swift client on URLSession and Codable.
A Kotlin client on OkHttp, kotlinx.serialization and coroutines.
An MCP endpoint that publishes your tool routes.
A bare MCP server for stdio or any other transport.