prompt

OpenAPI Spec Generator

Produces an OpenAPI specification outline for an endpoint including parameters, responses, and examples.

VettedUpdated June 2026
The prompt
Generate an OpenAPI 3 spec outline for a {{method}} {{path}} endpoint that {{purpose}}. Include request parameters and body schema, success and error responses with status codes, and one example for each. Auth: {{auth}}.
Did it work? Rate this prompt

Variables

methodHTTP method
pathEndpoint path
purposePurpose
authAuth method

Example output

GET /users/{id} — retrieves a single user. Parameters: path id (integer, required). Responses: 200 returns a User object {id, email, name, created_at}; example {id: 12, email: a@b.com, name: Sam, created_at: 2025-01-04}. 404 returns {error: user not found}. 401 returns {error: unauthorized}. Auth: Bearer token in the Authorization header. The full spec would nest these under paths, components.schemas.User, and securitySchemes.bearerAuth.

Details

Author

AI Khazna

License

Security

Vetted

Type

prompt

Related assets

More curated picks in Development & Code.

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Development & Code