Open-Source Example

Chat with any PDF on any website

OkraPDF extracts and understands your document. Embed a chat widget anywhere with one script tag. Works with Typebot, Botpress, or the lightweight widget below.

1. Upload a PDF

npx okrapdf upload file.pdf
Get an OpenAI-compatible completions endpoint.

2. Embed the widget

Paste one <script> tag. The chat bubble appears on your site, powered by your PDF.

3. Or use Typebot/Botpress

Point any chatbot builder at your OkraPDF endpoint. It's OpenAI-compatible.

Live Demo — Amcor Q4 FY2023 Earnings

OkraPDF Amcor Q4 FY2023 Earnings.pdf
Hi! I can answer questions about this PDF. Try one of the suggestions below, or ask your own.

Embed on your own site

// 1. Script tag — paste before </body>
<script>
  (function() {
    const DOC = 'YOUR_DOC_ID';
    const KEY = 'YOUR_PUBLISHABLE_KEY';
    const s = document.createElement('script');
    s.src = 'https://typebot-chatpdf.pages.dev/widget.js';
    s.dataset.doc = DOC;
    s.dataset.key = KEY;
    document.body.appendChild(s);
  })();
</script>

// 2. Or use Typebot — point HTTP Request block at:
// POST https://api.okrapdf.com/v1/documents/{id}/chat/completions
// Authorization: Bearer YOUR_OKRA_KEY