> ## Documentation Index
> Fetch the complete documentation index at: https://docs.holydocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Configuration

Configure OpenAPI sources, playground defaults, auth presets, and generated examples in docs.json.

## Attach an OpenAPI spec

```json
{
  "api": {
    "openapi": {
      "source": "https://api.example.com/openapi.json",
      "directory": "api/reference"
    }
  }
}
```

HolyDocs accepts a single spec, multiple specs, or an object with `source` and `directory`.

## Playground defaults

```json
{
  "api": {
    "playground": {
      "display": "interactive",
      "proxy": true
    },
    "params": {
      "expanded": "closed"
    }
  }
}
```

| Field | Values | Default |
|---|---|---|
| `playground.display` | `interactive` \| `simple` \| `none` | `interactive` |
| `playground.proxy` | `boolean` | `true` |
| `params.expanded` | `all` \| `closed` | `closed` |

## Auth presets for MDX-driven API pages

```json
{
  "api": {
    "mdx": {
      "auth": {
        "method": "bearer",
        "name": "Authorization"
      },
      "server": "https://api.example.com"
    }
  }
}
```

This sets sensible defaults for hand-written API pages that use components like `<ParamField>` and `<RequestExample>`.

## Code example generation

```json
{
  "api": {
    "examples": {
      "languages": ["javascript", "python", "curl", "go"],
      "defaults": "required",
      "prefill": true
    }
  }
}
```

Keep the language list tight. Readers rarely need seven tabs on every endpoint page.

## Related pages

**[OpenAPI](/openapi)**

How HolyDocs ingests and renders specs.
  **[API Playground](/api-playground)**

Interactive request execution, auth, and examples.
  **[API Components](/components/param-field)**

Hand-written API pages with MDX components.