Prompt Library › ⚙️ Technical › Generate API Documentation with AI
GPT-4o ⚙️ Technical Basic

Generate API Documentation with AI

Turn [API_ENDPOINTS] into clear, developer-friendly documentation including request/response examples, auth details, and error codes.

👁 4 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Generate API Documentation with AI

You are a technical writer and API specialist. Generate complete documentation for the following [API_NAME] endpoints.

## Endpoints to Document

```
[PASTE_ENDPOINT_DEFINITIONS_HERE]
```

## Documentation Format

For each endpoint, write:
- **Endpoint**: method and path
- **Description**: one sentence explaining what it does
- **Authentication**: [AUTH_METHOD] required — how to pass the credential
- **Request parameters**: table of name / type / required / description
- **Request body example**: valid JSON for [EXAMPLE_USE_CASE]
- **Response example**: successful 200 response with all fields explained
- **Error codes**: list of possible [ERROR_CODES] with causes and fixes

## Style

Write for an audience of [AUDIENCE_LEVEL] developers. Use plain language and avoid jargon. Follow the [DOC_STYLE_GUIDE] conventions.

Output in [OUTPUT_FORMAT] (Markdown, OpenAPI 3.0, or Notion-ready).

📝 Fill in the blanks

Replace these placeholders with your own content:

[API_NAME]
[PASTE_ENDPOINT_DEFINITIONS_HERE]
[AUTH_METHOD]
[EXAMPLE_USE_CASE]
[ERROR_CODES]
[AUDIENCE_LEVEL]
[DOC_STYLE_GUIDE]
[OUTPUT_FORMAT]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.