API Doc Generator

Generate polished API documentation from OpenAPI or annotated comments

Generate polished API documentation from OpenAPI/Swagger specs or structured code comments.

Output formats

  • Interactive HTML
  • Markdown
  • PDF

Included sections

  • Endpoint overview
  • Parameters and request body
  • Response examples
  • Error code reference

Example Results

2 examples

Generate Markdown docs from an OpenAPI schema

Turn a compact OpenAPI document into a Markdown reference with parameters, responses, schemas, and error codes.

# Demo User API

Version: 1.2.0

## Endpoints

### GET /users/{id}

**Summary:** Get user by ID
View input parameters
{ "sourceText": "{\n \"openapi\": \"3.0.0\",\n \"info\": {\n \"title\": \"Demo User API\",\n \"version\": \"1.2.0\",\n \"description\": \"User management endpoints\"\n },\n \"servers\": [\n {\n \"url\": \"https://api.example.com\"\n }\n ],\n \"paths\": {\n \"/users/{id}\": {\n \"get\": {\n \"summary\": \"Get user by ID\",\n \"tags\": [\n \"users\"\n ],\n \"parameters\": [\n {\n \"in\": \"path\",\n \"name\": \"id\",\n \"required\": true,\n \"description\": \"User identifier\",\n \"schema\": {\n \"type\": \"string\",\n \"example\": \"u_123\"\n }\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"User payload\",\n \"content\": {\n \"application/json\": {\n \"example\": {\n \"id\": \"u_123\",\n \"name\": \"Ada\"\n }\n }\n }\n },\n \"404\": {\n \"description\": \"User not found\"\n }\n }\n }\n }\n },\n \"components\": {\n \"schemas\": {\n \"User\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"name\"\n ],\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}", "sourceFormat": "json", "outputFormat": "markdown", "documentTitle": "Demo User API", "theme": "slate", "includeExamples": true, "includeSchemas": true }

Render annotated comments as interactive HTML

Use structured comment tags to build an HTML API page while disabling examples and schema sections.

POST/invoices

Create invoice

View input parameters
{ "sourceText": "@title Billing API\n@version 0.9.0\n@description Lightweight annotated API example\n@route POST /invoices\n@summary Create invoice\n@tag billing\n@query customerId string - Customer identifier\n@bodyparam amount number optional - Requested invoice total\n@request {\"customerId\":\"cust_1\",\"amount\":129.5}\n@response 201 Created\n@error 422 Validation failed", "sourceFormat": "comments", "outputFormat": "html", "documentTitle": "Billing API", "theme": "paper", "includeExamples": false, "includeSchemas": false }

Key Facts

Category
Developer & Web
Input Types
textarea, select, text, checkbox
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Generate polished API documentation from OpenAPI/Swagger specifications or structured code comments. Convert JSON, YAML, or annotated tags into interactive HTML, Markdown, or PDF files complete with endpoint details, parameters, request bodies, response examples, and error codes.

When to Use

  • Transforming machine-readable OpenAPI specs into human-friendly reference guides
  • Converting inline code annotations into shareable documentation formats
  • Producing offline-ready PDF or web-ready HTML docs for stakeholders

How It Works

  • Paste your OpenAPI JSON/YAML or structured annotated comments into the API Source field
  • Select the output format (Interactive HTML, Markdown, or PDF) and configure options like title and theme
  • Toggle inclusion of request/response examples and schema definitions as needed
  • Download the generated documentation file with organized endpoint sections and parameter tables

Use Cases

Publishing developer portals from OpenAPI specifications
Creating internal API guides from annotated source code comments
Distributing printable PDF reference sheets to integration partners

Examples

1. Markdown API Guide for GitHub

Open Source Maintainer
Background
Maintainer has an OpenAPI 3.0 specification for a public API but contributors need readable documentation in the repository.
Problem
Raw JSON spec files are difficult to read in GitHub and lack formatted parameter tables.
How to Use
Paste the OpenAPI JSON into API Source, set Output Format to Markdown, enable Include Schemas, and set Document Title.
Outcome
A README-compatible Markdown file with organized endpoint sections, parameter tables, and error code references.

2. Interactive HTML API Explorer

Developer Advocate
Background
Team documents endpoints using structured comment tags in source code, but support staff need a searchable web interface.
Problem
Static code comments are inaccessible to non-technical teams and lack visual hierarchy.
How to Use
Paste annotated comments with @route and @param tags, select Interactive HTML output, choose Slate theme, and check Include Examples.
Outcome
A navigable HTML page with styled endpoint cards, expandable parameter details, and syntax-highlighted request samples.

3. Client PDF Specification

Solutions Architect
Background
External partners require a formal PDF document for compliance reviews of the integration endpoints.
Problem
Web-based documentation cannot be attached to contracts and needs to work offline.
How to Use
Paste OpenAPI YAML into API Source, select PDF output, set Document Title to 'Integration API v2.1', and uncheck Include Examples for brevity.
Outcome
A professionally formatted PDF with endpoint overview, parameter specifications, and error codes suitable for legal review.

Try with Samples

html, markdown, pdf

Related Hubs

FAQ

What input formats does the generator accept?

OpenAPI JSON, OpenAPI YAML, and structured annotated comments.

Can I change the appearance of the HTML output?

Yes, choose between Slate or Paper themes in the Theme selector.

Is it possible to exclude code examples from the generated docs?

Yes, uncheck the Include Examples option to omit response samples.

Does the tool support auto-detecting OpenAPI versions?

Yes, set Source Format to Auto Detect to parse JSON or YAML automatically.

Can I generate a PDF suitable for printing?

Yes, select PDF as the Output Format for a print-ready document.

API Documentation

Request Endpoint

POST /en/api/tools/api-doc-generator

Request Parameters

Parameter Name Type Required Description
sourceText textarea Yes -
sourceFormat select No -
outputFormat select No -
documentTitle text No -
theme select No -
includeExamples checkbox No -
includeSchemas checkbox No -

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-api-doc-generator": {
      "name": "api-doc-generator",
      "description": "Generate polished API documentation from OpenAPI or annotated comments",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=api-doc-generator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]