Skip to content
Primary navigation

Vector Stores

resource openai_vector_store

optional Expand Collapse
description?: String

A description for the vector store. Can be used to describe the vector store’s purpose.

file_ids?: List[String]

A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.

chunking_strategy?: Attributes

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.

type: String

Always auto.

static?: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

name?: String

The name of the vector store.

metadata?: Map[String]

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.

expires_after?: Attributes

The expiration policy for a vector store.

anchor: String

Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

days: Int64

The number of days after the anchor time that the vector store will expire.

computed Expand Collapse
id: String

The identifier, which can be referenced in API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the vector store was created.

expires_at: Int64

The Unix timestamp (in seconds) for when the vector store will expire.

last_active_at: Int64

The Unix timestamp (in seconds) for when the vector store was last active.

object: String

The object type, which is always vector_store.

status: String

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.

usage_bytes: Int64

The total number of bytes used by the files in the vector store.

file_counts: Attributes
cancelled: Int64

The number of files that were cancelled.

completed: Int64

The number of files that have been successfully processed.

failed: Int64

The number of files that have failed to process.

in_progress: Int64

The number of files that are currently being processed.

total: Int64

The total number of files.

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

optional Expand Collapse
vector_store_id?: String
find_one_by?: Attributes
before?: String

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.

order?: String

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

computed Expand Collapse
id: String
created_at: Int64

The Unix timestamp (in seconds) for when the vector store was created.

expires_at: Int64

The Unix timestamp (in seconds) for when the vector store will expire.

last_active_at: Int64

The Unix timestamp (in seconds) for when the vector store was last active.

name: String

The name of the vector store.

object: String

The object type, which is always vector_store.

status: String

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.

usage_bytes: Int64

The total number of bytes used by the files in the vector store.

metadata: Map[String]

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.

expires_after: Attributes

The expiration policy for a vector store.

anchor: String

Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

days: Int64

The number of days after the anchor time that the vector store will expire.

file_counts: Attributes
cancelled: Int64

The number of files that were cancelled.

completed: Int64

The number of files that have been successfully processed.

failed: Int64

The number of files that have failed to process.

in_progress: Int64

The number of files that are currently being processed.

total: Int64

The total number of files.

openai_vector_store

data "openai_vector_store" "example_vector_store" {
  vector_store_id = "vector_store_id"
}

data openai_vector_stores

optional Expand Collapse
before?: String

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.

order?: String

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
items: List[Attributes]

The items returned by the data source

id: String

The identifier, which can be referenced in API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the vector store was created.

file_counts: Attributes
cancelled: Int64

The number of files that were cancelled.

completed: Int64

The number of files that have been successfully processed.

failed: Int64

The number of files that have failed to process.

in_progress: Int64

The number of files that are currently being processed.

total: Int64

The total number of files.

last_active_at: Int64

The Unix timestamp (in seconds) for when the vector store was last active.

metadata: Map[String]

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.

name: String

The name of the vector store.

object: String

The object type, which is always vector_store.

status: String

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.

usage_bytes: Int64

The total number of bytes used by the files in the vector store.

expires_after: Attributes

The expiration policy for a vector store.

anchor: String

Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

days: Int64

The number of days after the anchor time that the vector store will expire.

expires_at: Int64

The Unix timestamp (in seconds) for when the vector store will expire.

openai_vector_stores

data "openai_vector_stores" "example_vector_stores" {
  before = "before"
}

Vector StoresFiles

resource openai_vector_store_file

required Expand Collapse
vector_store_id: String
file_id: String

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 Expand Collapse
chunking_strategy?: Attributes

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.

type: String

Always auto.

static?: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

attributes?: Dynamic

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 Expand Collapse
id: String

The identifier, which can be referenced in API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the vector store file was created.

object: String

The object type, which is always vector_store.file.

status: String

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.

usage_bytes: Int64

The total vector store usage in bytes. Note that this may be different from the original file size.

last_error: Attributes

The last error associated with this vector store file. Will be null if there are no errors.

code: String

One of server_error, unsupported_file, or invalid_file.

message: String

A human-readable description of the error.

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

required Expand Collapse
vector_store_id: String
optional Expand Collapse
file_id?: String
find_one_by?: Attributes
before?: String

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.

filter?: String

Filter by file status. One of in_progress, completed, failed, cancelled.

order?: String

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

computed Expand Collapse
id: String
created_at: Int64

The Unix timestamp (in seconds) for when the vector store file was created.

object: String

The object type, which is always vector_store.file.

status: String

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.

usage_bytes: Int64

The total vector store usage in bytes. Note that this may be different from the original file size.

chunking_strategy: Attributes

The strategy used to chunk the file.

static: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

type: String

Always static.

last_error: Attributes

The last error associated with this vector store file. Will be null if there are no errors.

code: String

One of server_error, unsupported_file, or invalid_file.

message: String

A human-readable description of the error.

attributes: Dynamic

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

required Expand Collapse
vector_store_id: String
optional Expand Collapse
before?: String

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.

filter?: String

Filter by file status. One of in_progress, completed, failed, cancelled.

order?: String

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
items: List[Attributes]

The items returned by the data source

id: String

The identifier, which can be referenced in API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the vector store file was created.

last_error: Attributes

The last error associated with this vector store file. Will be null if there are no errors.

code: String

One of server_error, unsupported_file, or invalid_file.

message: String

A human-readable description of the error.

object: String

The object type, which is always vector_store.file.

status: String

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.

usage_bytes: Int64

The total vector store usage in bytes. Note that this may be different from the original file size.

vector_store_id: String

The ID of the vector store that the File is attached to.

attributes: Dynamic

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.

chunking_strategy: Attributes

The strategy used to chunk the file.

static: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

type: String

Always static.

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

required Expand Collapse
vector_store_id: String
optional Expand Collapse
file_ids?: List[String]

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.

chunking_strategy?: Attributes

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.

type: String

Always auto.

static?: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

files?: List[Attributes]

A list of objects that each include a file_id plus optional attributes or chunking_strategy. Use this when you need to override metadata for specific files. The global attributes or chunking_strategy will be ignored and must be specified for each file. 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 file_ids.

file_id: String

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.

attributes?: Dynamic

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.

chunking_strategy?: Attributes

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.

type: String

Always auto.

static?: Attributes
chunk_overlap_tokens: Int64

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

max_chunk_size_tokens: Int64

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

attributes?: Dynamic

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 Expand Collapse
id: String

The identifier, which can be referenced in API endpoints.

created_at: Int64

The Unix timestamp (in seconds) for when the vector store files batch was created.

object: String

The object type, which is always vector_store.file_batch.

status: String

The status of the vector store files batch, which can be either in_progress, completed, cancelled or failed.

file_counts: Attributes
cancelled: Int64

The number of files that where cancelled.

completed: Int64

The number of files that have been processed.

failed: Int64

The number of files that have failed to process.

in_progress: Int64

The number of files that are currently being processed.

total: Int64

The total number of files.

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

required Expand Collapse
batch_id: String
vector_store_id: String
computed Expand Collapse
id: String
created_at: Int64

The Unix timestamp (in seconds) for when the vector store files batch was created.

object: String

The object type, which is always vector_store.file_batch.

status: String

The status of the vector store files batch, which can be either in_progress, completed, cancelled or failed.

file_counts: Attributes
cancelled: Int64

The number of files that where cancelled.

completed: Int64

The number of files that have been processed.

failed: Int64

The number of files that have failed to process.

in_progress: Int64

The number of files that are currently being processed.

total: Int64

The total number of files.

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"
}