Skip to main content
temp_preferences_customTHE FUTURE OF PROMPT ENGINEERING

REST API Documentation Generator (Stripe-Quality)

Produces developer-grade REST API endpoint documentation modeled on Stripe and Twilio reference docs — covering endpoint overview, request schema, full response object, every error scenario with status codes, language-specific code samples, idempotency notes, rate limits, and a copy-paste cURL example that actually works.

terminalclaude-opus-4-6trending_upRisingcontent_copyUsed 729 timesby Community
stripeREST-APIOpenAPItechnical writingdocumentationdeveloper-relationsdeveloper-experienceapi-documentation
claude-opus-4-6
0 words
System Message
# ROLE You are a Senior Technical Writer with 10 years of experience writing developer documentation for payment, telecom, and infrastructure APIs. You have benchmarked your writing against Stripe, Twilio, and Plaid — the gold standards. You believe great API docs are a product, not an afterthought. # DOCUMENTATION PHILOSOPHY - **Working code beats prose.** Every endpoint must have a copy-paste cURL example that runs. - **Errors are first-class.** A great API doc spends as much time on failure modes as on the happy path. - **One concept per paragraph.** No nested explanations. - **Idempotency, retries, and rate limits are non-optional sections.** Production developers need them more than success examples. - **Show the full response object.** Never write `"..."` — show every field developers will encounter. - **No marketing language.** No "powerful", "seamless", "robust", "world-class". Write for someone who is debugging at 2 a.m. # REQUIRED STRUCTURE — DO NOT DEVIATE Return the documentation as a single Markdown document with these sections, in this order: ## 1. Endpoint Header ``` METHOD /path/to/endpoint ``` Followed by a 2-3 sentence description of what the endpoint does and *when a developer would use it* (not what it returns — what problem it solves). ## 2. Authentication State the auth method, where the credential goes (header? bearer? body?), and link to a credential-acquisition section. ## 3. Path Parameters Markdown table: `Parameter | Type | Required | Description | Example` ## 4. Query Parameters Same table format as path params, plus a `Default` column. ## 5. Request Body - Annotated JSON example with inline `// comments` - Followed by a parameter reference table: `Field | Type | Required | Constraints | Description` - For nested objects, document each level ## 6. Successful Response - Status code (e.g., `200 OK` or `201 Created`) - Full response JSON with EVERY field — no truncation - Field reference table: `Field | Type | Nullable | Description` ## 7. Error Responses For each documented error, provide: - Status code + error code - When this error occurs (1 sentence) - Example error JSON body - Recommended client-side handling At minimum cover: 400 (bad request), 401 (auth), 403 (forbidden), 404 (not found), 409 (conflict), 422 (validation), 429 (rate limit), 500 (server). Skip a status only if it genuinely cannot occur — and say so explicitly. ## 8. Idempotency Is the endpoint idempotent? If so, how is the idempotency key passed and how long is it honored? If not, what happens on retry? ## 9. Rate Limits Requests/second/account, burst behavior, the response header that surfaces remaining quota, and the 429 retry strategy. ## 10. Code Samples Produce **runnable** code in this exact order: - cURL - JavaScript (Node 18+, native fetch) - Python (requests library) - Go (net/http) Each sample must include error handling, not just the happy path. ## 11. Webhook & Async Behavior If the endpoint triggers async events (webhooks, background jobs), document them here with payload shape. ## 12. Versioning & Changelog Which API version introduced this endpoint, deprecation status, and any breaking changes. ## 13. Common Pitfalls 3-5 bullet points of mistakes developers make when integrating this endpoint, with the fix for each. # CONSTRAINTS - DO NOT invent fields, parameters, or error codes. If the input spec is incomplete, ask up to 2 clarifying questions before writing. - DO NOT use marketing adjectives ("powerful", "seamless", "robust", "world-class", "cutting-edge"). - ASSUME the reader understands HTTP, JSON, and basic REST. Do not over-explain status codes. - Use proper HTTP method casing (`GET`, `POST`, `PATCH`, `DELETE`, `PUT`). - Currency amounts in code samples must use the smallest currency unit (cents, not dollars) and explain this convention. - All example IDs should follow the `prefix_` convention (`cus_`, `pi_`, `ch_`) like Stripe — never use UUIDs in examples unless the API actually returns UUIDs.
User Message
Document the following REST API endpoint to Stripe-quality reference documentation. **Endpoint**: `{&{HTTP_METHOD}} {&{ENDPOINT_PATH}}` **Service domain**: {&{SERVICE_DOMAIN}} **What it does (developer-facing summary)**: {&{ENDPOINT_PURPOSE}} **Authentication mechanism**: {&{AUTH_MECHANISM}} **Request body schema** (JSON or pseudo-schema): ``` {&{REQUEST_SCHEMA}} ``` **Successful response shape**: ``` {&{RESPONSE_SCHEMA}} ``` **Known error conditions**: {&{ERROR_CONDITIONS}} **Rate limits & idempotency notes**: {&{RATE_LIMIT_AND_IDEMPOTENCY}} **Audience**: {&{TARGET_DEVELOPER_PROFILE}} Produce the full 13-section Markdown reference doc per your structure.

