> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # API Explorer Fern's API Explorer allows users to make authenticated requests to your API without ever leaving your documentation. ## Autopopulate with examples Fern will automatically populate the fields of the endpoint with the values set in your API specification. Required parameters use their declared `default` (or [`x-fern-default`](/learn/api-definitions/openapi/extensions/default-values)). Optional header, query, and path parameters are left empty unless you enable [`playground.send-optional-defaults`](/learn/docs/api-references/customize-api-reference-layout#setting-api-explorer-options) in your `docs.yml`, which pre-fills their declared default and includes it in the request. Enable it when your API expects an optional header, such as a mock-response selector, on every request. ## Authentication The API Explorer supports [all authentication schemes](/learn/api-definitions/openapi/authentication) configured in your OpenAPI spec or in `generators.yml`, including multiple authentication schemes. OAuth client credentials additionally requires enabling [`playground.oauth`](/learn/docs/api-references/customize-api-reference-layout#setting-api-explorer-options) in your `docs.yml`. When multiple schemes are available, the API Explorer automatically displays them in a dropdown menu, allowing users to select and configure their preferred authentication method before sending requests. Once a user sets their authentication credentials, their credentials persist throughout their entire exploration session. Credentials stay in the browser. The Explorer keeps them in `sessionStorage` under the `playground-auth-state` key, scoped to the tab's browsing session. Fern never stores them server-side. Requests route through Fern's proxy by default, so credentials pass through the proxy in transit; [`disable-explorer-proxy`](/learn/docs/configuration/site-level-settings#settingsdisable-explorer-proxy) sends requests from the browser directly to your API instead. To automatically populate API keys for logged-in users, see [API key injection](/learn/docs/authentication/features/api-key-injection). ### Playground-only auth instructions To show guidance beneath an auth input in the API Explorer without changing the Authorization description in your API Reference, add [`x-fern-playground-description`](/learn/api-definitions/openapi/authentication#playground-only-descriptions) to the security scheme in your OpenAPI spec, or [`playground-docs`](/learn/api-definitions/ferndef/authentication) to the scheme in a Fern Definition. The text renders as an info callout and supports links, inline code, and paragraphs. **`openapi.yml`** ```yaml title="openapi.yml" {7-8} components: securitySchemes: BearerAuth: type: http scheme: bearer description: Use your account API token. x-fern-playground-description: |- Generate a short-lived token in the [dashboard](https://plantstore.example.com/tokens). ``` ## Multiple environments When multiple server URLs are configured in [OpenAPI](/learn/api-definitions/openapi/extensions/server-names-and-url-templating), users can switch between environments (e.g., production and sandbox) from a dropdown in the API Explorer. The selected environment persists as they navigate between pages. By default every configured environment appears; use the [`playground.environments`](/learn/docs/api-references/customize-api-reference-layout#setting-api-explorer-options) option in your `docs.yml` to restrict which ones are available. Users can also double-click the server URL to manually edit it, allowing for quick testing against custom environments or endpoints. Here's an example of the [Flagright docs site](https://docs.flagright.com/framl-api/api-reference/api-reference/transactions/get) with multiple server names configured. ```yaml openapi: 3.0.0 servers: - url: https://sandbox.api.flagright.com x-fern-server-name: Sandbox API server (eu-1) - url: https://sandbox-asia-1.api.flagright.com x-fern-server-name: Sandbox API server (asia-1) ``` ## WebSocket Playground For APIs that support WebSocket connections, the API Explorer includes a **WebSocket**-specific Playground. The WebSocket Playground also allows users to establish a connection with the API, and send/receive messages in real-time. ## Disable the API Explorer For OpenAPI specs, the API Explorer is enabled by default for all endpoints. To turn it off globally or per endpoint, use the [`x-fern-explorer`](/learn/api-definitions/openapi/extensions/api-explorer-control) extension. This is commonly used to disable the Explorer for destructive operations, payment processing, or admin-only endpoints. Setting [`disable-explorer-proxy`](/learn/docs/configuration/site-level-settings#settingsdisable-explorer-proxy) does not turn the Explorer off. It keeps the Explorer running and routes requests directly to your API instead of through Fern's proxy. > Reduce "time to 200" by allowing users to make real calls to your API from right within the API Reference.