Overview
Add a floating chat bubble to any website that answers questions about your PDF. One script tag, zero dependencies, streaming responses.Live Demo
Try the embedded chat widget on a live page
Quick Start
Upload a document, then paste this before</body>:
Get a publishable key
Create a key scoped for client-side use in your dashboard. Publishable keys (prefixed
okra_pk_) can only read — they can’t upload or delete documents.How It Works
The widget calls OkraPDF’s OpenAI-compatible completions endpoint directly from the browser:Use with Chatbot Builders
Since the completions API is OpenAI-compatible, any chatbot platform that supports custom endpoints works out of the box.Typebot
Typebot
Add an HTTP Request block:
- URL:
https://api.okrapdf.com/v1/documents/YOUR_DOC_ID/chat/completions - Method: POST
- Headers:
Authorization: Bearer YOUR_OKRA_KEY - Body:
{"model":"moonshotai/kimi-k2.5","messages":[{"role":"user","content":"{{userQuestion}}"}]} - Response mapping:
choices[0].message.content→ your response variable - Timeout: Set to 120s (LLM calls take 5-30s)
Botpress / Voiceflow / Flowise
Botpress / Voiceflow / Flowise
Any platform with a “Custom OpenAI” or “HTTP Request” integration:
- Base URL:
https://api.okrapdf.com/v1/documents/YOUR_DOC_ID - API Key: Your OkraPDF key (passed as OpenAI API key)
- Model:
moonshotai/kimi-k2.5
Python / Node.js (OpenAI SDK)
Python / Node.js (OpenAI SDK)
n8n
n8n
Use the OkraPDF n8n node for native integration.
Customization
The widget accepts thesedata- attributes:
| Attribute | Description | Default |
|---|---|---|
data-doc | Document ID (required) | — |
data-key | Publishable API key (required) | — |