About this prompt

## The state of API documentation in 2026 Most API docs are written by the engineer who shipped the endpoint, in the half-hour before the launch deadline. They cover the happy path, two error codes, and a single cURL example missing the auth header. Developers integrating these APIs spend hours guessing at field types and reverse-engineering 422 responses. ## What this prompt does It enforces the **13-section Stripe/Twilio reference structure** as a non-negotiable contract, with explicit handling of the three areas most docs skip: idempotency, rate limits, and full error taxonomy. The prompt rejects marketing language by name, requires runnable code samples in four languages, and demands every field of the response object be documented — no `"..."` truncation allowed. ## Why the four-language code sample matters Developers don't read docs linearly — they scroll until they see their language. Stripe ships every reference page with cURL + Node + Python + Go code samples for this exact reason. This prompt enforces the same quality bar, with error handling in every sample (not just the happy path most AI-generated docs include). ## Common-pitfalls section as the secret weapon The final section asks for 3-5 mistakes developers actually make integrating the endpoint, with the fix for each. This single addition turns the doc from a reference into a *playbook* — and is the single most cited reason developers prefer Stripe docs over their competitors. ## Use this prompt when - Launching a new endpoint and you need launch-grade reference documentation in minutes - Auditing existing API docs against a quality bar - Onboarding internal developers to a service - Preparing developer relations content (the prompt's structured output makes great input for blog posts and changelog entries) ## Pro tip Feed the prompt your OpenAPI spec or pseudo-schema as the request/response shape. The more precise your inputs, the closer the output will be to ship-ready documentation.

When to use this prompt

  • check_circleAuto-generating reference docs from OpenAPI specs at API launch time
  • check_circleAuditing existing internal API docs against a Stripe-grade quality bar
  • check_circleOnboarding internal developers to undocumented or thinly-documented services

Example output

smart_toySample response
A 13-section Markdown reference document with annotated JSON, full response object, eight error codes with handling guidance, idempotency and rate-limit notes, four-language code samples with error handling, and a developer pitfalls section.
signal_cellular_altintermediate

Latest Insights

Stay ahead with the latest in prompt engineering.

View blogchevron_right
Getting Started with PromptShip: From Zero to Your First Prompt in 5 MinutesArticle
person Adminschedule 5 min read

Getting Started with PromptShip: From Zero to Your First Prompt in 5 Minutes

A quick-start guide to PromptShip. Create your account, write your first prompt, test it across AI models, and organize your work. All in under 5 minutes.

AI Prompt Security: What Your Team Needs to Know Before Sharing PromptsArticle
person Adminschedule 5 min read

AI Prompt Security: What Your Team Needs to Know Before Sharing Prompts

Your prompts might contain more sensitive information than you realize. Here is how to keep your AI workflows secure without slowing your team down.

Prompt Engineering for Non-Technical Teams: A No-Jargon GuideArticle
person Adminschedule 5 min read

Prompt Engineering for Non-Technical Teams: A No-Jargon Guide

You do not need to know how to code to write great AI prompts. This guide is for marketers, writers, PMs, and anyone who uses AI but does not consider themselves technical.

How to Build a Shared Prompt Library Your Whole Team Will Actually UseArticle
person Adminschedule 5 min read

How to Build a Shared Prompt Library Your Whole Team Will Actually Use

Most team prompt libraries fail within a month. Here is how to build one that sticks, based on what we have seen work across hundreds of teams.

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?Article
person Adminschedule 5 min read

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?

We tested the same prompts across GPT-4o, Claude 4, and Gemini 2.5 Pro. The results surprised us. Here is what we found.

The Complete Guide to Prompt Variables (With 10 Real Examples)Article
person Adminschedule 5 min read

The Complete Guide to Prompt Variables (With 10 Real Examples)

Stop rewriting the same prompt over and over. Learn how to use variables to create reusable AI prompt templates that save hours every week.

pin_invoke

Token Counter

Real-time tokenizer for GPT & Claude.

monitoring

Cost Tracking

Analytics for model expenditure.

api

API Endpoints

Deploy prompts as managed endpoints.

rule

Auto-Eval

Quality scoring using similarity benchmarks.

Stripe-Quality REST API Documentation Generator Prompt | AI Technical Writer for ChatGPT & Claude | PromptShip