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

Torch Object Storage

Copy page
Download PDF
Vector
ListVectors
Copy page
Download PDF
ListVectors
Description​
List vectors from the vector index.​
Request syntax​
The endpoint must use the Bucket Endpoint.​
​
POST /ListVectors 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",​
"returnData": true,​
"returnMetadata": true,​
"maxResults": 100​
}​
​
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.​
maxResults​
integer​
No​
100​
Maximum number of vectors returned on the page. The default value is 500. If the processed dataset exceeds 1MB before reaching the maxResults value, the operation stops and returns the retrieved vectors along with the nextToken for subsequent requests.​
Value range: 1 to 1000.​
nextToken​
String​
No​
a2V5MA==​
Pagination token from the previous request. For the initial request, this field is empty.​
Length constraint: minimum length is 1, maximum length is 2048.​
returnData​
boolean​
No​
true​
If set to true, the vector data for each vector will be included in the response.​
Default: false.​
returnMetadata​
boolean​
No​
true​
If set to true, the metadata associated with each vector will be included 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 status code along with the following response body elements.​
If the operation fails, it returns the error code defined in the Response code.​
​
Field​
Condition operator type​
Example value​
Description​
nextToken​
String​
a2V5MA==​
Pagination token for subsequent requests. This field is empty if no further pagination is needed.​
vectors​
ListOutputVector[]​
See the table below​
Vector in the current segment. Each object in the array is a ListOutputVector object.​
​
ListOutputVector structure parameter description:​
​
Name​
Type​
Example value​
Description​
data​
VectorData​
{​
"float32": [​
0.1,​
0.1,​
0.1,​
0.1,​
0.1​
]​
}​
Vector data. Ensure the query vector's dimension matches the vector index dimension being queried.​
key​
String​
key0​
Unique identifier for the vector.​
metadata​
JSON value​
{​
"key_a": "va",​
"key_b": "vb",​
"key_c": "vc"​
}​
Metadata associated with the vector.​
​
The VectorData structure is a Union type with only one active member (float32). See the table below.​
​
Field name​
Type​
Example value​
Description​
float32​
float32[]​
[0.1, 0.1, 0.1, 0.1, 0.1]​
Vector data.​
The vector dimension must match the vector index dimension defined in CreateIndex.​
​
Sample request​
​
POST /ListVectors 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",​
"returnData": true,​
"returnMetadata": true,​
"maxResults": 3​
}​
​
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: 266​
Content-Type: application/json​
​
{​
"nextToken": "a2V5MQ==",​
"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