Last updated
Last updated
To chat with a PDF you need docId
of the PDF. To get docId
the PDF first.
Using the save_chat
option you can save chat history and can find the same in PDF.ai/documents/<docId>
To delete the chat you need to delete the PDF document using API.
You can make use of the powerful GPT-4 model to get better answers using use_gpt4
field in the request body. You can choose a specific model between gpt-4-turbo and gpt-4o using model field
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.
POST
https://pdf.ai/api/v1/chat
Ask questions to get responses from the PDF using docId
X-API-Key*
string
<API-key>
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