Vector store file batchesBeta
Vector store file batches represent operations to add multiple files to a vector store. Related guide: File Search
Create vector store file batchBeta
Create a vector store file batch.
Path parameters
Request body
A list of File IDs that the vector store should use. Useful for tools like file_search
that can access files.
Returns
A vector store file batch object.
1
2
3
4
5
6
7
curl https://api.openai.com/v1/vector_stores/vs_abc123/file_batches \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json \
-H "OpenAI-Beta: assistants=v2" \
-d '{
"file_ids": ["file-abc123", "file-abc456"]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}
Retrieve vector store file batchBeta
Retrieves a vector store file batch.
Path parameters
Returns
The vector store file batch object.
1
2
3
4
curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123 \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}
Cancel vector store file batchBeta
Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.
Path parameters
Returns
The modified vector store file batch object.
1
2
3
4
5
curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X POST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "cancelling",
"file_counts": {
"in_progress": 12,
"completed": 3,
"failed": 0,
"cancelled": 0,
"total": 15,
}
}
List vector store files in a batchBeta
Returns a list of vector store files in a batch.
Path parameters
Query parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Sort order by the created_at
timestamp of the objects. asc
for ascending order and desc
for descending order.
A cursor for use in pagination. after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
A cursor for use in pagination. before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Returns
A list of vector store file objects.
1
2
3
4
curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/files \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"object": "list",
"data": [
{
"id": "file-abc123",
"object": "vector_store.file",
"created_at": 1699061776,
"vector_store_id": "vs_abc123"
},
{
"id": "file-abc456",
"object": "vector_store.file",
"created_at": 1699061776,
"vector_store_id": "vs_abc123"
}
],
"first_id": "file-abc123",
"last_id": "file-abc456",
"has_more": false
}
The vector store files batch objectBeta
A batch of files attached to a vector store.
The ID of the vector store that the File is attached to.
The status of the vector store files batch, which can be either in_progress
, completed
, cancelled
or failed
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"id": "vsfb_123",
"object": "vector_store.files_batch",
"created_at": 1698107661,
"vector_store_id": "vs_abc123",
"status": "completed",
"file_counts": {
"in_progress": 0,
"completed": 100,
"failed": 0,
"cancelled": 0,
"total": 100
}
}