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
- [01]Prompt for an OpenAPI skeleton first, then iterate on details.
- [02]Run a review prompt against your spec with a standard checklist.
- [03]Generate example requests/responses for each endpoint.
- [04]Document deprecation and versioning strategy in the prompt.
API design promptsOpenAPI with AIAPI review LLM