AI API Design Workflow
Design an API on its contract instead of discovering it endpoint by endpoint — model the resources, design the endpoints and payloads, pin the contract, then review it before code locks it in.
The problem
An API designed endpoint-by-endpoint as you code becomes a contract you can't change — clients depend on every accident, and the inconsistencies calcify into a permanent surface you maintain forever. The expensive decisions are made up front: what the resources are, how the endpoints map to them, what the payloads and validation rules look like, how errors and versions behave. 'Ask AI to write the endpoint' skips all of that and hands you the first plausible shape. This workflow designs the API as a contract first — resources, endpoints, payloads, versioning — and reviews it before code makes it permanent.
Recommended workflow
Each step uses an existing NewPrompt tool, pre-filled by a matching resource. Open the resource to read it, or jump straight into the tool with the inputs ready.
-
Model the resources and boundaries
Before endpoints, name the resources the API exposes and where its boundaries sit. Anchor the model as an architect so it reasons about the nouns and their relationships, not the first route that comes to mind.
Goal The API's resources and boundaries named, before any endpoint is drawn.
Open this step in Role Prompt GeneratorResource Software Architect Role Prompt -
Design the endpoints, payloads, and validation
Work the design one decision at a time: which endpoints each resource needs, the request and response payloads, the validation rules, and how errors are shaped — consistently across the whole surface, not per-route improvisation.
Goal Endpoints, payload shapes, and validation rules decided deliberately and consistently.
Open this step in Multi-Step Prompt Builder -
Pin the contract and versioning
Turn the design into a precise contract — request and response schemas, error formats, and a versioning rule — so clients build against something stable instead of whatever the implementation happens to return.
Goal A precise request/response contract with a versioning rule, ready to build against.
Open this step in JSON Output Prompt BuilderResource Turn a JSON Schema into a Prompt -
Review the design before it's code
Run the design past a review lens — consistency across endpoints, error handling, breaking-change risk, missing validation — while it's still cheap to change, because once clients depend on it the contract is fixed.
Goal The API design reviewed for consistency and gaps before implementation locks it.
Open this step in Code Review Prompt GeneratorResource API Review Checklist Prompt
Expected outcome
An API designed as a contract before implementation — resources modeled, endpoints and payloads decided, request/response schemas and versioning pinned, and the whole surface reviewed for consistency — so you build against a deliberate design instead of hardening accidents into a contract clients can't escape.
Best for
- Designing a new API surface before writing endpoints
- Adding endpoints to an API without breaking its consistency
- Pinning request/response contracts and a versioning rule up front
Not for
- Designing the data model behind the API — use the AI Database Design Workflow
- Deciding the system's overall architecture — use the AI Project Architecture Workflow
- Documenting an API that already exists — describe the running endpoints instead
FAQ
How is this different from the AI Project Architecture Workflow?
Architecture decides the system's overall structure — services, boundaries, data flow. This zooms in on one surface: the API contract — resources, endpoints, payloads, versioning. You'd usually set the architecture first, then design the APIs that live inside it.
How is this different from the AI Database Design Workflow?
They're two sides of the same build. This designs the interface clients call; database design models the data behind it. The API contract and the schema inform each other, but they're distinct artifacts — the endpoints clients depend on versus the tables they never see.
Does the AI design the API for me?
No. It structures the resource model, surfaces inconsistencies, and pressure-tests the contract so your design is deliberate. The API decisions — and the compatibility promises you make to clients — stay yours.
Part of these blueprints
Complete build journeys that include this workflow as a stage.
Where to go next
Related workflows