Skip to main content
1

Install

Requires Payload ^3.53.0 and Node.js 20 or later.
2

Add the plugin

Add openapi() for the spec and scalar() for the docs UI:
payload.config.ts
metadata.title and metadata.version are required. The plugin throws on boot if either is missing.
3

Open the docs

Two endpoints are now live:
  • GET /api/openapi.json — the generated OpenAPI document
  • GET /api/docs — interactive API reference (Scalar)
Both are mounted under your Payload API route (routes.api, /api by default), since the plugin registers them as Payload endpoints. The path and specEndpoint options you pass are relative to that route.Prefer Swagger UI? Swap scalar() for swaggerUi() — or mount both on different paths. See Docs UI.

Next steps