All Products
Search
Document Center

Object Storage Service:put-vector-index

Last Updated:Jun 27, 2026

The put-vector-index command creates a vector index in a vector bucket.

Notes

  • A single vector bucket can contain up to 100 vector indexes.

  • A maximum of 5 PutVectorIndex requests are supported per second.

Permissions

By default, Alibaba Cloud accounts have all permissions, whereas Resource Access Management (RAM) users and RAM roles have no permissions. The Alibaba Cloud account or an administrator must grant permissions through a RAM policy or a bucket policy.

API

Action

Description

PutVectorIndex

oss:PutVectorIndex

Creates a vector index.

Command format

ossutil vectors-api put-vector-index --bucket value --index-name value [flags]

Parameters

Parameter

Type

Description

--bucket

string

The name of the vector bucket.

--data-type

string

The data type of the vector. Custom data types are not supported. Default value: float32.

--dimension

int

The vector dimensions. The value can be an integer from 1 to 4096. The default value is 512.

--distance-metric

string

The distance measure function. Valid values:

  • euclidean: Euclidean distance (default)

  • cosine: Cosine distance

--index-name

string

The name of the index. You can specify a custom name. The default value is empty.

  • The name must be globally unique within the vector bucket and must be 1 to 63 characters in length.

  • The name can contain only letters and digits, and must start with a letter.

--metadata

string

The container for metadata configuration. Only non-filterable metadata is supported. The following limits apply to the configuration of non-filterable metadata:

  • The number of metadata entries must be from 1 to 100.

  • The length of each metadata primary key name must be from 1 to 63 bytes.

Note

Usage examples

  • Create an index named index for the examplebucket bucket. The index has 512 vector dimensions, uses the float32 data type, and the euclidean distance measure.

    ossutil vectors-api put-vector-index --bucket examplebucket --index-name index --data-type float32 --dimension 512 --distance-metric euclidean
  • Create an index named index for the examplebucket bucket and configure non-filterable metadata. The index has 512 vector dimensions, uses the float32 data type, and the euclidean distance measure.

    ossutil vectors-api put-vector-index --bucket examplebucket --index-name index --data-type float32 --dimension 512 --distance-metric euclidean --metadata '{"nonFilterableMetadataKeys":["owner","createdBy"]}'