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
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Global headers
      • Dynamic authentication
      • Auto-pagination
      • Idempotency headers
      • Retries with backoff
  • Reference
    • generators.yml
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
  • Generated SDK behavior
  • Setting up global headers
Request behavior

Configure global headers

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Webhook signature verification

Next

Dynamic authentication

If your API requires certain headers on every request (or most requests), you can configure them as global headers. Fern will generate an SDK that accepts these headers once in the client constructor and automatically includes them in all API calls.

Generated SDK behavior

Once you configure a global header, Fern generates an SDK that accepts the header value as a constructor parameter:

1import os
2
3class Client:
4
5 def __init__(self, *, apiKey: str):

SDK users provide the value once, and the generated SDK automatically includes the header in all requests.

Setting up global headers

Fern automatically identifies headers used in every request, or the majority of requests, and marks them as global. You can manually configure additional global headers in your API definition:

openapi.yml
1x-fern-global-headers:
2 - header: custom_api_key
3 name: api_key
4 - header: userpool_id
5 optional: true

You can also pin a default value on a global header so the SDK sends it automatically when the caller doesn’t provide one.

For full configuration details, see Global headers in OpenAPI.