This is what an AI/RAG pipeline sees when it indexes this page — the same output served at https://camelmind-docs.vercel.app/api/llms/features/api-reference.Back to doc

Rendered doc

API Reference

Add an interactive OpenAPI-powered API reference to your CamelMind documentation site.

CamelMind can generate a fully interactive API reference from an OpenAPI 3.x specification. Once enabled, your API reference is automatically added to the top navigation and stays in sync with your documentation.

Features include:

  • Interactive endpoint documentation
  • Built-in request and response examples
  • Multi-language code samples
  • Support for multiple OpenAPI specifications
  • Role-based access control
  • Version-specific API references

Before you begin

You'll need an OpenAPI 3.x specification in either YAML or JSON format.

For example:

text
openapi/
└── openapi.yaml

Enable the interactive OpenAPI reference

To enable the interactive API reference in CamelMind:

  1. Configure your OpenAPI specifications in camelmind.config.ts.
  2. Associate an API specification with each documentation version in versions.yml.
1

Configure your API specifications

Open camelmind.config.ts and enable the API Reference.

ts
const config: CamelMindConfig = {
  apiReference: {
    enabled: true,

    navLabel: "API Reference",

    specs: {
      main: {
        label: "REST API",
        file: "openapi/openapi.yaml",
      },
    },
  },
}

This registers the available OpenAPI specifications for your documentation site.

2

Associate a spec with a documentation version

Open versions.yml and specify which API specification should be displayed for each version.

yaml
versions:
  - id: "latest"
    label: "Latest"
    stable: true
    nav: nav/nav.yml

    api_reference:
      spec: main

Add multiple API specifications

If your documentation includes multiple APIs—for example, a public API and a partner API—you can publish multiple OpenAPI specifications as tabs within the same API Reference.

First, register each spec in camelmind.config.ts:

ts
apiReference: {
  enabled: true,

  navLabel: "API Reference",

  specs: {
    main: {
      label: "REST API",
      file: "openapi/openapi.yaml",
    },
    partner: {
      label: "Partner API",
      file: "openapi/openapi-partner.yaml",
    },
  },
},

Then configure the tabs for each documentation version in versions.yml:

yaml
versions:
  - id: "latest"
    label: "Latest"
    stable: true
    nav: nav/nav.yml

    api_reference:
      tabs:
        - id: main
          spec: main

        - id: partner
          spec: partner

Each tab's spec value must match one of the specification IDs defined in apiReference.specs.

When users open the API Reference, they can switch between the available API specifications using the tabs at the top of the page.

See it in action

This documentation site registers two OpenAPI specifications—main and partner—and publishes them as tabs in the same API Reference page: REST API and Partner API.


Customize API reference code sample languages

To specify which programming languages appear in the generated API reference code samples, configure the languages array in camelmind.config.ts:

ts
apiReference: {
  languages: [
    "curl",
    "javascript",
    "python",
  ],
}

By default, CamelMind displays code samples for:

  • curl
  • JavaScript
  • Python

Restrict API reference access with user roles

To restrict access to the API reference, specify the required user roles in camelmind.config.ts:

ts
apiReference: {
  roles: [
    "developer",
    "admin",
  ],
}

When you leave roles empty ([]), CamelMind allows public access to the entire API reference.

Note

Role restrictions apply to the entire API reference. You cannot currently restrict individual endpoints independently.


Use different API specs for each documentation version

If your documentation uses versioning, each version can display its own OpenAPI specification.

First, register each version's spec in camelmind.config.ts:

ts
apiReference: {
  enabled: true,

  specs: {
    v2: {
      label: "API v2",
      file: "openapi/v2.yaml",
    },
    v1: {
      label: "API v1",
      file: "openapi/v1.yaml",
    },
  },
},

Then reference the matching spec ID for each version in versions.yml:

yaml
versions:
  - id: v2
    label: v2 (Latest)
    stable: true
    nav: nav/nav-v2.yml

    api_reference:
      spec: v2

  - id: v1
    label: v1
    nav: nav/nav-v1.yml

    api_reference:
      spec: v1

When users switch documentation versions, CamelMind automatically loads the corresponding API specification.


API reference configuration options

Use these configuration options in camelmind.config.ts to customize your API reference settings:

FieldDescription
enabledEnables the API Reference.
navLabelText displayed in the top navigation. Default: API Reference.
specsOne or more OpenAPI specifications to publish.
languagesLanguages shown for generated code samples.
rolesRoles required to access the API Reference. Empty ([]) makes it public.

Supported OpenAPI specification formats

CamelMind supports OpenAPI 3.x specifications in both YAML and JSON formats.

Example OpenAPI 3.1 specification:

yaml
openapi: "3.1.0"

info:
  title: My API
  version: "1.0.0"

paths:
  /users:
    get:
      summary: List users
Note

The offline package includes the fully rendered API Reference for the downloaded documentation version. Any API references that are accessible on the live site are included in the offline package, allowing you to browse endpoints, request and response schemas, and code samples without signing in or connecting to the internet.

What the AI sees

