API Response → TypeScript / Zod / Prisma
Convert your API responses or OpenAPI/Swagger specifications into TypeScript types, Zod schemas, and Prisma models with a single click.
Settings
Input
paste an API response or OpenAPI specOutput
Generate models and they appear here.
About API Response → Models
Paste a raw API response, or an OpenAPI (v3) / Swagger document, and this tool infers a schema from it and generates TypeScript types, a Zod validation schema, and a Prisma model in one pass. Switch between the three with the output format control above.
Conversion flow
- Paste raw JSON, or toggle OpenAPI/Swagger input and paste a spec.
- The service parses the input and infers a schema from its shape.
- TypeScript types, a Zod schema, and a Prisma model are generated together.
TypeScript output
Given a nested API response:
{ "user": { "id": 1, "email": "test@example.com" } }the tool generates:
export interface User {
id: number;
email: string;
}
export interface Root {
user: User;
}Zod output
The same shape becomes a validation schema:
export const UserSchema = z.object({
id: z.number(),
email: z.string().email(),
});
export const RootSchema = z.object({
user: UserSchema,
});Prisma output
And a database model:
model User {
id Int @id @default(autoincrement())
email String @unique
}FAQ
What does "Detect ISO dates" do?
When enabled, string fields that look like ISO 8601 timestamps (for example created_at) are typed as dates instead of plain strings.
What does "Optionality" control?
Smart marks a field optional only when it's missing from some sample objects. All optional and all required force every field one way regardless of the samples.
Can I generate models from an OpenAPI spec instead of a JSON sample?
Yes. Enable OpenAPI/Swagger input and paste the spec — the generator reads the first schema in components.schemas, or the first example response, as the source shape.