Download OpenAPI spec

View as Markdown

Fern docs sites automatically serve your raw OpenAPI 3.1 specification, so anyone — or any tool — can download it for SDK generation, contract testing, or importing into tools like Postman.

The spec is also linked from your site’s llms.txt, so AI coding assistants like Cursor, Copilot, and Claude can discover and use it to generate accurate API calls and build integrations.

Available endpoints

Every Fern docs site exposes the OpenAPI specification at these paths:

EndpointFormatContent-Type
/openapi.jsonJSONapplication/json
/openapi.yamlYAMLapplication/x-yaml
/openapi.ymlYAMLapplication/x-yaml

The spec includes all endpoints with request/response schemas, authentication schemes (Bearer, Basic, API Key, OAuth), webhooks, type definitions as component schemas, and server URLs from your environment configuration. It’s generated from the same API definition that powers your docs, so it’s always up to date.

Usage

Append the endpoint to your docs URL to download the spec:

$# Download as JSON
$curl https://your-docs-site.com/openapi.json
$
$# Download as YAML
$curl https://your-docs-site.com/openapi.yaml

If your docs site includes multiple API definitions, the endpoint returns a listing of available APIs. Use the api query parameter to select a specific one:

$# Get a specific API's spec
>curl https://your-docs-site.com/openapi.json?api=my-api-id