1> For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.
2 
3CamelMind can generate a fully interactive API reference from an OpenAPI 3.x specification. Once enabled, your API reference is automatically added to the top navigation and stays in sync with your documentation.
4 
5Features include:
6 
7- Interactive endpoint documentation
8- Built-in request and response examples
9- Multi-language code samples
10- Support for multiple OpenAPI specifications
11- Role-based access control
12- Version-specific API references
13 
14---
15 
16<Callout type="important" title="Before you begin">
17 
18You'll need an OpenAPI 3.x specification in either YAML or JSON format.
19 
20For example:
21 
22```text
23openapi/
24└── openapi.yaml
25```
26</Callout>
27 
28## Enable the interactive OpenAPI reference
29 
30To enable the interactive API reference in CamelMind:
31 
321. Configure your OpenAPI specifications in `camelmind.config.ts`.
332. Associate an API specification with each documentation version in `versions.yml`.
34 
35<Steps>
36 <Step n={1} title="Configure your API specifications">
37 Open `camelmind.config.ts` and enable the API Reference.
38 
39```ts
40const config: CamelMindConfig = {
41 apiReference: {
42 enabled: true,
43 
44 navLabel: "API Reference",
45 
46 specs: {
47 main: {
48 label: "REST API",
49 file: "openapi/openapi.yaml",
50 },
51 },
52 },
53}
54```
55 
56This registers the available OpenAPI specifications for your documentation site.
57 </Step>
58 <Step n={2} title="Associate a spec with a documentation version">
59 Open `versions.yml` and specify which API specification should be displayed for each version.
60 
61```yaml
62versions:
63 - id: "latest"
64 label: "Latest"
65 stable: true
66 nav: nav/nav.yml
67 
68 api_reference:
69 spec: main
70```
71 </Step>
72</Steps>
73 
74---
75 
76## Add multiple API specifications
77 
78If your documentation includes multiple APIs—for example, a public API and a partner API—you can publish multiple OpenAPI specifications as tabs within the same API Reference.
79 
80First, register each spec in `camelmind.config.ts`:
81 
82```ts
83apiReference: {
84 enabled: true,
85 
86 navLabel: "API Reference",
87 
88 specs: {
89 main: {
90 label: "REST API",
91 file: "openapi/openapi.yaml",
92 },
93 partner: {
94 label: "Partner API",
95 file: "openapi/openapi-partner.yaml",
96 },
97 },
98},
99```
100 
101Then configure the tabs for each documentation version in `versions.yml`:
102 
103```yaml
104versions:
105 - id: "latest"
106 label: "Latest"
107 stable: true
108 nav: nav/nav.yml
109 
110 api_reference:
111 tabs:
112 - id: main
113 spec: main
114 
115 - id: partner
116 spec: partner
117```
118 
119Each tab's `spec` value must match one of the specification IDs defined in `apiReference.specs`.
120 
121When users open the API Reference, they can switch between the available API specifications using the tabs at the top of the page.
122 
123<Callout type="note" title="See it in action">
124This documentation site registers two OpenAPI specifications—`main` and `partner`—and publishes them as tabs in the same API Reference page: [REST API](/api-reference/main) and [Partner API](/api-reference/partner).
125</Callout>
126 
127---
128 
129## Customize API reference code sample languages
130 
131To specify which programming languages appear in the generated API reference code samples, configure the `languages` array in `camelmind.config.ts`:
132 
133```ts
134apiReference: {
135 languages: [
136 "curl",
137 "javascript",
138 "python",
139 ],
140}
141```
142 
143By default, CamelMind displays code samples for:
144 
145- curl
146- JavaScript
147- Python
148 
149---
150 
151## Restrict API reference access with user roles
152 
153To restrict access to the API reference, specify the required user roles in `camelmind.config.ts`:
154 
155```ts
156apiReference: {
157 roles: [
158 "developer",
159 "admin",
160 ],
161}
162```
163 
164When you leave `roles` empty (`[]`), CamelMind allows public access to the entire API reference.
165 
166<Callout type="note">
167Role restrictions apply to the entire API reference. You cannot currently restrict individual endpoints independently.
168</Callout>
169 
170---
171 
172## Use different API specs for each documentation version
173 
174If your documentation uses versioning, each version can display its own OpenAPI specification.
175 
176First, register each version's spec in `camelmind.config.ts`:
177 
178```ts
179apiReference: {
180 enabled: true,
181 
182 specs: {
183 v2: {
184 label: "API v2",
185 file: "openapi/v2.yaml",
186 },
187 v1: {
188 label: "API v1",
189 file: "openapi/v1.yaml",
190 },
191 },
192},
193```
194 
195Then reference the matching spec ID for each version in `versions.yml`:
196 
197```yaml
198versions:
199 - id: v2
200 label: v2 (Latest)
201 stable: true
202 nav: nav/nav-v2.yml
203 
204 api_reference:
205 spec: v2
206 
207 - id: v1
208 label: v1
209 nav: nav/nav-v1.yml
210 
211 api_reference:
212 spec: v1
213```
214 
215When users switch documentation versions, CamelMind automatically loads the corresponding API specification.
216 
217---
218 
219## API reference configuration options
220 
221Use these configuration options in `camelmind.config.ts` to customize your API reference settings:
222 
223| Field | Description |
224|------|-------------|
225| `enabled` | Enables the API Reference. |
226| `navLabel` | Text displayed in the top navigation. Default: `API Reference`. |
227| `specs` | One or more OpenAPI specifications to publish. |
228| `languages` | Languages shown for generated code samples. |
229| `roles` | Roles required to access the API Reference. Empty (`[]`) makes it public. |
230 
231---
232 
233## Supported OpenAPI specification formats
234 
235CamelMind supports **OpenAPI 3.x** specifications in both YAML and JSON formats.
236 
237Example OpenAPI 3.1 specification:
238 
239```yaml
240openapi: "3.1.0"
241 
242info:
243 title: My API
244 version: "1.0.0"
245 
246paths:
247 /users:
248 get:
249 summary: List users
250```
251 
252<Callout type="note">
253The offline package includes the fully rendered API Reference for the downloaded documentation version. Any API references that are accessible on the live site are included in the offline package, allowing you to browse endpoints, request and response schemas, and code samples without signing in or connecting to the internet.
254</Callout>

Issues (1)

Notes (1)