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

> Source: /api/information-extraction/universal-extraction

# Universal extraction API

OpenAPI spec: `./openapi/openapi-information-extract.yaml`

- `POST /information-extraction`

<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 is always <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>system\_fingerprint</strong> null <br />This field is not yet available.</td></tr><tr><td><strong>choices</strong> list<br />A list of chat completion choices. If <code>split=True</code>, the results from split documents are included in the choices..</td></tr><tr><td><strong>choices\[].finish\_reason</strong> string<br />The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached.</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 />A chat completion message as the result of information extraction. The result will be given in stringified JSON.</td></tr><tr><td><strong>choices\[].message.content</strong> string <br />The contents of the message.</td></tr><tr><td><strong>choices\[].message.role</strong> string<br />The role of the author of this message.</td></tr><tr><td><strong>choices\[].message.tool\_calls</strong> list<br />A list of tool calls generated by the model, such as function calls. Contains additional extracted values(location, confidence scores).</td></tr><tr><td><strong>choices\[].message.tool\_calls\[].id</strong> string<br />The ID of the tool call.</td></tr><tr><td><strong>choices\[].message.tool\_calls\[].type</strong> string<br />The type of the tool. Currently, only <code>function</code> is supported.</td></tr><tr><td><strong>choices\[].message.tool\_calls\[].function</strong> object<br />The function that the model called.</td></tr><tr><td><strong>choices\[].message.tool\_calls\[].function.name</strong> string<br />The name of the function to call. Currently returns <code>additional\_values</code>.</td></tr><tr><td><strong>choices\[].message.tool\_calls\[].function.arguments</strong> string<br />The arguments to call the function with, as generated by the model in JSON format. Contains extracted field values with their corresponding additional values below.<br />
If <code>location=True</code>: <code>additional\_values</code> include the fields <code>page</code> and <code>coordinates</code>.<br />
If <code>confidence=True</code>: <code>additional\_values</code> include the fields <code>confidence</code>, whose value is either <code>"high"</code> or <code>"low"</code>.</td></tr><tr><td><strong>choices\[].logprobs</strong> null<br />This field is not yet available.</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

<figure>

![bank\_statement.png](/assets/images/docs/bank_statement.png)

<figcaption><a href="/assets/images/docs/bank_statement.png" download="bank_statement.png">bank\_statement.png</a></figcaption>

</figure>

**Request**

_Request/response examples: information-extract / request_

**Response**

_Example: information-extract / response-200 / default_