Skip to main content
POST
/
v1
/
documents
/
{id}
/
chat
/
completions
curl -X POST https://api.okrapdf.com/v1/documents/doc-abc123/chat/completions \
  -H "Authorization: Bearer $OKRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      { "role": "user", "content": "What is the total amount due?" }
    ]
  }'

Overview

Runs a chat completion against one document. The model receives document context from OkraPDF and can return cited answers when source evidence is available.
id
string
required
Document ID.
messages
object[]
required
OpenAI-compatible chat messages.
model
string
Optional model override.
curl -X POST https://api.okrapdf.com/v1/documents/doc-abc123/chat/completions \
  -H "Authorization: Bearer $OKRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      { "role": "user", "content": "What is the total amount due?" }
    ]
  }'