Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
June 9, 2023 16:04
December 4, 2023 14:02
March 26, 2023 04:21
November 24, 2023 09:10
June 9, 2023 16:04
November 24, 2023 09:01
May 17, 2022 11:04
November 19, 2023 11:01
May 18, 2023 16:11
July 7, 2023 11:25
November 24, 2023 09:10



YC License

Discord Documentation

Fern is an open-source toolkit that simplifies the design, build, and consumption of REST APIs. It allows you to effortlessly generate SDKs, API documentation, and backend server boilerplate.

Overview Diagram

Getting started

Note: Fern requires Node 18 or higher

The Fern toolkit is available as a command line interface (CLI). To install it, run:

npm install -g fern-api

To create a starter project, navigate to the root of your repository and run:

fern init

This will initialize a Fern workspace in the current folder, including the ./fern directory that Fern will use to hold its resources.

Note: to initialize a starter project from an existing OpenAPI spec, see Starting from OpenAPI.

This will create the following folder structure in your project:

β”œβ”€ fern.config.json # root-level configuration
β”œβ”€ generators.yml # generators you're using
└─ definition/
  β”œβ”€ api.yml  # API-level configuration
  └─ imdb.yml # endpoints, types, and errors

Here's what the imdb.yml starter file looks like:

  MovieId: string

      id: MovieId
      title: string
        type: double
        docs: The rating scale is one to five stars

      title: string
      rating: double

  auth: false
  base-path: /movies
      docs: Add a movie to the database
      method: POST
      path: /create-movie
      request: CreateMovieRequest
      response: MovieId

      method: GET
      path: /{movieId}
        movieId: MovieId
      response: Movie
        - MovieDoesNotExistError

    status-code: 404
    type: MovieId

Starting from OpenAPI

If you have an existing OpenAPI definition, you can use that as your starting point by specifying the --openapi option:

fern init --openapi ./path/to/openapi.yml
# or
fern init --openapi

This will generate an OpenAPI-based Fern project:

β”œβ”€ fern.config.json
β”œβ”€ generators.yml # generators you're using
└─ openapi/
  └─ openapi.json # your openapi definition


REST APIs underpin the internet but are still painful to work with. They are often untyped, unstandardized, and out-of-sync across multiple sources of truth. With Fern, we aim to bring great developer experiences to REST APIs.

Fern is fully compatible with OpenAPI, allowing the use of existing OpenAPI specifications. It's designed to augment, not replace, your current OpenAPI toolchains and workflows.


The Fern CLI can generate the following types of artifacts:

🌿 SDKs

Generate idiomatic SDKs (client libraries). Fern keeps your SDKs synchronized with your backend, eliminating the need to manually maintain your SDKs as your API changes. Fern can publish your SDKs to registries, like npm, Maven, and PyPI.

Currently, the following languages are supported:

For additional language support, visit the Fern issues and let us know!

🌿 API Documentation

Fern will build and host a documentation website with an auto-generated API reference. Write additional pages in markdown and have them versioned with git. Search, SEO, dark mode, and popular components are provided out-of-the-box. Plus, you can customize the colors, font, logo, and domain name.

Check out docs built with Fern:

🌿 Server boilerplate

Define your API, and Fern will generate models, networking code and boilerplate application code. The generated code adds type safety to your API implementation - if your backend doesn't implement the API correctly, it won't compile.

Frameworks currently supported:

For a walkthrough, check out the Fern + Express video.

Customer Showcase

See how developer-focused companies benefit from Fern.

Customer Showcase

CLI Commands

Here's a quick look at the most popular CLI commands. View the documentation for all CLI commands.

fern init: adds a new starter API to your repository.

fern check: validate your API definition and Fern configuration.

fern generate: run the generators specified in generators.yml.

fern add <generator>: include a new generator in your generators.yml. For example, fern add fern-python-sdk.


Join our Discord! We are here to answer questions and help you get the most out of Fern.


We welcome community contributions. For guidelines, refer to our

Fern Contributors