> For the complete documentation index, see [/llms.txt](/llms.txt).

> Source: /api/document-classification

# Document classification

OpenAPI spec: `./openapi/openapi-document-classification.yaml`

- `POST /document-classification`

<br />

## Response

**Return values**

Returns a `chat.completion` object

**The chat completion object**

<table><tbody><tr><td><strong>id</strong> string<br />A unique identifier for the chat completion.</td></tr><tr><td><strong>object</strong> string <br />The object type, which may be <code>null</code>.</td></tr><tr><td><strong>created</strong> integer<br />The Unix timestamp (in seconds) of when the chat completion was created.</td></tr><tr><td><strong>model</strong> string<br />A string representing the version of the model being used.</td></tr><tr><td><strong>choices</strong> list<br />A list of chat completion choices.</td></tr><tr><td><strong>choices\[].index</strong> integer <br />The index of the choice in the list of choices.</td></tr><tr><td><strong>choices\[].message</strong> object <br />The classification result as a chat completion message.</td></tr><tr><td><strong>choices\[].message.content</strong> string <br />The classification label string, e.g., <code>"invoice"</code>.</td></tr><tr><td><strong>choices\[].finish\_reason</strong> string<br />Why the model stopped generating tokens (e.g., <code>stop</code>).</td></tr><tr><td><strong>usage</strong> object<br />Usage statistics for the completion request.</td></tr><tr><td><strong>usage.completion\_tokens</strong> integer<br />Number of tokens in the generated completion.</td></tr><tr><td><strong>usage.prompt\_tokens</strong> integer<br />Number of tokens in the prompt.</td></tr><tr><td><strong>usage.total\_tokens</strong> integer<br />Total number of tokens used in the request (prompt + completion).</td></tr></tbody></table>

## Examples

**Request**

_Request/response examples: document-classification / request_

**Response**

_Example: document-classification / response-200 / default_