Chat with a PDF file
Document
Chat with a PDF file
Ask questions about a PDF file using its file_id.
Workflow:
- Ingest PDF using
/source/v1/api/document - Use returned
file_idwith this endpoint
Required Headers:
Authorization: Bearer YOUR_API_KEY
POST
Chat with a PDF file
Authorizations
Bearer token authentication using an API key
Body
application/json
The file_id returned from ingest endpoint
Example:
"abc123-def456-ghi789"
Your question about the content
Example:
"What are the main points discussed in this document?"
Whether to stream the response (SSE format)
AI model to use
Available options:
gpt-4, gpt-4o, gpt-4o-mini, gpt-3.5-turbo, claude-3-opus, claude-3-sonnet, claude-3.5-sonnet, gemini-1.5-pro, gemini-1.5-flash Example:
"gpt-4"
Model provider
Available options:
openai, anthropic, gemini Example:
"openai"
Type of conversation
Available options:
single, group Maximum output tokens
Example:
2000
Response
Successful response
Server-Sent Events stream (when streaming=true)
