Skip to main content
Use the api field in docs.json to configure what API specifications are available to generate API pages from; the interactive API playground users can test API endpoints with; and how to generate and display code examples.

Settings

api

Type: object Define all API-related settings under the api key.
api.openapi
string or array or object
OpenAPI specification files for generating API reference pages. Accepts a single path or URL, an array of paths and URLs, or an object specifying a source and directory.
"openapi": "openapi.json"
api.asyncapi
string or array or object
AsyncAPI specification files for generating event-driven API reference pages. Accepts a single path or URL, an array of paths and URLs, or an object specifying a source and directory.
"asyncapi": "asyncapi.json"
api.playground
object
Interactive API playground settings.
api.params
object
Display settings for API parameters.
api.url
"full"
Display mode for the base URL in the endpoint header. Set to full to always show the complete base URL on every endpoint page. By default, the base URL is only shown when there are multiple base URLs to select from.
api.examples
object
Settings for autogenerated API code examples.
api.spec
object
OpenAPI specification display settings. Including the download button on API reference pages.
api.mdx
object
Settings for API pages built from MDX files rather than OpenAPI specs.

Example

docs.json
{
  "api": {
    "openapi": ["openapi/v1.json", "openapi/v2.json"],
    "playground": {
      "display": "interactive"
    },
    "params": {
      "expanded": "all"
    },
    "url": "full",
    "examples": {
      "languages": ["curl", "python", "javascript", "go"],
      "defaults": "required",
      "prefill": true,
      "autogenerate": true
    },
    "spec": {
      "download": true
    }
  }
}