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
        • Overview
        • API version
        • Audiences
        • Availability
        • Base path
        • Default values
        • Enum descriptions, names, and availability
        • Request + response examples
        • API Explorer control
        • Global headers
        • Ignoring elements
        • SDK method names
        • SDK variables
        • Tag display names
        • Parameter names
        • Property names
        • Idempotency
        • Pagination
        • Retry behavior
        • Schema names
        • Server names and URL templating
      • 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
  • Configuration
  • SDK usage
OpenAPIExtensions

SDK variables

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

Customize SDK method names

Next

Tag display names

The x-fern-sdk-variables extension allows you to define variables that are set once during SDK client initialization and automatically used in path parameters across all endpoint calls. This is useful for common parameters like tenant IDs, organization IDs, or environment identifiers that appear in many endpoint paths.

SDK variables are supported in TypeScript (v2.6.3+), Python (v4.24.0+), and Java (v3.6.3+). Only string types are supported.

Configuration

Define variables at the document level using x-fern-sdk-variables, then mark path parameters as variables using x-fern-sdk-variable:

openapi.yml
1x-fern-sdk-variables:
2 gardenId:
3 type: string
4 description: The unique identifier for your garden
5 zoneId:
6 type: string
7 description: The zone within the garden
8
9paths:
10 /gardens/{gardenId}/zones/{zoneId}/plants:
11 get:
12 operationId: list_plants_in_zone
13 parameters:
14 - name: gardenId
15 in: path
16 required: true
17 x-fern-sdk-variable: gardenId
18 schema:
19 type: string
20 - name: zoneId
21 in: path
22 required: true
23 x-fern-sdk-variable: zoneId
24 schema:
25 type: string

SDK usage

Variables become required constructor parameters instead of being passed to individual method calls:

1const client = new PlantClient({
2 gardenId: "garden_123",
3 zoneId: "zone_456",
4 apiKey: "your-api-key"
5});
6
7const plants = await client.listPlantsInZone();