Overview
Sonar models support PDF document analysis through file URL uploads. You can ask questions about PDF content, get summaries, extract information, and perform detailed analysis of uploaded documents.PDF files must be accessible via a public URL.
Supported Features
- Document Summarization: Get concise summaries of PDF content
- Question Answering: Ask specific questions about the document
- Content Extraction: Extract key information, data, and insights
- Multi-language Support: Analyze PDFs in various languages
- Large Document Handling: Process lengthy documents efficiently
Basic Usage
Simple PDF Analysis
Advanced Analysis with Web Search
File Requirements
Format Support
- PDF files (.pdf extension)
- Text-based PDFs (not scanned images)
- Password-protected PDFs (if publicly accessible)
Size Limits
- Recommended: Under 50MB
- Maximum processing time: 60 seconds
- Large files may take longer to analyze
Common Use Cases
Academic Research
Legal Documents
Financial Reports
Technical Documentation
Best Practices
Optimize Your Questions
Optimize Your Questions
- Be specific about what information you need
- Ask one focused question per request for best results
- Use follow-up questions to dive deeper into specific sections
Prepare Your PDFs
Prepare Your PDFs
- Ensure PDFs are text-based, not scanned images
- Use publicly accessible URLs (Google Drive, Dropbox, etc.)
- Verify the URL returns the PDF directly, not a preview page
Handle Large Documents
Handle Large Documents
- Break down complex questions into smaller parts
- Consider processing large documents in sections
- Use streaming for real-time responses on lengthy analyses
Error Handling
Common Issues
Error | Cause | Solution |
---|---|---|
Invalid URL | URL not accessible | Verify URL returns PDF directly |
File too large | PDF exceeds size limits | Compress or split the document |
Processing timeout | Document too complex | Simplify question or use smaller sections |
Example Error Handling
Integration Examples
Pricing
PDF analysis follows standard Sonar pricing based on:- Input tokens (document content + question)
- Output tokens (AI response)
- Web search usage (if enabled)
Large PDFs consume more input tokens. Consider the document size when estimating costs.