Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Import OpenAPI

Put an OpenAPI spec in your project and add an api node to the navigation to get a complete API reference with groups, endpoint pages, parameter tables, examples, and an interactive explorer.

Generate an API reference in three steps

Add the spec

Put a YAML or JSON spec in your project, for example openapi/payments.yml. OpenAPI 3.1, 3.0, and Swagger 2.0 are supported (Swagger is upgraded to 3.1 on load), and every $ref is fully dereferenced.

Add it to the navigation

docs.yml
tabs:
  api:
    display-name: API Reference
    slug: api

navigation:
  - tab: api
    layout:
      - api: API Reference
        api-name: payments
        openapi: openapi/payments.yml

Check and preview

biti check && biti dev

Problems in the spec (such as unresolvable $refs) are reported as openapi/spec warnings; a missing or unparseable file is reported as an api/load error.

This site's API reference is generated this way from openapi/platform.yml.

Grouping and ordering

  • Endpoints are grouped by their first tag; endpoints without a tag go into "Endpoints".
  • Groups follow the order of the spec's top-level tags array; undeclared tags come last.
  • A group's title is the tag's x-displayName (or x-display-name), falling back to the tag name. The group's URL segment is generated from the tag name, so you can use an English tag name for English URLs and x-displayName for a localized title.
  • A tag's description is shown under its group on the API overview page.
openapi/payments.yml
tags:
  - name: Payments          # URL: /api/payments/…
    x-displayName: Payments  # shown as "Payments" in the sidebar and overview page
    description: Create, retrieve, and cancel payments.
  - name: Refunds
    x-displayName: Refunds

With only one group, endpoints are listed directly under the API section; set flattened: true on the navigation node to force ungrouped output.

Endpoint titles and URLs

PurposeResolution order
Titlex-fern-display-name → summary → operationId → METHOD /path
URL segmentx-fern-sdk-method-name → summary → operationId → method-path

URL segments are also generated with the GitHub anchor algorithm. When summary is not in English, use x-fern-sdk-method-name to set an English URL:

paths:
  /payments:
    post:
      tags: [Payments]
      summary: Create a payment               # title
      x-fern-sdk-method-name: create-payment  # URL: /api/payments/create-payment

When a URL segment repeats within a group, later occurrences get a -2, -3 suffix automatically.

Availability and hiding

ExtensionEffect
x-fern-availability: beta (or x-availability)Shows a status badge on the endpoint title and in the sidebar; values include beta, alpha, preview, deprecated
x-beta: trueSame as beta
deprecated: trueShows "Deprecated"
x-hidden, x-internal, x-fern-ignoreNo page is generated, and the endpoint is left out of the published spec

This site's AI site translation endpoint is marked x-fern-availability: beta.

What an endpoint page contains

Each endpoint page is generated from the spec:

  • Method badge, full path, and a copy button; with multiple servers, readers can switch the base URL.
  • Authentication: from security and securitySchemes (Bearer, API key location, and so on).
  • Field tables for path / query / header parameters and the request body: type, required, default, constraints (minimum, maxLength, pattern…), enum values (with x-enum-descriptions support), expandable nested objects, switchable oneOf / anyOf variants, and merged allOf.
  • Responses: a description and field table for each status code, with expandable error responses.
  • On the right: request examples (9 languages, see Code samples) and response examples (switchable across status codes), plus a "Try it" button (see Try it and proxy).
  • The page's .md version includes the parameter tables, request body fields, a cURL example, the response fields of every status code, and a response example for AI to read.

Where examples come from

