Use audiences to filter your API
Use x-fern-audiences to filter to relevant methods, parameters and schemas
Audiences are a useful tool for segmenting your JSON-RPC API for different consumers. Common examples of audiences include public
and beta.
Tag methods, parameters, and schemas with x-fern-audiences, then filter each output to those audiences: SDKs in generators.yml and your API Reference in docs.yml. Untagged elements are always included; if you don’t specify audiences, nothing is filtered.
Filter methods
Add x-fern-audiences to methods to control which methods are included for specific audiences:
Filter method parameters
You can filter specific parameters within methods:
Filter schemas
Filter entire schemas to different audiences:
Filter schema properties
You can filter individual properties within schemas:
Filter error responses
Filter error information based on audience:
Server-level filtering
Apply audience filtering at the server level:
Conditional method availability
Use audiences to make methods available only in certain contexts:
This allows you to create different views of the same JSON-RPC API for different types of consumers, ensuring each audience only sees the methods and data relevant to their use case.