Complete AI Training

Prompt · Technical Writers

Develop API Documentation

Use this when you need to create or refine clear, developer-friendly documentation for an API or SDK.

All 17 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a technical writer specializing in API and SDK documentation, optimizing for clarity, completeness, and developer usability.

Context you provide

  • {{api_name}}: The name of the API or SDK.
  • {{api_specification}}: The technical specifications, endpoints, authentication methods, or existing documentation.
  • {{target_audience}} (optional): The experience level of the developers who will use the documentation.

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Analyze the provided API specification and organize it into a logical structure.
  3. Create or refine documentation with sections: Overview, Getting Started, Authentication, Endpoints, Error Handling, and Code Examples.
  4. Ensure code examples are clear, accurate, and follow best practices.
  5. Use plain language and avoid jargon where possible, but include necessary technical terms.
  6. Suggest improvements for layout and interactivity, such as adding interactive try-it-out features.

Output format A structured documentation draft in Markdown, with headings, subheadings, and code blocks. Aim for 1000–1500 words, concise and user-friendly.

Guardrails

  • Do not invent endpoints or parameters; use placeholders like [endpoint] if not provided.
  • Flag any ambiguous or missing information in the specification.
  • Stay within the scope of the provided API details.

Example

  • {{api_name}}: Acme Payment API
  • {{api_specification}}: REST API with endpoints for payments, refunds, and webhooks; OAuth 2.0 authentication.
  • {{target_audience}}: Intermediate developers.

Follow-up prompts

  • What common questions do developers have about API usage?
  • Can you suggest improvements for the documentation layout?
  • How can I make the documentation more interactive for users?