> ## Documentation Index
> Fetch the complete documentation index at: https://docs.okrapdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions

> Ask questions about a processed document with the OpenAI-compatible chat shape.

## 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.

<ParamField path="id" type="string" required>
  Document ID.
</ParamField>

<ParamField body="messages" type="object[]" required>
  OpenAI-compatible chat messages.
</ParamField>

<ParamField body="model" type="string">
  Optional model override.
</ParamField>

<RequestExample>
  ```bash theme={null}
  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?" }
      ]
    }'
  ```
</RequestExample>
