Vector Stores
resource openai_vector_store
optional
A description for the vector store. Can be used to describe the vector store’s purpose.
A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_vector_store
resource "openai_vector_store" "example_vector_store" {
chunking_strategy = {
type = "auto"
}
description = "description"
expires_after = {
anchor = "last_active_at"
days = 1
}
file_ids = ["string"]
metadata = {
foo = "string"
}
name = "name"
}
data openai_vector_store
computed
The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_vector_store
data "openai_vector_store" "example_vector_store" {
vector_store_id = "vector_store_id"
}
data openai_vector_stores
optional
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.
openai_vector_stores
data "openai_vector_stores" "example_vector_stores" {
before = "before"
}
Vector StoresFiles
resource openai_vector_store_file
required
A File ID that the vector store should use. Useful for tools like file_search that can access files. For multi-file ingestion, we recommend file_batches to minimize per-vector-store write requests.
optional
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
computed
The status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.
openai_vector_store_file
resource "openai_vector_store_file" "example_vector_store_file" {
vector_store_id = "vs_abc123"
file_id = "file_id"
attributes = {
foo = "string"
}
chunking_strategy = {
type = "auto"
}
}
data openai_vector_store_file
computed
The status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.
The total vector store usage in bytes. Note that this may be different from the original file size.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
openai_vector_store_file
data "openai_vector_store_file" "example_vector_store_file" {
vector_store_id = "vs_abc123"
file_id = "file-abc123"
}
data openai_vector_store_files
optional
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.
openai_vector_store_files
data "openai_vector_store_files" "example_vector_store_files" {
vector_store_id = "vector_store_id"
before = "before"
filter = "in_progress"
}
Vector StoresFile Batches
resource openai_vector_store_file_batch
optional
A list of File IDs that the vector store should use. Useful for tools like file_search that can access files. If attributes or chunking_strategy are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with files.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
openai_vector_store_file_batch
resource "openai_vector_store_file_batch" "example_vector_store_file_batch" {
vector_store_id = "vs_abc123"
attributes = {
foo = "string"
}
chunking_strategy = {
type = "auto"
}
file_ids = ["string"]
files = [{
file_id = "file_id"
attributes = {
foo = "string"
}
chunking_strategy = {
type = "auto"
}
}]
}
data openai_vector_store_file_batch
openai_vector_store_file_batch
data "openai_vector_store_file_batch" "example_vector_store_file_batch" {
vector_store_id = "vs_abc123"
batch_id = "vsfb_abc123"
}