AI tools

Free AI API documentation generator

Paste the code for an endpoint. Get clear reference docs with parameters, responses and an example request, plus a list of what the code doesn't tell us.

How it works

  1. Paste the route handler or controller for one to four endpoints, from any framework: Express, FastAPI, Flask, Django, Rails, Spring, Laravel and more.
  2. Pick Markdown reference docs, an OpenAPI 3.1 spec or a plain summary for your team, add the base URL and auth if you know them, and click Document my API.
  3. Review the docs against the code, fill in the To confirm items, and paste the result into your README, docs site or API gateway.

Examples

Sample results for the inputs shown, so you can see the format and quality before you try it.

Example 1: input

Endpoint code or description: router.post('/api/invoices', requirePermission('billing:write'), async (req, res) => { const { customer_id, items, due_date } = req.body; if (!Array.isArray(items) || items.length === 0) return res.status(400).json({ error: 'items must not be empty' }); for (const it of items) { if (!it.description || !Number.isInteger(it.quantity) || it.quantity < 1 || …

Output format: Markdown reference docs

Example 1: output
## Create an invoice `POST /api/invoices` Creates a draft invoice for a customer. Requires a signed-in user with the `billing:write` permission. ### Request body (JSON) | Field | Type | Required | Description | |---|---|---|---| | customer_id | string | Yes | ID of an existing customer | | items | array | Yes | At least one line item | | items[].description | string | Yes | Line item text | | items[].quantity | integer | Yes | 1 or more | | items[].unit_price_cents | integer | Yes | Price per unit in cents, 0 or more | | due_date | string (YYYY-MM-DD) | No | Defaults to 30 days from today | ### Responses - `201 Created`: returns the invoice with `id`, `status: "draft"`, `total_cents` and `due_date`. - `400 Bad Request`: `{ "error": "items must not be empty" }` or another validation message. - `403 Forbidden`: the user lacks `billing:write`. - `404 Not Found`: `{ "error": "customer not found" }`. ### Example ``` curl -X POST https://[your-domain]/api/invoices \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"customer_id": "cus_123", "items": [{"description": "Setup", "quantity": 1, "unit_price_cents": 50000}]}' ``` To confirm: - The base URL and how tokens are issued are not in the code shown. - The code doesn't cap the number of items; confirm whether a limit exists elsewhere.
Example 2: input

Endpoint code or description: @app.get("/users/<int:user_id>") def get_user(user_id): user = User.query.get(user_id) if user is None: return {"error": "not found"}, 404 data = {"id": user.id, "email": user.email, "name": user.name} if request.args.get("include") == "teams": data["teams"] = [t.name for t in user.teams] return data

Output format: OpenAPI 3.1 (YAML)

Example 2: output
openapi: 3.1.0 info: title: Users API version: 1.0.0 paths: /users/{user_id}: get: summary: Get a user by ID parameters: - name: user_id in: path required: true schema: type: integer - name: include in: query required: false description: Set to "teams" to include the user's teams. schema: type: string enum: [teams] responses: "200": description: The user content: application/json: schema: type: object properties: id: { type: integer } email: { type: string, format: email } name: { type: string } teams: type: array items: { type: string } "404": description: No user with this ID content: application/json: schema: type: object properties: error: { type: string } To confirm: - The code does not show authentication. Add a security scheme if this route is protected. - teams is returned as a list of names; check whether your serializer returns objects instead.
Example 3: input

Endpoint code or description: @router.post('/internal/reindex') async def reindex(body: ReindexIn, x_internal_key: str = Header(None)): if x_internal_key != os.environ['INTERNAL_KEY']: raise HTTPException(401) if body.full: await search.drop_index(body.workspace_id) job = await queue.enqueue('reindex', workspace_id=body.workspace_id, since=None if body.full else await last_run(body.workspace_id)) …

Output format: Plain summary for teammates

Example 3: output
What it does: POST /internal/reindex starts a background job that rebuilds the search index for one workspace. Who can call it: any request with the header X-Internal-Key matching the INTERNAL_KEY environment variable. Anything else gets 401. Input: JSON body with workspace_id (required). If full is true it drops the index and rebuilds from scratch; otherwise it only reindexes documents changed since the last run. What you get back: 202 with {"job_id": "..."} right away. The job keeps running after the response. Things to know: - Calling it twice for the same workspace starts two jobs; nothing in this code prevents that. - A full rebuild deletes the index first, so search for that workspace returns nothing until the job finishes. - Job progress isn't exposed here. Check the job queue or logs using the job_id. To confirm: - How long a full rebuild takes for a large workspace.

Tips for better results

  • Paste the validation code along with the handler. Required fields, limits and allowed values come from it, and the generator won't guess them.
  • Add the base URL and auth scheme in the context box. They rarely appear in a handler, so without them the docs use placeholders.
  • Use the plain summary for internal endpoints. Teammates need the gotchas (destructive actions, no idempotency) more than a full reference table.
  • Treat the To confirm list as your review checklist. It names what the code doesn't show, such as rate limits enforced by a gateway.

FAQ

Is this API documentation generator free?

Yes. Enter your email once to use it (you'll also get Something Big, our free weekly AI newsletter, and you can unsubscribe anytime). There's no account and no credit card.

Which frameworks does it understand?

Any common web framework: Express, Fastify, NestJS, FastAPI, Flask, Django REST Framework, Rails, Laravel, Spring, ASP.NET, Go's net/http and more. You can also describe an endpoint in plain English.

Can it write an OpenAPI spec?

Yes. Choose OpenAPI 3.1 (YAML) and it writes paths, parameters, request bodies and response schemas you can load into Swagger UI, Redoc or Postman. Check it with a validator before publishing.

Will it invent error codes or rate limits?

No. It documents only what the code shows or what you tell it, and lists everything else under To confirm.

More free AI tools

Related prompts

Prefer to use ChatGPT or Claude directly? These free prompts do similar jobs.

Get the best free AI tools and prompts every week

Something Big is a free AI newsletter read by 50,000+ professionals. One email a week with the AI tools and prompts that actually work, plus what changed in AI and what to do about it.