API Documentation Generator
Claude excels at reading code structure and generating precise documentation. Gemini handles large codebases well with its extended context. The [VERIFY] convention prevents hallucinated behavior on both models.
Generate comprehensive API documentation for the following {{language}} code: {{code_or_description}} Produce documentation in this format: **Overview**: One paragraph explaining what this API does and its primary use case **Authentication**: How requests are authenticated (infer from the code or note "not specified") **Endpoints/Methods** (for each): - Method signature with types - Description (what it does, not how) - Parameters table: name | type | required | default | description - Return type with example response shape - Error cases: what can go wrong and the error format - Example request and response (realistic data, not "foo/bar") **Data Models**: Document all types/interfaces/schemas referenced **Rate Limits / Constraints**: Note any limits visible in the code **Quick Start**: A minimal working example that demonstrates the most common use case Use present tense. Keep descriptions under 2 sentences each. If behavior is ambiguous from the code, mark it with [VERIFY] rather than guessing.
Variables to customize
Why this prompt works
Claude excels at reading code structure and generating precise documentation. Gemini handles large codebases well with its extended context. The [VERIFY] convention prevents hallucinated behavior on both models.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.