Create a vector store file batch

Create a vector store file batch.

Request

POST

https://ai.api.cloud.yandex.net/v1/vector_stores/{vector_store_id}/file_batches

Path parameters

Name

Description

vector_store_id

Type: string

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

Example: ``

Body

application/json

null

Name

Description

attributes

Type: VectorStoreFileAttributes

Default: null

Example
{}

chunking_strategy

Type: ChunkingStrategyRequestParam

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

Example
{
  "type": "auto"
}

file_ids

Type: 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.

Min items: 1

Max items: 2000

Example
[
  "example"
]

files

Type: CreateVectorStoreFileRequest[]

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.

Min items: 1

Max items: 2000

Example
[
  {
    "file_id": "example",
    "chunking_strategy": {
      "type": "auto"
    },
    "attributes": null
  }
]
Any of 2 types
  • Type: unknown

    Example: null

  • Type: unknown

    Example: null

AutoChunkingStrategyRequestParam

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

Name

Description

type

Type: string

Always auto.

Const: auto

Example: example

Example
{
  "type": "auto"
}

StaticChunkingStrategy

Name

Description

chunk_overlap_tokens

Type: integer

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

Type: integer

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

Min value: 100

Max value: 4096

Example
{
  "max_chunk_size_tokens": 100,
  "chunk_overlap_tokens": 0
}

StaticChunkingStrategyRequestParam

Customize your own chunking strategy by setting chunk size and chunk overlap.

Name

Description

static

Type: StaticChunkingStrategy

Example
{
  "max_chunk_size_tokens": 100,
  "chunk_overlap_tokens": 0
}

type

Type: string

Always static.

Const: static

Example: example

Example
{
  "type": "static",
  "static": {
    "max_chunk_size_tokens": 100,
    "chunk_overlap_tokens": 0
  }
}

ChunkingStrategyRequestParam

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

Type: object

One of 2 types
  • Auto Chunking Strategy

    Type: AutoChunkingStrategyRequestParam

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

    Example
    {
      "type": "auto"
    }
    
  • Static Chunking Strategy

    Type: StaticChunkingStrategyRequestParam

    Customize your own chunking strategy by setting chunk size and chunk overlap.

    Example
    {
      "type": "static",
      "static": {
        "max_chunk_size_tokens": 100,
        "chunk_overlap_tokens": 0
      }
    }
    
Example
{
  "type": "auto"
}

VectorStoreFileAttributes

Any of 2 types
  • Type: object

    [additional]

    One of 3 types
    • Type: string

      Max length: 512

      Example: example

    • Type: number

    • Type: boolean

    Example: example

    Set of 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.

    Max properties: 16

    Example
    {}
    
  • Type: unknown

    Example: null

Default: null

CreateVectorStoreFileRequest

Name

Description

file_id

Type: string

A File ID that the vector store should use.

Example: example

attributes

Type: VectorStoreFileAttributes

Default: null

Example
{}

chunking_strategy

Type: ChunkingStrategyRequestParam

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

Example
{
  "type": "auto"
}
Example
{
  "file_id": "example",
  "chunking_strategy": {
    "type": "auto"
  },
  "attributes": null
}

Responses

200 OK

OK

Body

application/json
{
  "id": "example",
  "object": "vector_store.files_batch",
  "created_at": 0,
  "vector_store_id": "example",
  "status": "in_progress",
  "file_counts": {
    "in_progress": 0,
    "completed": 0,
    "failed": 0,
    "cancelled": 0,
    "total": 0
  }
}

Name

Description

created_at

Type: integer

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

file_counts

Type: object

cancelled

Type: integer

The number of files that where cancelled.

completed

Type: integer

The number of files that have been processed.

failed

Type: integer

The number of files that have failed to process.

in_progress

Type: integer

The number of files that are currently being processed.

total

Type: integer

The total number of files.

Example
{
  "in_progress": 0,
  "completed": 0,
  "failed": 0,
  "cancelled": 0,
  "total": 0
}

id

Type: string

The identifier, which can be referenced in API endpoints.

Example: example

object

Type: string

The object type, which is always vector_store.file_batch.

Const: vector_store.files_batch

Example: example

status

Type: string

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

Enum: in_progress, completed, cancelled, failed

vector_store_id

Type: string

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

Example: example

Предыдущая