For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • What is an API definition?
    • Project structure
      • Overview
      • Authentication
      • Types
        • Packages
        • Depending on other APIs
        • Export to OpenAPI
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Registering the dependency API
  • Depending on the registered API
Fern DefinitionIntegrations

Depending on other APIs

Import API Definitions to generate unified SDKs
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Packages in Fern Definition

Next

Export from Fern Definition to OpenAPI

Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.

Fern allows you to import other APIs into your API.

This is often useful if:

  • you want to reuse another API’s types in your API
  • you want to combine multiple microservices’ APIs into one SDK (similar to the AWS SDK)

Registering the dependency API

The first step is to register the API you want to depend on. To do this, use the register command:

$ fern register
[some-dependency]: Uploading definition...
[some-dependency]: Registered @fern/some-dependency:0.0.1

Depending on the registered API

To add a dependency on another API, you must add a dependencies.yml to declare which APIs you wish to depend on.

fern
fern.config.json
generators.yml
dependencies.yml
definition
api.yml
imdb.yml

Your dependencies.ymlhas a list of all the APIs you wish to depend:

dependencies.yml
1dependencies:
2 "@fern/some-dependency": "0.0.1"

Next, you need create a folder in your Fern Definition to house the dependency. Inside the folder, create a special file __package__.yml which specifies the dependency and version you want to add.

fern
fern.config.json
generators.yml
dependencies.yml
definition
api.yml
imdb.yml
my-folder
__package__.yml
__package__.yml
1export:
2 dependency: "@fern/some-dependency"

When you generate the SDK with fern generate, the __package__.yml file will effectively be replaced with the API you’re depending on.