> This page is for SDK, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 4.55.0

**`(feat):`** 添加对使用 OpenAPI 服务器变量的服务器 URL 模板的支持。这使得能够基于用户提供的配置在运行时动态构建基础 URL。

**OpenAPI 定义示例：**

```yaml
servers:
  - url: https://api.{region}.{environment}.example.com/v1
    variables:
      region:
        default: us-east-1
        enum: [us-east-1, us-west-2, eu-west-1]
      environment:
        default: prod
        enum: [prod, staging, dev]
```

**生成的构造函数参数：**
服务器变量作为可选构造函数参数暴露，带有其默认值：

* `region: typing.Optional[str]` - 默认为 `"us-east-1"`
* `server_url_environment: typing.Optional[str]` - 默认为 `"prod"`（添加前缀以避免遮蔽）

**运行时 URL 插值：**
当提供服务器变量时，SDK 执行运行时 URL 模板插值：

```python
from seed import SeedApi

# 使用默认值：https://api.us-east-1.prod.example.com/v1
client = SeedApi()

# 自定义区域：https://api.eu-west-1.prod.example.com/v1
client = SeedApi(region="eu-west-1")

# 自定义区域和环境：https://api.us-west-2.staging.example.com/v1
client = SeedApi(region="us-west-2", server_url_environment="staging")
```

**多个基础 URL 环境：**
对于具有多个基础 URL 的 API（如单独的 `base` 和 `auth` URL），每个 URL 模板都使用相同的服务器变量独立插值。

**`x-fern-default-url` 扩展：**
当在 OpenAPI 规范中存在时，此扩展指定应该使用哪个服务器 URL 作为默认环境，覆盖列表中的第一个服务器。

## 4.54.4

**`(fix):`** `use_provided_defaults` 配置选项不再对内联请求体属性应用默认值。