> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api-definitions/openapi/extensions/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiIzZWM1NGQwMS1mNzdkLTRkNWUtYTdiMy1mMGUyMmQwYjJlMzUiLCJleHAiOjE3NzczNDAyNjksImlhdCI6MTc3NzMzOTk2OX0.kWrUYi4kJbecSxNvBQy3WWSU0N2XaiAeclQnaqwCen8
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Default values

> Use `x-fern-default` to set client-side default values for path, header, and query parameters in generated SDKs.

The `x-fern-default` extension lets you specify a client-side default value for a path, header, or query parameter, including headers defined under [`x-fern-global-headers`](/learn/api-definitions/openapi/extensions/global-headers). When present, the generated SDK makes the parameter optional and automatically sends the default value if the caller omits it. `x-fern-default` supports `string` and `boolean` values; other types (such as numbers) are ignored.

This is useful for pinning an API version header or a region path parameter while still allowing callers to override the value.

<Note title="Supported languages">
  `x-fern-default` is supported for TypeScript, Python, Go, Java, C#, PHP, and Ruby SDKs.
</Note>

## Path parameters

In the example below, the SDK sends `us-east-1` for `region` when the caller doesn't specify one.

```yaml {9} title="openapi.yml"
paths:
  /regions/{region}/resources:
    get:
      operationId: list_resources
      parameters:
        - name: region
          in: path
          required: true
          x-fern-default: "us-east-1"
          schema:
            type: string
```

## Headers

In the example below, the SDK sends `2024-02-08` for `X-API-Version` when the caller doesn't specify one.

```yaml {8} title="openapi.yml"
paths:
  /users:
    get:
      operationId: list_users
      parameters:
        - name: X-API-Version
          in: header
          x-fern-default: "2024-02-08"
          schema:
            type: string
```

## Query parameters

In the example below, the SDK sends `false` for `verbose` when the caller doesn't specify one.

```yaml {8} title="openapi.yml"
paths:
  /search:
    get:
      operationId: search
      parameters:
        - name: verbose
          in: query
          x-fern-default: false
          schema:
            type: boolean
```

## Global headers

In the example below, the SDK sends `2024-02-08` for the `X-API-Version` global header when the caller doesn't specify one.

```yaml {4} title="openapi.yml"
x-fern-global-headers:
  - header: X-API-Version
    name: version
    x-fern-default: "2024-02-08"
```