Skip to main content
Mintlify

Search documentation

Type to search this documentation.

On this pageOverview

Mintlify Index REST API

Use the Mintlify Index REST API to search documentation and the web, assemble source-cited context, and retrieve page contents for applications and agents.

Use the Mintlify Index Representational State Transfer (REST) API to retrieve technical knowledge for applications and agents. The API supports three retrieval patterns:

  • context assembles source-cited content within a token budget.
  • search returns ranked documentation and web results.
  • contents retrieves content for selected Mintlify result IDs or result URLs.

Send REST API requests to:

text
https://leaves.mintlify.com/api/universal-search/v1

Append an endpoint path to this base URL, for example /context, /search, or /contents.

Authenticate each request with an Index API key in the Authorization header:

http
Authorization: Bearer mint_us_...

Index API keys begin with mint_us_.

  1. Create an Index API key

    Open the API keys page in your dashboard and create an Index API key.

  2. Store the key securely

    Save the key in a server-side environment variable. Mintlify only displays the complete key when you first create it. Store it securely.

    Bash
    export MINTLIFY_INDEX_API_KEY="mint_us_..."
  3. Build context

    Send your first request to the context endpoint:

    Bash
    curl -X POST "https://leaves.mintlify.com/api/universal-search/v1/context" \
      -H "Authorization: Bearer $MINTLIFY_INDEX_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "query": "How should I configure caching in Next.js 16?",
        "product": "Next.js",
        "format": "txt",
        "tokenBudget": 3000
      }'

    A successful response includes assembled context with source URLs, the number of results used, and the output token count.

REST API limits apply per Mintlify organization. All API keys in an organization share the same limit:

Window Limit
Per second 10 requests
Per day 1,000 requests

Requests exceeding either limit return 429 Too Many Requests. Use exponential backoff before retrying.

Status Meaning
400 The request body is invalid.
401 The API key is missing or invalid.
403 The request IP is not allowed by the API key.
429 The organization exceeded a rate limit.
500 Index could not complete the request.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu