All questions
How do I prompt AI to design or review APIs?
Provide domain context, use cases, and constraints (resource naming, versioning, auth). Ask for an OpenAPI draft with consistent naming, error codes, and examples. Include nonfunctional requirements like rate limits and pagination. For reviews, request a checklist: consistency, idempotency, status codes, and security concerns. Ask the model to propose migration paths for breaking changes.
In practice
Include 2–3 representative client calls so the model grounds the path structure and payloads.
Where to start
- 1Prompt for an OpenAPI skeleton first, then iterate on details.
- 2Run a review prompt against your spec with a standard checklist.
- 3Generate example requests/responses for each endpoint.
- 4Document deprecation and versioning strategy in the prompt.
API design promptsOpenAPI with AIAPI review LLM