| title | Extensions overview |
|---|---|
| headline | Extensions overview (OpenAPI) |
| description | Learn about OpenAPI extensions in Fern. Customize authentication, SDK methods, versioning, and more for better API specs. |
Fern supports a variety of OpenAPI extensions that enhance your API specification and generate higher-quality SDKs and CLIs.
You can apply these extensions in two ways: by overlaying them in a separate file or by embedding them directly in your OpenAPI specification. See Overlays for more information.
The table below shows all available extensions and links to detailed documentation for each one.
| Extension | Description |
|---|---|
x-fern-version |
Configure API version schemes and headers |
x-fern-audiences |
Filter endpoints, schemas, and properties by audience |
x-fern-basic |
Customize basic authentication parameter names and environment variables |
x-fern-bearer |
Customize bearer authentication parameter names and environment variables |
x-fern-availability |
Mark availability status (beta, generally-available, deprecated) |
x-fern-base-path |
Set base path prepended to all endpoints |
x-fern-default |
Set client-side default values for path, header, and query parameters |
x-fern-discriminator-context |
Distinguish protocol-level discriminators (e.g., SSE event types) from data-level discriminators |
x-displayName |
Specify how tag names display in your API Reference |
x-fern-enum |
Add descriptions, custom names, and deprecation status to enum values |
x-fern-examples |
Associate request and response examples |
x-fern-explorer |
Control API Explorer (playground) availability globally or per endpoint |
x-fern-global-headers |
Configure headers used across all endpoints |
x-fern-global-parameters |
Configure parameters set once and injected into every relevant request |
x-fern-header |
Customize API key header authentication parameter names and environment variables |
x-fern-idempotent |
Mark an endpoint as idempotent |
x-fern-idempotency-headers |
Configure idempotency headers for safe request retries |
x-fern-ignore |
Skip reading specific endpoints or schemas |
x-fern-pagination |
Configure auto-pagination for list endpoints |
x-fern-sdk-method-name |
Customize SDK method names |
x-fern-sdk-group-name |
Organize methods into SDK groups |
x-fern-sdk-variables |
Set common path parameters across all requests |
x-fern-sdk-namespace |
Namespace schemas to prevent name collisions when combining multiple API specs |
x-fern-parameter-name |
Customize parameter variable names |
x-fern-property-name |
Customize object property variable names |
x-fern-retries |
Configure retry behavior for endpoints |
x-fern-streaming |
Configure streaming endpoints (JSON or SSE) |
x-fern-type-name |
Override auto-generated names for inline schemas |
x-fern-default-url |
Provide a static fallback URL for templated server URLs |
x-fern-server-name |
Name your servers and configure URL templating |
x-fern-webhook |
Define webhooks in OpenAPI 3.0 specifications |
x-fern-webhook-signature |
Configure webhook signature verification for HMAC or asymmetric validation |
FastAPI allows you to add extensions directly in your route decorators and models. See our FastAPI integration guide for detailed examples.