You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Vector
GetVectors
Copy page
Download PDF
GetVectors
Description​
Batch query vectors by vector key from the vector index.​
Request syntax​
The endpoint must use the Bucket Endpoint.​
​
POST /GetVectors HTTP/1.1​
Host: {VectorBucketName}-{AccountID}.tosvectors-cn-beijing.volces.com​
Authorization: authorization string​
Date: Mon, 10 Dec 2025 12:49:14 GMT​
​
​
{​
"vectorBucketName": "test-vector-bucket",​
"indexName":"test-index",​
"keys": ["key0", "key1"],​
"returnData": true,​
"returnMetadata": true​
}​
​
Request parameters and headers ​
None.​
Request body elements​
​
Field name​
Type​
Required​
Example value​
Description​
vectorBucketName​
String​
Yes​
test-vector-bucket​
Name of the vector bucket.​
indexName​
String​
Yes​
test-index​
Name of the vector index.​
keys​
string[]​
Yes​
["key0", "key1"]​
The list of vector names whose attributes you want to return.​
Array items: minimum 1 item, maximum 100 items.​
String length: minimum 1 character, maximum 1024 characters.​
returnData​
boolean​
No​
true​
Indicates whether vector data is included in the response.​
Default: false.​
returnMetadata​
boolean​
No​
true​
Indicates whether to include metadata in the response.​
Default: false.​
​
Response headers​
For common response headers, see Common parameters.​
Response body elements​
If the operation succeeds, the service returns an HTTP 200 response code along with the following response body elements.​
If the operation fails, it returns the error code defined in the Response code.​
​
Field name​
Type​
Example value​
Description​
vectors​
GetOutputVector[]​
See the table below​
array of vector attributes.​
​
Explanation of GetOutputVector struct parameters:​
​
Field name​
Type​
Example value​
Description​
data​
VectorData​
"float32": [0.1, 0.1, 0.1, 0.1, 0.1]​
Vector data. Ensure the query vector dimension matches the vector index dimension being queried.​
key​
String​
key0​
The unique identifier of the vector.​
metadata​
JSON value​
{​
"key_a": "va",​
"key_b": "vb",​
"key_c": "vc"​
}​
Metadata associated with the vector.​
​
The VectorData struct is a Union type with only one valid member (float32) currently, see the table below.​
​
Field name​
Type​
Description​
float32​
float32[]​
Vector data.​
The vector dimension must match the vector index dimension defined in CreateIndex.​
​
Sample request​
​
POST /GetVectors HTTP/1.1​
Host: test-vector-bucket-1111.tosvectors-cn-beijing.volces.com​
Authorization: authorization string​
Date: Mon, 10 Dec 2025 12:49:14 GMT​
​
{​
"vectorBucketName": "test-vector-bucket",​
"indexName":"test-index",​
"keys": ["key0", "key1"],​
"returnData": true,​
"returnMetadata": true​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
x-tos-id-2: 797014003c90a9b694003c9-b15a995-1vV80n-CVB-cb-tos-1az-front-azd-vectors-2 ​
x-tos-request-id: 797014003c90a9b694003c9-b15a995-1vV80n-CVB-cb-tos-1az-front-azd-vectors-2 ​
Date: Mon, 10 Dec 2025 12:49:14 GMT​
server: TosServer​
Content-Length: 243​
Content-Type: application/json​
​
{​
"vectors": [​
{​
"data": {​
"float32": [​
0.1,​
0.1,​
0.1,​
0.1,​
0.1​
]​
},​
"key": "key0",​
"metadata": {​
"key_a": "va",​
"key_b": "vb",​
"key_c": "vc"​
}​
},​
{​
"data": {​
"float32": [​
0.2,​
0.2,​
0.2,​
0.2,​
0.2​
]​
},​
"key": "key1",​
"metadata": {​
"key_a": "va",​
"key_b": "vb",​
"key_c": "vc1",​
"key_d": "vd"​
}​
}​
]​
}​
​
​
Last updated: 2026.01.04 14:21:23