OpenAPI spec
An OpenAPI spec is the YAML / JSON description of a REST API — endpoints, params, responses, auth — used to drive doc generation, SDK generation, mock servers, and increasingly AI-readable API surfaces in 2026.
In more detail
What it means
OpenAPI (formerly Swagger) is the de-facto standard for describing REST APIs. Spec content: paths + methods, params with types, request / response schemas, auth schemes, examples. Tools built on top: Swagger UI / Redoc / Mintlify / ReadMe for docs, Stainless / Fern / Speakeasy / OpenAPI Generator for SDK gen, Prism for mocks, postman / insomnia for collections. In 2026 OpenAPI specs also drive LLM tool definitions — many MCP servers wrap an OpenAPI spec, and Claude / GPT can be given OpenAPI YAML directly as tool specs. The richer + more accurate your OpenAPI, the more downstream tooling 'just works'.
Part 1 of 2
When to use it, and when not
Use it for
- Any REST API.
- AI tool / agent integrations.
Part 2 of 2
Common mistakes
- Hand-writing OpenAPI then drifting from the code — auto-generate from server code where possible.
- Missing examples — generated docs + SDKs look thin.
FAQ
Questions readers ask.
What is openapi spec?
An OpenAPI spec is the YAML / JSON description of a REST API — endpoints, params, responses, auth — used to drive doc generation, SDK generation, mock servers, and increasingly AI-readable API surfaces in 2026.
When should you use openapi spec?
Any REST API. AI tool / agent integrations.
What are the common mistakes with openapi spec?
Hand-writing OpenAPI then drifting from the code — auto-generate from server code where possible. Missing examples — generated docs + SDKs look thin.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/openapi-spec.md. Found a mistake? Tell us.