Request body and response examples are picked in this order: the first entry in examples (switchable when there are several) → example → generated from the schema (using the field's example, default, the first enum value, or a placeholder based on type and format).

Adjust how endpoint pages look

Endpoint pages are generated from the spec and have no source file. Set how they look with api-reference in docs.yml; it applies to every endpoint page:

docs.yml
api-reference:
  layout: split            # split: two columns (default); stacked: one column, examples below the parameters
  examples-width: 40       # percent of the examples column in two columns, 30–60, default 50
  content-width: 1100px    # maximum content width; full page width when omitted
  try-it: true             # the API explorer
  request-examples: true   # request examples
  response-examples: true  # response examples
  errors: true             # error responses
  endpoints:
    "GET /jobs/{id}":      # just this endpoint
      layout: stacked
      try-it: false
  • Keys under endpoints are METHOD /path, as in the spec; on sites with several APIs use api-name::GET /jobs/{id}.
  • To turn off the explorer for a whole API, set playground: { hidden: true } on its api entry in the navigation. Precedence: endpoint > navigation entry > site.
  • In the console: site-wide settings are under Docs settings → API reference. Open an endpoint page and use Page settings to adjust just that endpoint; everything follows the site by default.

Edit text in the editor

Open an endpoint page in the console's editor and click its title, a description, a parameter or a response to edit the text. Saving writes it back to the spec file. Only that text is replaced; comments, order and everything else stay as they are.

  • Editable text: endpoint titles and descriptions, parameter and field descriptions, response descriptions, authentication descriptions, and the group name in the breadcrumb. Types, required flags, paths and examples are read-only; change those in the spec file.
  • Text defined under components and the like is shared by every endpoint that references it. The edit box says how many endpoints it affects, and they all change when you save.
  • Clicking anywhere outside the box cancels. Unsaved text is kept and restored when you click the same text again; Cancel or Esc discards it.
  • An endpoint's title and description can also be edited in Page settings, which is where you add a description to an endpoint that has none. To describe a parameter or field that has no description yet, edit the spec file.
  • Changing a title doesn't change the URL: if the URL was generated from the title, x-fern-sdk-method-name is written along with it to keep the current one.
  • With the preview in another language, you edit the translation file and the spec stays untouched.

If your backend exports the spec, the next export overwrites these edits. Change the comments in your source code instead.

API overview page

The api node itself maps to an overview page (at the API section's URL) that lists all groups and endpoints. Its body defaults to the spec's info.description; point summary at an MDX file to customize it completely:

- api: Platform API
  api-name: platform
  openapi: openapi/platform.yml
  summary: pages/api/platform-overview.mdx

Multiple APIs

A site can have multiple api nodes, each referencing a different spec. Use api-name to tell them apart:

navigation:
  - tab: api
    layout:
      - api: Payments API
        api-name: payments
        openapi: openapi/payments.yml
      - api: Accounts API
        api-name: accounts
        openapi: openapi/accounts.yml

To show only part of a spec, filter with tags:

- api: Refunds
  api-name: payments
  openapi: openapi/payments.yml
  tags: [Refunds]

Embed endpoints in guides

Any MDX page can reference endpoints from the API reference directly, and the content stays in sync with the spec:

<EndpointRequestSnippet endpoint="POST /sites/{site}/domains" />
<EndpointResponseSnippet endpoint="POST /sites/{site}/domains" />
<EndpointSchemaSnippet endpoint="POST /sites/{site}/domains" selector="request.body" />
POST/sites/:site/domains
curl -X POST https://api.butterix.com/v1/sites/acme-payments/domains \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
         "domain": "docs.acme.com"
       }'
{
  "domain": "docs.acme.com",
  "verified": false,
  "primary": false,
  "verifyRecord": {
    "type": "TXT",
    "name": "_butterix.docs.acme.com",
    "value": "butterix-verify=a1b2c3d4e5f6"
  },
  "cname": "sites.butterix.com",
  "createdAt": 1
}

Request

This endpoint expects an object.
domainstringRequired

With multiple APIs, prefix the endpoint with api-name::, for example endpoint="payments::POST /payments". To show a schema by type:

<Schema type="Domain" />
domainstringOptional
verifiedbooleanOptional
primarybooleanOptional

Whether this is the primary domain

verifyRecordobjectOptional

TXT record to add

type"TXT"Optional
namestringOptional
valuestringOptional
cnamestringOptional

CNAME target

createdAtintegerOptional

See Components overview › API for all API components.

Download the spec

The build publishes the spec files, so readers can import them into Postman or generate SDKs, and agents can read them:

URLContent
/openapi.json, /openapi.yaml, /openapi.ymlWith one API, its spec; with several, a list of each API's id, title, and spec URLs
/openapi/<api-name>.json, .yaml, .ymlThe spec of one API
/_biti/openapi/<api-name>.yml (.json for JSON specs)The spec in its original format, for example this site's /_biti/openapi/platform.yml
/.well-known/api-catalogAPI catalog (RFC 9727): each API's spec URLs and reference page

Hidden endpoints, and the schemas and tags only they use, are left out of the published specs. Where a page of the site has one of these URLs, the page wins. On password-protected sites the specs need authorization too.