PromptsHub
Used by 5,000+ developers & creators
Back to Developers
DevelopersAPIOpenAPIYAML

OpenAPI 3.0 Spec Generator from Raw Requirements

Translates informal system requirements into a complete, industry-standard OpenAPI 3.0 specification.

Use Case

Use this prompt during the design phase of a new microservice to quickly establish a schema-first API contract before writing code.
AI Prompt
Act as an expert API architect. Based on the following raw system requirements: [insert system requirements/endpoints here], generate a complete, valid OpenAPI 3.0 specification in YAML format. Ensure you include standard response codes (such as 200, 201, 400, 401, 403, 500), precise parameter schemas, security schemes (such as Bearer Auth), and descriptive tags. Do not use any markdown formatting or code blocks in your explanation; output the specification purely as raw structural YAML.

How to Use

  1. 1Summarize the raw API requirements, endpoints, parameters, and desired response behaviors.
  2. 2Insert them into the requirements placeholder of the prompt.
  3. 3Run the prompt to generate the structured OpenAPI 3.0 configuration.

Example Output

openapi: 3.0.0 info: title: User Management Service version: 1.0.0 paths: /users: post: summary: Create a new user security: - BearerAuth: [] requestBody: required: true content: application/json: schema: type: object properties: username: type: string email: type: string format: email responses: 201: description: User created successfully