> 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.

## 3.23.0

**`(feat):`** 添加具有编译时安全分阶段构建器模式的 OAuth 令牌重写支持。当配置 `oauth-token-override: true` 时，SDK 用户可以在 OAuth 客户端凭据流或直接提供预生成的承载令牌之间选择。

配置示例：

```yaml
config:
  oauth-token-override: true
```

生成的使用方式：

```java
// 选项 1：直接承载令牌（绕过 OAuth 流）
SeedApiClient client = SeedApiClient.withToken("my-pre-generated-bearer-token")
    .url("https://api.example.com")
    .build();

// 选项 2：OAuth 客户端凭据流（自动令牌管理）
SeedApiClient client = SeedApiClient.withCredentials("your-client-id", "your-client-secret")
    .url("https://api.example.com")
    .build();
```

## 3.22.0

**`(feat):`** 添加对推断认证方案的支持。推断认证允许 SDK 使用 `scheme: bearer` 和 `get-token` 配置从自定义（非 OAuth）令牌端点自动获取令牌。生成的 `InferredAuthTokenSupplier` 类处理令牌缓存和在过期前 2 分钟缓冲时间的自动刷新。

配置示例：

```yaml
auth:
  scheme: bearer
  get-token:
    endpoint: POST auth.retrieveToken
```

生成的使用方式：

```java
SeedApiClient client = SeedApiClient.builder()
    .apiKey("your-api-key")
    .build();
// 令牌会根据需要自动获取和刷新
```