Create a vector store file batch.

POST /vector_stores/{vector_store_id}/file_batches

Path parameters

  • vector_store_id string Required

    The ID of the vector store for which to create a File Batch.

application/json

Body Required

  • file_ids array[string] Required

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

    At least 1 but not more than 500 elements.

  • chunking_strategy object

    The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.

    One of:

    The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.

    Hide attribute Show attribute
    • type string Required

      Always auto.

      Value is auto.

  • attributes object | null

    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.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • id string Required

      The identifier, which can be referenced in API endpoints.

    • object string Required

      The object type, which is always vector_store.file_batch.

      Value is vector_store.files_batch.

    • created_at integer Required

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

    • vector_store_id string Required

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

    • status string Required

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

      Values are in_progress, completed, cancelled, or failed.

    • file_counts object Required
      Hide file_counts attributes Show file_counts attributes object
      • in_progress integer Required

        The number of files that are currently being processed.

      • completed integer Required

        The number of files that have been processed.

      • failed integer Required

        The number of files that have failed to process.

      • cancelled integer Required

        The number of files that where cancelled.

      • total integer Required

        The total number of files.

POST /vector_stores/{vector_store_id}/file_batches
curl \
 --request POST 'https://api.openai.com/v1/vector_stores/vs_abc123/file_batches' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"file_ids":["string"],"chunking_strategy":{"type":"auto"},"attributes":{}}'
Request examples
{
  "file_ids": [
    "string"
  ],
  "chunking_strategy": {
    "type": "auto"
  },
  "attributes": {}
}
Response examples (200)
{
  "id": "string",
  "object": "vector_store.files_batch",
  "created_at": 42,
  "vector_store_id": "string",
  "status": "in_progress",
  "file_counts": {
    "in_progress": 42,
    "completed": 42,
    "failed": 42,
    "cancelled": 42,
    "total": 42
  }
}