2.3 Hyper Ocr

The HyperOCR endpoint performs OCR on an image using the "HyperOCR" model. Credits are required and deducted upon successful processing.

Method: POST

https://sdk.hypergpt.ai/hyperOcr

Headers:

Bearer Token

new_user_token

Files:

  • file (UploadFile): The image file to be processed for OCR.

Example Request:

headers = {
    "Authorization": "Bearer " + bearer_token
}
files = {
    "file": (file.filename, file.file, file.content_type)
}

response = requests.post(
    "https://sdk.hypergpt.ai/hyperOcr",
    headers=headers,
    files=files 
)

return response.json()

Example Response (Success):

{
    "ocr": "Extracted text from the image"
}

Example Response (File Upload Error):

{
    "message": "There was an error uploading the file"
}

Example Response (Error):

{
    "detail": "Credit not enough"
}

Last updated