Chat with PDF
To chat with a PDF you need docId
of the PDF. To get docId
upload the PDF first.
To delete the chat you need to delete the PDF document using delete API.
Note: There use to be
chatId
field previously for saving chat but now it's deprecated. You just need to usesave_chat
field in order to save your chat history now.
Chat with PDF
Chat with a PDF
POST
https://pdf.ai/api/v1/chat
Ask questions to get responses from the PDF using docId
Headers
X-API-Key*
string
<API-key>
Request Body
docId*
string
Document ID obtained after uploading PDF
save_chat
boolean
Option to save chat history
message*
string
Message or question you want to get answer from PDF
use_gpt4
boolean
To get response using GPT-4 model. Default model: gpt-4-turbo
model
string
To choose GPT-4 model "gpt-4o" or "gpt-4-turbo"(default). gpt-4o message costs 2 credits, gpt-4-turbo message costs 4 credits.
language
string
Response language e.g., "french"
sys_prompt
string
Customized system prompt
{
"content": "This is the answer to your message or question",
"references": [
{
"pageNumber": 71,
"fromLine": 41,
"toLine": 48
}
]
}
Last updated
Was this helpful?