AllProAi Hill • 12 months ago
Quick Reference for Developers
Mintlify Documentation Chat Guide
Quick Reference for Developers
When you need to access Perplexity's official documentation, use this ready-to-paste command set:
Complete Working Example
# Step 1: Create a new chat session and get topic ID
TOPIC_ID=$(curl -s -X POST 'https://leaves.mintlify.com/api/chat/docs.perplexity.ai/topic' \
-H 'content-type: application/json' \
-H 'origin: https://docs.perplexity.ai' \
-H 'referer: https://docs.perplexity.ai/' \
--data-raw '{}' | jq -r '.topicId')
# Step 2: Ask your question (replace YOUR_QUESTION with your actual question)
curl -s -X POST 'https://leaves.mintlify.com/api/chat/docs.perplexity.ai/message' \
-H 'content-type: application/json' \
-H 'origin: https://docs.perplexity.ai' \
-H 'referer: https://docs.perplexity.ai/' \
--data-raw "{\"message\":\"YOUR_QUESTION\",\"topicId\":\"$TOPIC_ID\"}"
Manual Version (if jq not available)
# Step 1: Get topic ID
curl -s -X POST 'https://leaves.mintlify.com/api/chat/docs.perplexity.ai/topic' \
-H 'content-type: application/json' \
-H 'origin: https://docs.perplexity.ai' \
-H 'referer: https://docs.perplexity.ai/' \
--data-raw '{}'
# Copy the topicId from the response, then use it in step 2:
# Step 2: Send your question
curl -s -X POST 'https://leaves.mintlify.com/api/chat/docs.perplexity.ai/message' \
-H 'content-type: application/json' \
-H 'origin: https://docs.perplexity.ai' \
-H 'referer: https://docs.perplexity.ai/' \
--data-raw '{"message":"YOUR_QUESTION_HERE","topicId":"PASTE_TOPIC_ID_HERE"}'
Common Questions for Medical Platform Development
Copy and paste these questions as needed:
API Structure Questions:
What are the requirements for role alternation in sonar-reasoning-pro model conversations?
I am getting error "After the (optional) system message(s), user and assistant roles should be alternating." when using sonar-reasoning-pro. What is the exact required message format?
Model Information:
What are all the available Perplexity models and their capabilities?
What are the token limits and context windows for each Perplexity model?
Response Handling:
How do I handle streaming responses from the Perplexity API?
What is the exact format of responses from sonar-reasoning-pro with Chain of Thought?
Important Headers
Always include these headers for proper access:
content-type: application/json
origin: https://docs.perplexity.ai
referer: https://docs.perplexity.ai/
Notes
This service provides access to Perplexity's official documentation
The topic ID is session-specific and can be reused for follow-up questions
Responses include detailed technical information from the official docs
Much more reliable than guessing API behavior or using outdated information
Comments are closed.

0 comments