Create assistant message
Generates a response message from the assistant for the specified domain. Compatible with AI SDK v5+.
Documentation Index
Fetch the complete documentation index at: https://mintlify-mintlify-a840f9ae.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Integration with useChat
The useChat hook from Vercel’s AI SDK is the recommended way to integrate the assistant API into your application.
Use the hook
transport- UseDefaultChatTransportto configure the API connection.body.fp- Fingerprint identifier (use'anonymous'or a unique user identifier).body.retrievalPageSize- Number of search results to use (recommended: 5).
body.context- Array of contextual information to provide to the assistant. Each context object contains:type- Either'code'or'textSelection'.value- The code snippet or selected text content.path(optional) - Path to the source file or page.elementId(optional) - Identifier for the UI element containing the context.
body.currentPath- The path of the page the user is currently viewing. When provided, the assistant uses this context to provide more relevant answers. Maximum length: 200 characters.
Rate limits
The assistant API has the following limits:- 10,000 requests per Mintlify organization per hour
- 10,000 requests per IP per day
Authorizations
The Authorization header expects a Bearer token. Use an assistant API key (prefixed with mint_dsc_). This is a public key safe for use in client-side code. Generate one on the API keys page in your dashboard.
Path Parameters
The domain identifier from your domain.mintlify.app URL. Can be found at the end of your dashboard URL. For example, dashboard.mintlify.com/organization/domain has a domain identifier of domain.
Body
Fingerprint identifier for tracking conversation sessions. Use anonymous for anonymous users or provide a unique user identifier.
Array of messages in the conversation. Use the handleSubmit function from the @ai-sdk/react package's useChat hook to manage messages and streaming responses.
An optional identifier used to maintain conversation continuity across multiple messages. When provided, it allows the system to associate follow-up messages with the same conversation thread. The threadId is returned in the response as event.threadId when event.type === 'finish'.
Number of documentation search results to use for generating the response. Higher values provide more context but may increase response time. Recommended: 5.
Optional filter criteria for the search.
Optional array of contextual information to provide to the assistant.
The path of the page the user is currently viewing. When provided, the assistant uses this context to provide more relevant answers. Maximum length: 200 characters.
Response
Message generated successfully
Streaming response compatible with AI SDK v5. Use the useChat hook from @ai-sdk/react to handle the response stream.