Returns a list of vector store files in a batch.

GET /vector_stores/{vector_store_id}/file_batches/{batch_id}/files

Path parameters

  • vector_store_id string Required

    The ID of the vector store that the files belong to.

  • batch_id string Required

    The ID of the file batch that the files belong to.

Query parameters

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

    Default value is 20.

  • order string

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

    Values are asc or desc. Default value is desc.

  • after string

    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.

  • 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.

    Values are in_progress, completed, failed, or cancelled.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • object string Required
    • data array[object] Required

      A list of files attached to a vector store.

      Hide data attributes Show data 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.

        Value is vector_store.file.

      • usage_bytes integer Required

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

      • created_at integer Required

        The Unix timestamp (in seconds) for when the vector store file 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 file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.

        Values are in_progress, completed, cancelled, or failed.

      • last_error object | null Required

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

        Hide last_error attributes Show last_error attributes object | null
        • code string Required

          One of server_error or rate_limit_exceeded.

          Values are server_error, unsupported_file, or invalid_file.

        • message string Required

          A human-readable description of the error.

      • chunking_strategy object

        The strategy used to chunk the file.

        One of:
        Hide attributes Show attributes
        • type string Required

          Always static.

          Value is static.

        • static object Required

          Additional properties are NOT allowed.

          Hide static attributes Show static attributes object
          • 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.

            Minimum value is 100, 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.

      • 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.

    • first_id string Required
    • last_id string Required
    • has_more boolean Required
GET /vector_stores/{vector_store_id}/file_batches/{batch_id}/files
curl \
 --request GET 'https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "object": "vector_store.file",
      "usage_bytes": 42,
      "created_at": 42,
      "vector_store_id": "string",
      "status": "in_progress",
      "last_error": {
        "code": "server_error",
        "message": "string"
      },
      "chunking_strategy": {
        "type": "static",
        "static": {
          "max_chunk_size_tokens": 42,
          "chunk_overlap_tokens": 42
        }
      },
      "attributes": {}
    }
  ],
  "first_id": "file-abc123",
  "last_id": "file-abc456",
  "has_more": false
}