---
title: "How-to guides · Zod plugin · Kubb"
description: "How-to guides for @kubb/plugin-zod, the Kubb Zod plugin. Each guide walks through one task."
canonical_url: "https://kubb.dev/extensions/kubb-labs/plugin-zod/guides"
meta:
  author: "Stijn Van Hulle"
  "og:description": "How-to guides for @kubb/plugin-zod, the Kubb Zod plugin. Each guide walks through one task."
  "og:image": "https://kubb.dev/_og/s/o_3e9c0e8d3c1f70da.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "How-to guides · Zod plugin · Kubb"
  "twitter:image": "https://kubb.dev/_og/s/o_3e9c0e8d3c1f70da.png"
---

> Index of every page on this site: [llms.txt](https://kubb.dev/llms.txt)

![Zod logo](https://kubb.dev/feature/zod.svg)

**Zod**

Officialv5.13.3

@kubb/plugin-zod

**$**kubb add plugin-zodkubb add plugin-zod

# **How-to guides**

5 guides

[**Coerce input with Zod**Set coercion to convert form data and query strings with z.coerce before Zod validates them, and see which format checks each key turns off.](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/coercion) [**Compile Zod schemas**Set compile to wrap generated schemas in z.compile(...) for faster validation, and see which schemas stay on the interpreter. Needs Zod 4.5 or later.](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/compiled-schemas) [**Customize generated schemas**Prefix inferred types, change Zod validators, and encode custom request types.](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/customization) [**Zod validators for OpenAPI formats**Look up the Zod v4 call Kubb writes for each OpenAPI type and format, such as z.uuid() for format: uuid, and the keywords that add a z.refine check.](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/format-mappings) [**Infer TypeScript types from Zod schemas**Set inferred to export a z.infer type next to each Zod schema, or z.input and z.output types for codecs, so you can skip @kubb/plugin-ts.](https://kubb.dev/extensions/kubb-labs/plugin-zod/guides/inferred-types)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://kubb.dev/#website","@type":"WebSite","description":"Kubb is an open source code generator that turns an API spec into TypeScript types, API clients, TanStack Query hooks, Zod schemas and mocks.","name":"Kubb","url":"https://kubb.dev/","publisher":{"@id":"https://kubb.dev/#identity"}},{"@id":"https://kubb.dev/extensions/kubb-labs/plugin-zod/guides#webpage","@type":"WebPage","description":"How-to guides for @kubb/plugin-zod, the Kubb Zod plugin. Each guide walks through one task.","name":"How-to guides · Zod plugin · Kubb","url":"https://kubb.dev/extensions/kubb-labs/plugin-zod/guides","isPartOf":{"@id":"https://kubb.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://kubb.dev/extensions/kubb-labs/plugin-zod/guides"]}],"primaryImageOfPage":{"@id":"https://kubb.dev/#logo"}},{"@id":"https://kubb.dev/#identity","@type":"Organization","description":"Kubb is an open source code generator. It turns an API spec, such as OpenAPI, into TypeScript types, API clients, TanStack Query hooks, Zod schemas and mocks.","email":"kubb@kubb.dev","name":"Kubb","url":"https://kubb.dev","founder":{"@id":"https://kubb.dev/#founder"},"logo":{"@id":"https://kubb.dev/#logo"},"sameAs":["https://github.com/kubb-labs/kubb","https://discord.gg/shfBFeczrm","https://www.linkedin.com/company/kubb-labs"]},{"@id":"https://kubb.dev/#logo","@type":"ImageObject","caption":"Kubb","contentUrl":"https://kubb.dev/logo.png","inLanguage":"en","url":"https://kubb.dev/logo.png"}]}
```

## Sitemap

See the full [sitemap](https://kubb.dev/sitemap.md) for all pages.
