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/docs/developer-tools/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4N2MzMGY4Yy1lMDYyLTQyYjQtYjJmYi03ZjM2MzgwMzA3YWYiLCJleHAiOjE3NzU5NjQwNTcsImlhdCI6MTc3NTk2Mzc1N30.in-O29IyotqdanE8-5Z2Y_c1qlhNIcjmMaMNua3hoZg

---

***

title: Download AsyncAPI spec
description: Fern serves your AsyncAPI 2.6.0 spec from your docs site so AI tools and LLMs can discover and interact with your WebSocket API programmatically.
---------------------

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.

Fern docs sites automatically serve your raw AsyncAPI 2.6.0 specification for WebSocket channels, so anyone — or any tool — can download it for client generation, contract testing, or importing into tools that support AsyncAPI.

The spec is also linked from your site's [`llms.txt`](/learn/docs/ai-features/llms-txt), so AI coding assistants like Cursor, Copilot, and Claude can discover and use it to generate accurate WebSocket integrations.

## Available endpoints

Every Fern docs site with WebSocket channels exposes the AsyncAPI specification at these paths:

| Endpoint         | Format | Content-Type         |
| ---------------- | ------ | -------------------- |
| `/asyncapi.json` | JSON   | `application/json`   |
| `/asyncapi.yaml` | YAML   | `application/x-yaml` |
| `/asyncapi.yml`  | YAML   | `application/x-yaml` |

The spec includes all WebSocket channels with publish/subscribe messages, path parameters, query parameters, headers as WebSocket bindings, authentication schemes, type definitions as component schemas, and server URLs from your environment configuration. It's generated from the same API definition that powers your docs, so it's always up to date.

## Usage

Append the endpoint to your docs URL to download the spec:

```bash
# Download as JSON
curl https://your-docs-site.com/asyncapi.json

# Download as YAML
curl https://your-docs-site.com/asyncapi.yaml
```

If your docs site includes multiple API definitions with WebSocket channels, the endpoint returns a listing of available APIs. Use the `api` query parameter to select a specific one:

```bash
# Get a specific API's spec
curl https://your-docs-site.com/asyncapi.json?api=my-api-id
```