Assemble a context payload for RAG
Runs a ranked universal search and returns a token-budgeted context payload assembled from the top Mintlify and web results. Use this endpoint to feed a retrieval-augmented generation (RAG) pipeline without stitching results yourself. Choose txt for a plain-text context ready to pass to an LLM, or json for a structured list your application can render.
Authenticate with a universal search API key.
format:
txt: A single plain-text string with source URLs interleaved. Best for passing straight into a prompt.json: A JSON-encoded string of the form{"results":[...]}with one entry per snippet. Best when your application needs to render or attribute individual sources.
product to bias retrieval toward a specific product or subject when the same query could match multiple domains.
The response caps outputTokens at 10,000 and reports resultsCount so you can see how many snippets were included after the budget was applied.Authorizations
The Authorization header expects a Bearer token. Use a universal search API key. Generate one on the API keys page in your dashboard.
Body
The user question or intent to build context for.
Shape of the response field. txt returns a single plain-text payload with source URLs; json returns a JSON-encoded string of the form {"results":[...]} with one entry per snippet.
txt, json Optional product or subject to bias retrieval toward. When set, it is prepended to the retrieval query.
Response
The assembled context.
A unique identifier for this request. Include when contacting support.
Echo of the original query (without any product prefix that was applied during retrieval).
The assembled context. When format is txt, this is a plain-text payload with source URLs. When format is json, this is a JSON-encoded string of the form {"results":[...]} where each result contains the snippet's URL, title, and Markdown.
The number of snippets included in response after the token budget was applied.
x >= 0The approximate token count of response. The endpoint caps this at 10,000 tokens.
x >= 0