# Use audiences to filter your API

> Learn how to use x-fern-audiences to filter OpenAPI endpoints, schemas, and properties for different API consumers like public and beta users.

<Warning title="Pro and Enterprise feature">
  This feature is available only for the [Pro and Enterprise plans](https://buildwithfern.com/pricing). To get started, reach out to [support@buildwithfern.com](mailto:support@buildwithfern.com).
</Warning>

Audiences are a useful tool for segmenting your API for different consumers. Common examples of audiences include `public`
and `beta`.

<Info>
  Remember to filter your SDKs and Docs after specifying audiences. If **no audiences** are specified,
  nothing will be filtered.

  <AccordionGroup>
    <Accordion title="SDKs">
      The following example configures the SDK to filter to the `public` audience:

      ```yaml title="generators.yml" {3-4}
      groups:
        sdks:
          audiences:
            - public
          generators:
            - name: fernapi/fern-typescript-sdk
              version: 0.8.8
      ```
    </Accordion>

    <Accordion title="Docs">
      The following example configures the docs to filter to the `public` audience:

      ```yaml title="docs.yml" {3-4}
      navigation:
        - api: API Reference
          audiences:
            - public
      ```
    </Accordion>
  </AccordionGroup>
</Info>

## Audiences for servers

To mark a server with a particular audience, add the `x-fern-server-name` and `x-fern-audiences` extension to the relevant server.

In the example below, the `Production` server is only available to public consumers:

```yaml title="openapi.yml" {3-5}
servers:
  - url: https://api.com
    x-fern-server-name: Production
    x-fern-audiences:
      - public
```

## Audiences for endpoints

To mark an endpoint with a particular audience, add the `x-fern-audiences` extension to the relevant endpoint.

In the example below, the `POST /users/sendEmail` endpoint is only available to public consumers:

```yaml title="openapi.yml" {4-5}
paths:
  /users/sendEmail:
    post:
      x-fern-audiences:
        - public
      operationId: send_email
```

## Audiences for schemas

Schemas can be marked for different audiences, as well.

In this example, the `Email` type is available to both public and beta customers.

```yaml title="openapi.yml" {13-15}
components:
  schemas:
    Email:
      title: Email
      type: object
      properties:
        subject:
          type: string
        body:
          type: string
        to:
          type: string
      x-fern-audiences:
        - public
        - beta
```

## Audiences for properties

Properties can be marked for different audiences, as well.

In this example, the `to` property is available to beta customers only.

```yaml title="openapi.yml" {13-17}
components:
  schemas:
    Email:
      title: Email
      type: object
      properties:
        subject:
          type: string
        body:
          type: string
        to:
          type: string
          x-fern-audiences:
            - beta
```