5 Best ChatGPT Prompts for API Design (2026)

Design a REST or RPC API the disciplined way — resources, contracts, errors, versioning, and a review against real-world usage — in five prompts.

Verified against GPT-5.1 on 2026-07-125 prompts🟢 ChatGPT🟠 Claude

Run = copies the prompt and opens the tool. Remix = save an editable copy to your workspace (free account).

1

Model the resources

🟢 ChatGPT

You are an API architect. I'm building: [ONE-PARAGRAPH PRODUCT DESCRIPTION]. Consumers: [WHO CALLS IT — web app / mobile / third parties].

Propose the resource model: entities, their relationships, and which ones deserve top-level endpoints vs. nesting. Present as a table: resource | key fields | relationships | endpoint style. Flag anything in my description that suggests a resource I haven't named.

Why this works: ChatGPT rapidly maps fuzzy product descriptions onto clean resource models.

Good output: A resource table plus at least one 'you also need X' catch.

2

Draft the endpoint contract

🟢 ChatGPT

For the [RESOURCE] resource, draft the full contract: endpoints (method + path), request/response JSON shapes with realistic example values, pagination style, filtering params, and idempotency behavior for each write. Use [REST/GraphQL/RPC] conventions consistently.

Why this works: Concrete example payloads expose design problems that abstract schemas hide.

Good output: A contract you could hand to a frontend dev today, with realistic examples.

3

Design the error model

🟢 ChatGPT

Design the error model for this API: error response shape, a table of error codes (HTTP status | machine code | when it happens | what the client should do), and how validation errors report multiple field failures at once. Make retryable vs. non-retryable explicit.

Why this works: Error models are always an afterthought — making them a dedicated step fixes that.

Good output: An error table where every row tells the client what to DO, not just what went wrong.

4

Stress-test with real sequences

🟢 ChatGPT

Simulate three real client sessions against this contract: (1) the happy-path first-time flow, (2) a flaky-network client that retries everything, (3) a third-party integrator doing bulk sync. Write out each request sequence, and flag every point where the API is awkward, chatty, or ambiguous.

Why this works: Walking concrete call sequences finds the N+1s and ambiguities reviews miss.

Good output: Three annotated request sequences with specific awkwardness flags.

5

Versioning and evolution plan

🟢 ChatGPT

Recommend a versioning strategy for this API (URL / header / field deprecation) given [EXPECTED CONSUMERS]. Then list which parts of the current design are most likely to change and how the contract lets them evolve WITHOUT a breaking version bump. End with a checklist I can run before any future change ships.

Why this works: Evolution planning at design time is 10x cheaper than a v2 migration later.

Good output: A one-page strategy plus a pre-ship breaking-change checklist.

Frequently Asked Questions

Does this work for GraphQL?

Yes — say GraphQL in step 2 and the contract step produces types/queries/mutations instead of endpoints. Steps 1, 3, 4 and 5 are paradigm-independent.

Can I skip straight to step 2?

If your resource model is already settled, yes. But step 1's 'resource you haven't named' catch pays for itself surprisingly often.

Which AI is best for API design?

ChatGPT and Claude are both strong. We verify against GPT-5.1; Claude tends to write longer rationales, which some teams prefer for design docs.

Make this workflow yours

Remix this pack into your workspace — edit the prompts, track your runs, and never hunt for them in old chats again.

← Browse all Prompt Packs