All Products
Search
Document Center

Object Storage Service:get-vectors

Last Updated:Mar 20, 2026

Retrieve vector entries from an index by their primary keys.

Permissions

By default, an Alibaba Cloud account has full permissions. Resource Access Management (RAM) users and RAM roles have no permissions by default. Grant the required permissions through a RAM policy or a bucket policy.

APIActionDescription
GetVectorsoss:GetVectorsGets vector data.

Syntax

ossutil vectors-api get-vectors --bucket <value> --index-name <value> --keys <value> [flags]

Parameters

ParameterTypeRequiredDescription
--bucketstringYesThe name of the vector bucket.
--index-namestringYesThe name of the index.
--keysstringsYesThe primary keys of the vectors to retrieve. Duplicate primary keys are allowed.
--return-dataNoWhether to return vector data. Returned by default when omitted or set to true.
--return-metadataNoWhether to return metadata. Returned by default when omitted or set to true.

Limits

ConstraintLimit
Unique keys per request1–100
Key length1–1,024

Examples

Retrieve vectors by primary key. Both vector data and metadata are returned by default. Use --return-data and --return-metadata to control which fields are included.

  • Retrieve vectors with primary keys key and key1 from the index index in the vector bucket examplebucket:

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1
  • Return vector data explicitly:

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-data
  • Return metadata explicitly:

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-metadata
  • Return both vector data and metadata explicitly:

    ossutil vectors-api get-vectors --bucket examplebucket --index-name index --keys key,key1 --return-data --return-metadata

Usage notes