Ingestion

Ingest File

POST

Ingests and processes a file, storing its chunks to be used as context.

The context obtained from files is later used in /chat/completions, /completions, and /chunks APIs.

Most common document formats are supported, but you may be prompted to install an extra dependency to manage a specific file type.

A file can generate different Documents (for example a PDF generates one Document per page). All Documents IDs are returned in the response, together with the extracted Metadata (which is later used to improve context retrieval). Those IDs can be used to filter the context used to create responses in /chat/completions, /completions, and /chunks APIs.

Request

This endpoint expects a multipart form containing a file.
filefile

Response

This endpoint returns an object
object
any
model
any
data
list of objects
POST
1curl -X POST /v1/ingest/file \
2 -H "Content-Type: multipart/form-data" \
3 -F file=@<filename1>
200
Successful
1{
2 "object": {},
3 "model": {},
4 "data": [
5 {
6 "object": {},
7 "doc_id": "string",
8 "doc_metadata": {
9 "string": {}
10 }
11 }
12 ]
13}