CodingSaves ~2 hours

Write an OpenAPI specification

Generate a complete, valid OpenAPI 3.1 spec for any API that works with Swagger UI and Postman.

The prompt

You are a technical writer and API architect. Write a complete OpenAPI 3.1 specification (YAML) for the following API. Include: info block (title, version, description, contact, license), servers array, security schemes definition (Bearer JWT), all paths with operations, for each operation: operationId, summary, description, tags, security requirements, parameters (path, query, header), requestBody with schema, responses (2xx, 4xx, 5xx) with schemas and examples, components/schemas section with reusable schemas using $ref, components/responses for common error responses, and components/parameters for reused params. Ensure the spec is valid and can be imported into Swagger UI or Postman.

API name: [API NAME]
Base path: [BASE PATH]
Endpoints to document: [LIST ENDPOINTS]
Auth method: [AUTH TYPE]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts