> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # Generate REST API Reference > Use Fern Docs to generate REST API Reference documentation from an OpenAPI spec. Fern generates REST API Reference documentation from an [OpenAPI specification](/learn/api-definitions/openapi/overview). Once the API definition is set up, adding it to the docs takes just one line of configuration. Fern also supports [gRPC](/learn/docs/api-references/generate-grpc-ref), [WebSocket](/learn/docs/api-references/generate-websocket-ref), [OpenRPC](/learn/docs/api-references/generate-openrpc-ref), and [Webhook](/learn/docs/api-references/generate-webhook-ref) references. ## Configuration #### Set up your project structure Add your specification file to your `/fern` directory and create a `generators.yml` that references it in the `api.specs` section: **`generators.yml`** ```yaml generators.yml api: specs: - openapi: "./openapi.yml" ``` #### Add the API Reference to your navigation Add `- api: API Reference` to your navigation in `docs.yml`: **`docs.yml`** ```yml docs.yml navigation: - api: API Reference ``` Fern will automatically populate your endpoints, types, and code snippets from your API definition. Request and response examples are [generated using AI](/learn/docs/ai-features/ai-examples) to show realistic data instead of placeholder values. #### Customize the layout For a full list of configuration options and layout customizations, see [Customize API Reference layout](/learn/docs/api-references/customize-api-reference-layout). ### Include more than one API Reference To include multiple, distinct API definitions in your documentation, use the `api-name` property. The `api-name` corresponds to the folder name containing your API definition. For example: #### Flat layout For a simple setup without tabs, you can include multiple API References directly in your navigation: **`docs.yml`** ```yaml title="docs.yml" navigation: - api: Plant Store api-name: plant-api # Matches folder name containing your API definition - api: Garden api-name: garden-api # Matches folder name containing your API definition ``` #### Tabbed layout When using tabs, each API Reference must be placed within a tab's `layout`: **`docs.yml`** ```yaml title="docs.yml" {12, 17} tabs: plant-api: display-name: Plant Store API icon: leaf garden-api: display-name: Garden API icon: tree navigation: - tab: plant-api # References the tab defined above layout: - api: Plant Store API api-name: plant-api # Matches folder name containing your API definition skip-slug: true - tab: garden-api # References the tab defined above layout: - api: Garden API api-name: garden-api # Matches folder name containing your API definition skip-slug: true ``` > Use Fern Docs to generate REST API Reference documentation from an OpenAPI spec.