Design an API
Resources, endpoints, request/response shapes, errors, auth, and versioning for a REST or GraphQL API.
The prompt
Design an API for me.
What it does and who uses it: [PURPOSE, consumers — web app, mobile, partners]
Domain entities and relationships: [LIST]
Key use cases: [LIST]
Style: [REST / GraphQL / gRPC — or recommend]
Constraints: [auth method, scale, latency, compatibility, existing conventions]
Deliver:
1. Resource model and endpoints (or schema/services) with methods, paths, and purpose.
2. Request/response examples for the main operations.
3. Conventions — naming, pagination, filtering, sorting, idempotency.
4. Error format and status codes.
5. Authentication, authorization, and rate limiting.
6. Versioning and deprecation strategy.
7. An OpenAPI 3.1 snippet for the core endpoints.
8. Design trade-offs and open questions.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- PURPOSE, consumers — web app, mobile, partners
- LIST
- REST / GraphQL / gRPC — or recommend
How this prompt is built
This prompt follows the RTF structure (Role, Task, Format). RTF tells the model who to be, what to do and what shape the answer should take. It is the quickest structure that still gives noticeably better results than a bare request.
Related prompts
- Explain what a piece of code doesPlain-language walkthrough of unfamiliar code: purpose, flow, key parts, and gotchas.
- Audit a codebase for bugs, risks, and tech debtA systematic review of a repository with prioritized findings and a remediation plan.
- Refactor code to be cleaner and easier to maintainImproves structure, naming, and design without changing behavior.
- Speed up slow codeFinds performance bottlenecks and suggests faster approaches with measurable trade-offs.