2.9 Hyper Pdf

The HyperPdf endpoint enables users to ask questions related to a PDF document identified by its source ID. The system verifies if the user has sufficient credits before processing the question.

Method:POST

Endpoint

https://sdk.hypergpt.ai/hyperPdf

Headers:

Bearer Token

new_user_token

Params:

  • question (str): The question asked by the user regarding the content of the PDF document.

Files :

  • file: The unique identifier of the PDF document for which the question is being .

Example Request:

headers = {
    "Authorization": "Bearer " + bearer_token,

}
params= {
    "question": question,
}
files = {
    "file": (file.filename, file.file, file.content_type)
}
response = requests.post(
    "https://sdk.hypergpt.ai/hyperPdf",
    headers=headers,
    params=params,
    files=files
)

return response.json()

Example Response (Success):

{
    "response": "The main findings of the report include..."
}

Example Response (Error):

{
    "detail": "Credit not enough"
}

This endpoint allows users to ask questions related to a PDF document and receive responses. It validates the user's token, checks their credits, and logs the API usage. If the user has enough credits, the question is processed, and the response is returned; otherwise, an error message is returned.

Last updated