API documentation prompts that generate clear, complete references
An API documentation prompt instructs an LLM to generate clear, consistent API references from endpoint specifications — including descriptions, request/response examples, error codes, and authentication requirements.
API documentation has a rigid structure that benefits enormously from typed blocks. The context block receives the endpoint specification (path, method, parameters, response schema). The instructions block defines what to generate — description, examples, error handling. The output format block ensures every endpoint follows the same documentation template.
Without structured prompts, API doc generation is inconsistent: some endpoints get detailed examples while others get one-liners. Some include error codes, others don't. Structured blocks enforce completeness — every endpoint gets the same treatment because the instructions block demands it.
The guardrails block handles accuracy: don't invent parameters not in the spec, don't assume default values, always mark required vs. optional fields. These rules prevent the LLM from generating plausible-looking but incorrect documentation — a common failure mode.
Endpoint: {{method}} {{path}}. Parameters: {{parameters}}. Request body: {{request_schema}}. Response: {{response_schema}}. Authentication: {{auth_type}}.1. Write a clear 1-2 sentence description of what this endpoint does. 2. List all parameters with type, required/optional, and description. 3. Generate a realistic request example. 4. Generate a success response example. 5. List common error codes with descriptions. 6. Note any rate limits or special requirements.
Only document parameters that exist in the specification. Do not invent default values. Mark required fields explicitly. If information is missing from the spec, note it as 'TBD' rather than guessing.
Use markdown with the structure: ## Endpoint Title Description ### Parameters Table of params ### Request Example Code block ### Response Example Code block ### Errors Table of error codes
- Every endpoint follows the same documentation template — consistency at scale
- Guardrails prevent the LLM from inventing parameters or default values
- Spec changes automatically produce updated docs when the prompt is re-run
- Technical writers set the format, engineers provide the specs — clear separation
- Version history shows how documentation standards evolve over time
Build your api documentation prompt.
Start with this template or compose from scratch with typed blocks. Free to get started — no credit card required.