Back to guide/Developer Tools

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.

claude-vs-geminilanguagecode_or_description
Edit View
Prompt
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

{{language}}{{code_or_description}}

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.