Introduction
LLMWhisperer APIs are a set of APIs that allow you to:
- Convert your complex PDF documents, scanned documents, scanned images, Office documents and spreadsheets to text format which can be used with LLMs
- Location information about every line of text extracted from the document which can be used to highlight search terms or extraction results in your frontend application
The APIs are RESTful and can be easily integrated into your existing systems. There are Python and Node.js clients available to help you get started quickly. Refer to documentation for more information.
API Endpoints
Endpoint | Description |
---|---|
/whisper | Convert your PDF documents, scanned documents, scanned images, Office documents and spreadsheets to text format which can be used by LLMs or other downstream applications. |
/whisper-status | Get the status of the conversion process. This can be used to check the status of the conversion process when the conversion is done. |
/whisper-retrieve | Retrieve the converted text of the document. |
/get-usage-info | Get usage metrics for your account. |
/whisper-manage-callback | Register webhooks (callbacks) which can be called after a conversion finishes |
Base URL
The base URL for the APIs is https://llmwhisperer-api.us-central.unstract.com/api/v2
Authentication
All the APIs require an API key to be passed in the header. You can get your API key by signing up for LLMWhisperer. The API key is passed in the header as unstract-key
.
Curl example:
curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/get-usage-info' \
-H 'unstract-key: <PASTE YOUR API KEY>'
Metering
The APIs are metered based on the number of pages processed per mode (native_text
, low_cost
, high_quality
and form
). You can get the usage metrics by calling the /get-usage-info
API endpoint.
Typical Workflows
Polling Workflow
- Call the
/whisper
API to convert your document to text format. - Check the status of the conversion process by calling the
/whisper-status
API. Repeat this step until the status isprocessed
. - Once the conversion is done, retrieve the converted text by calling the
/whisper-retrieve
API.
Callback Workflow
Register a webhook (callback) by calling the /whisper-manage-callback
API. This needs to be done only once. After that, the webhook can be used by just passing the name of the webhook in the /whisper
API call. The webhook will be called after the conversion is done.
- Call the
/whisper
API to convert your document to text format. Pass the name of the webhook in the request. - The webhook will be called after the conversion is done. The webhook will receive the converted text.