toolqik

72 · API & Webhooks

OpenAPI Generator

Write endpoints and example JSON; get an OpenAPI 3.1 spec in YAML or JSON.

Runs in your browser
OpenAPI
Format
Security
OpenAPI document

  

About this tool

An OpenAPI document powers API docs, client SDKs, mock servers and contract tests, but starting one from a blank file is tedious. Describe each endpoint in a few lines (method and path, a summary, and example request and response JSON) and this generator writes a valid OpenAPI 3.1 or 3.0 document, with schemas inferred from your examples, path and query parameters, and the examples included.

Endpoint format

POST /users
Create a user
request: {"name":"Ada","email":"ada@example.com"}
response 201: {"id":1,"name":"Ada","email":"ada@example.com"}
response 422: {"title":"Invalid","status":422}

GET /users/{id}
response 200: {"id":1,"name":"Ada"}
  • {id} in a path becomes a required path parameter; ?limit=20 after the path becomes an optional query parameter with an inferred type.
  • Each response CODE: line adds a response with the standard description for that status. Omit the JSON for empty responses such as 204.

Next steps

Review the result in the OpenAPI Viewer, add descriptions and constraints, and move repeated schemas into components/schemas with $ref. From there, tools like Redoc, Swagger UI, openapi-generator and Prism can render docs, generate clients and run mock servers.

FAQ

How do I create an OpenAPI spec?

Write each endpoint as a short block with example request and response JSON, choose YAML or JSON, and copy or download the generated document.

OpenAPI 3.1 or 3.0?

3.1 aligns fully with JSON Schema 2020-12 and is the current version. Choose 3.0 for tools that don’t support 3.1 yet; nullable fields are converted for you.

Can it generate path and query parameters?

Yes. {name} segments become path parameters, and example query strings become query parameters with inferred types.

esc
↑↓ navigate↵ open