AI-generated examples

View as Markdown

Fern uses AI to automatically generate realistic request and response examples for your API Reference documentation. This feature is enabled by default for all API Reference pages. Instead of placeholder values like username: "string", you get believable data that reflects your endpoint properties and descriptions. Examples update automatically as your spec changes.

AI examples work alongside manual examples defined in x-fern-examples, with manual examples taking priority.

API Reference with placeholder string values

Configuration

Customize the style of generated examples:

docs.yml
1experimental:
2 ai-example-style-instructions: "Use names and emails that are inspired by plants."

Or disable the feature entirely:

docs.yml
1experimental:
2 ai-examples: false

AI-generated examples are written to ai_examples_overrides.yml. Edit this file to customize specific examples. To regenerate examples on each build instead, add the file to .gitignore:

.gitignore
**/ai_examples_overrides.yml