> 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/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJlYzIyNDhhYi0yMWZlLTQyMWItODQ0Zi0zYTc4ZmRhMTkxZmMiLCJleHAiOjE3Nzg0OTI5NzksImlhdCI6MTc3ODQ5MjY3OX0.lV7HOEBOyYE7Ym9DQhH3prJe8Tfr9thAmq8o3y008hU
>
> 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.

# 基础路径

> 使用 `x-fern-base-path` 在 OpenAPI 中配置基础路径。为您的 API 定义设置端点前缀，如 /v1，配合 Fern 使用。

使用 `x-fern-base-path` 扩展来配置添加到每个端点前面的基础路径。

下面的示例配置了 `/v1` 基础路径，因此完整的端点路径是
`https://api.example.com/v1/users`。

```yaml title="在 openapi.yml 中设置基础路径" {1}
x-fern-base-path: /v1
servers:
  - url: https://api.example.com
paths:
  /users: ...
```