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?" }
]
}'
AI
Chat Completions
Ask questions about a processed document with the OpenAI-compatible chat shape.
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.string
required
Document ID.
object[]
required
OpenAI-compatible chat messages.
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?" }
]
}'