Skip to content
Mintlify
Mintlify
Mintlify Index

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.

The REST API requires an API key for your organization. The public Index Model Context Protocol (MCP) server does not require an API key.

Base URL

Send REST API requests to:

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

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

Authentication

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

Authorization: Bearer mint_us_...

Index API keys begin with mint_us_.

Create an Index API key

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

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.

export MINTLIFY_INDEX_API_KEY="mint_us_..."

Do not expose an Index API key in client-side code or commit it to version control.

Build context

Send your first request to the context endpoint:

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.

Rate limits

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

WindowLimit
Per second10 requests
Per day1,000 requests

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

Errors

StatusMeaning
400The request body is invalid.
401The API key is missing or invalid.
403The request IP is not allowed by the API key.
429The organization exceeded a rate limit.
500Index could not complete the request.
Was this page helpful?Suggest editsRaise issue