---
title: "Create a vector store."
method: POST
path: "/vector_stores"
tags: ["Vector Stores"]
---

# Create a vector store.

`POST /vector_stores`

## Request

- Base URL: `https://gateway.obiguard.ai/v1`
- URL: `https://gateway.obiguard.ai/v1/vector_stores`
- Auth: none declared

## Request body

- CreateVectorStoreRequest
  - `file_ids` string[]: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files.
  - `name` string: The name of the vector store.
  - `expires_after` VectorStoreExpirationAfter: The expiration policy for a vector store.
    - `anchor` 'last_active_at', required: Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.
    - `days` integer, required: The number of days after the anchor time that the vector store will expire.
  - `chunking_strategy` union: 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.
    - object: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
      - `type` 'auto', required: Always `auto`.
    - object
      - `type` 'static', required: Always `static`.
      - `static` StaticChunkingStrategy, required
        - `max_chunk_size_tokens` integer, required: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.
        - `chunk_overlap_tokens` integer, required: 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`.
  - `metadata` object, nullable: 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. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

## Response `200`

OK

- VectorStoreObject: A vector store is a collection of processed files can be used by the `file_search` tool.
  - `id` string, required: The identifier, which can be referenced in API endpoints.
  - `object` 'vector_store', required: The object type, which is always `vector_store`.
  - `created_at` integer, required: The Unix timestamp (in seconds) for when the vector store was created.
  - `name` string, required: The name of the vector store.
  - `usage_bytes` integer, required: The total number of bytes used by the files in the vector store.
  - `file_counts` object, required
    - `in_progress` integer, required: The number of files that are currently being processed.
    - `completed` integer, required: The number of files that have been successfully processed.
    - `failed` integer, required: The number of files that have failed to process.
    - `cancelled` integer, required: The number of files that were cancelled.
    - `total` integer, required: The total number of files.
  - `status` 'expired' | 'in_progress' | 'completed', required: 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.
  - `expires_after` VectorStoreExpirationAfter: The expiration policy for a vector store.
    - `anchor` 'last_active_at', required: Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.
    - `days` integer, required: The number of days after the anchor time that the vector store will expire.
  - `expires_at` integer, nullable: The Unix timestamp (in seconds) for when the vector store will expire.
  - `last_active_at` integer, nullable, required: The Unix timestamp (in seconds) for when the vector store was last active.
  - `metadata` object, nullable, required: 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. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

---

[API](https://skmtc.dev/obiguard/apis/obiguard-api.md) - [All operations](https://skmtc.dev/obiguard/apis/obiguard-api/llms.txt) - [OpenAPI document](https://skmtc.dev/obiguard/apis/obiguard-api/revisions/ddd03c93e108?raw)
