> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-nick-eng-3707-update-chat-endpoints-to-single-assi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AI ingestion

> Prepare your documentation for LLMs and AI tools

export const PreviewButton = ({children, href}) => {
  return <a href={href} className="text-sm font-medium text-white dark:!text-zinc-950 bg-zinc-900 hover:bg-zinc-700 dark:bg-zinc-100 hover:dark:bg-zinc-300 rounded-full px-3.5 py-1.5 not-prose">
      {children}
    </a>;
};

Generate optimized formats and provide shortcuts that help users get faster, more accurate responses when using your documentation as context for LLMs and AI tools.

## Contextual menu

Provide quick access to AI-optimized content and direct integrations with popular AI tools from a contextual menu on your pages.

* **Copy page**: Copies the current page as Markdown for pasting as context into AI tools.
* **View as Markdown**: Opens the current page as Markdown.
* **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context.
* **Open in Claude**: Creates a Claude conversation with the current page as context.
* **Ask Perplexity**: Creates a Perplexity conversation with the current page as context.
* [**Your custom options**](#adding-custom-options): Add your own options to the contextual menu.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/mintlify-nick-eng-3707-update-chat-endpoints-to-single-assi/images/contextual-menu/contextual-menu.png" alt="The expanded contextual menu showing the Copy page, View as Markdown, Open in ChatGPT, and Open in Claude menu items." />
</Frame>

### Enabling the contextual menu

Add the `contextual` field to your `docs.json` and specify which options you want to include in your menu.

```json
{
 "contextual": {
   "options": [
     "copy",
     "view",
     "chatgpt",
     "claude",
     "perplexity"
   ]
 }
}
```

### Adding custom options

Create custom options in the contextual menu by adding an object to the `options` array. Each custom option requires these properties:

<ResponseField name="title" type="string" required>
  The title of the option.
</ResponseField>

<ResponseField name="description" type="string" required>
  The description of the option. Displayed beneath the title when the contextual menu is expanded.
</ResponseField>

<ResponseField name="icon" type="string" required>
  The icon of the option. Accepts any icon from the [Icons](/components/icons) collection.
</ResponseField>

<ResponseField name="href" type="string | object" required>
  The href of the option. Use a string for simple links or an object for dynamic links with query parameters.

  <Expandable title="href object">
    <ResponseField name="base" type="string" required>
      The base URL for the option.
    </ResponseField>

    <ResponseField name="query" type="object" required>
      The query parameters for the option.

      <Expandable title="query object">
        <ResponseField name="key" type="string" required>
          The query parameter key.
        </ResponseField>

        <ResponseField name="value" type="string" required>
          The query parameter value. Use `$page` to insert the current page content in Markdown or `$path` to insert the current page path.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

Example custom option:

```json {7-20} Example with Perplexity icon="search"
"contextual": {
  "options": [
    "copy",
    "view",
    "chatgpt",
    "claude",
    {
      "title": "Ask Perplexity",
      "description": "Ask Perplexity about the current page",
      "icon": "search",
      "href": {
        "base": "https://www.perplexity.ai/search",
        "query": [
          {
            "key": "q",
            "value": "Ask question about https://mintlify.com/docs$path.md"
          }
        ]
      }
    }
  ]
}
```

## /llms.txt

The [/llms.txt file](https://llmstxt.org) is an industry standard that helps general-purpose LLMs index more efficiently, similar to how a sitemap helps search engines.

Every documentation site automatically hosts an `/llms.txt` file at the root that lists all available pages in your documentation. AI tools can use this file to understand your documentation structure and find relevant content to user prompts.

<PreviewButton href="https://mintlify.com/docs/llms.txt">Open llms.txt for this site</PreviewButton>

## /llms-full.txt

The `/llms-full.txt` file combines your entire documentation site into a single file as context for AI tools.

Every documentation site automatically hosts an `/llms-full.txt` file at the root.

<PreviewButton href="https://mintlify.com/docs/llms-full.txt">Open llms-full.txt for this site</PreviewButton>

## Generating Markdown versions of pages

Markdown provides structured text that AI tools can process more efficiently than HTML, which results in better response times and lower token usage.

### .md extension

Add a `.md` to a page's URL to display a Markdown version of that page.

<PreviewButton href="https://mintlify.com/docs/quickstart.md">Open quickstart.md</PreviewButton>

### Command + C shortcut

Select Command + C (Ctrl + C on Windows) to copy any page as Markdown.
