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
      • Overlays
      • Overrides
      • Authentication
      • Servers
      • Sync your specification
      • generators.yml reference
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
  • Naming your servers
  • Multiple base URLs for a single API
OpenAPI

Servers

Define server URLs and environments to help users connect to your API.
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Authentication

Next

Sync your OpenAPI specification

OpenAPI allows you to specify one or more base URLs under the servers key.

openapi.yml
1servers:
2 - url: https://api.yourcompany.com/
3 - url: https://api.eu.yourcompany.com/

Specifying servers is valuable for both SDKs and Docs:

  • For SDKs, your users won’t need to manually specify the baseURL at client instantiation
  • For Docs, your API playground will automatically hit the correct server

Naming your servers

If you have more than one server, we recommend specifying an x-fern-server-name to name the server.

openapi.yml
1servers:
2 - x-fern-server-name: Production
3 url: https://api.yourcompany.com/
4 - x-fern-server-name: Production_EU
5 url: https://api.eu.yourcompany.com/

Multiple base URLs for a single API

If you have a microservice architecture, it is possible that you may have different endpoints hosted at different URLs. For example, your AI endpoints might be hosted at ai.yourcompany.com and the rest of your endpoints might be hosted at api.yourcompany.com.

To specify this, you will need to add configuration to both your generators.yml and OpenAPI spec. The snippet directly below shows how to configure an environment with multiple urls in your generators.yml.

generators.yml
1api:
2 default-environment: Production
3 default-url: api
4 environments:
5 Production:
6 api: api.yourcompany.com
7 ai: ai.yourcompany.com
8 specs:
9 - openapi: ./path/to/your/openapi
10 overrides: ./path/to/your/overrides # optional

Once you’ve specified the environments in your generators.yml, you can use the x-fern-server-name extension to specify which server the operation belongs to.

openapi.yml
1paths:
2 /chat:
3 post:
4 x-fern-server-name: ai

If you have multiple environments like development or staging, you can model those in your generators.yml as well.

generators.yml
1api:
2 default-environment: Production
3 default-url: api
4 environments:
5 Production:
6 api: api.yourcompany.com
7 ai: ai.yourcompany.com
8 Staging:
9 api: api.staging.yourcompany.com
10 ai: ai.staging.yourcompany.com
11 Dev:
12 api: api.dev.yourcompany.com
13 ai: ai.dev.yourcompany.com
To see an example of this in production, check out the Chariot generators.yml