---
title: "Generate docs and clients from the · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/contracts-and-docs/generated-docs
updated: 2026-10-20
licence: "All rights reserved"
---

# Generate docs and clients from the contract

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Contracts and docs](https://agentwranglers.se/playbook/api-design/contracts-and-docs)
- Rule: Build the reference docs from the OpenAPI file, not by hand. Generating SDKs from it too is optional.
- How: Publish the docs with a renderer, such as Redoc or Scalar. Generate clients with a tool such as OpenAPI Generator. Serve the raw OpenAPI file too, so agents can read it.
- Check: The published docs show the same version number as the OpenAPI file in the latest release. Where you ship an SDK, the build regenerates it and fails when the committed copy differs.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/contracts-and-docs/generated-docs`.

- Previous: [Give every endpoint an example](https://agentwranglers.se/playbook/api-design/contracts-and-docs/examples)
- Next: [Make the API easy for agents to find](https://agentwranglers.se/playbook/api-design/contracts-and-docs/agent-discovery)
- [Contracts and docs](https://agentwranglers.se/playbook/api-design/contracts-and-docs)
