1
of 5

What you'll accomplish

By the end of this guide, you'll be able to use Claude to draft API reference documentation from an OpenAPI spec or endpoint description, generate working code examples, and write developer-friendly error documentation — without needing to write code yourself.

What you'll need

  • Claude.ai account (Claude Pro recommended for large specs; free tier works for single endpoints)
  • OpenAPI/Swagger spec (YAML or JSON), or endpoint details from an engineer
  • Access to the API sandbox or a developer who can verify code examples
  • Time needed: 30-45 minutes initial; 15-20 minutes per endpoint thereafter
  • Cost: Free tier works; Claude Pro ($20/month) for large specs with 50+ endpoints

How-To Guide: Writing API Documentation with Claude

Step 1: Gather your API information

Before using Claude, you need input data. Collect one of these:

  • Best: OpenAPI/Swagger YAML or JSON spec file
  • Good: A list of endpoints with their HTTP methods, parameters, and response fields
  • Minimal: A developer's notes describing what the endpoint does

The more technical detail you provide, the more accurate Claude's output will be. Don't worry if you don't understand all of it — Claude will work with what you have.

What you should see: Raw technical material you can copy and paste into Claude. Troubleshooting: Ask your engineering team for the OpenAPI spec — most REST APIs have one. It's usually at /swagger.json or /openapi.yaml in the API itself, or in the codebase.