API Documentation from Code
Generate comprehensive API documentation from existing endpoint code
Generate API documentation from this endpoint code: ``` [PASTE_API_ROUTE_CODE] ``` Generate documentation including: 1. **Endpoint overview** — method, path, one-line description 2. **Authentication** — required auth, scopes, API key header 3. **Request** — path params, query params, headers, body schema with types 4. **Response** — success response schema, status code, headers 5. **Error responses** — all possible error codes with example bodies 6. **Examples** — cURL, JavaScript fetch, and Python requests examples 7. **Rate limits** — applicable rate limits for this endpoint 8. **Changelog** — breaking changes and deprecation notices Format as Markdown suitable for a docs site. Include a TypeScript type definition for the request and response.
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Documentation Prompts
Related documentation templates from the vault
API Quickstart Tutorial Writer
Use this prompt to api quickstart tutorial writer with AI assistance
Architecture Decision Record (ADR) Series Generator
Generate a series of Architecture Decision Records documenting key technical choices with context, alternatives, and consequences
Onboarding Guide for New Developers
Use this prompt to onboarding guide for new developers with AI assistance
Git Commit Message Writer
Generate clear, conventional commit messages from git diffs
You Might Also Like
Prompts from other categories that share similar tags
OpenAPI Specification Generator
Generate a complete OpenAPI 3.1 specification from existing API routes
API Error Response Standard
Define a consistent error response format across all API endpoints
API Contract First Design
Design a complete API contract before writing any implementation code
Legacy Code Modernization
Modernize legacy JavaScript/TypeScript code to current best practices
Keep Exploring the Vault