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

Torch Object Storage

Copy page
Download PDF
Vector index
CreateIndex
Copy page
Download PDF
CreateIndex
Description​
Create a vector index under the vector bucket. The vector index name must be unique within the vector bucket.​
Request syntax​
The endpoint must use the bucket endpoint.​
​
POST /CreateIndex 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",​
"dataType": "float32",​
"dimension": 5,​
"distanceMetric": "euclidean",​
"metadataConfiguration":{​
"nonFilterableMetadataKeys": [​
"key_c",​
"key_d"​
]​
}​
}​
​
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 to create the vector index in.​
indexName​
String​
Yes​
test-index​
Name of the vector index to be created.​
length limit: minimum length is 3, maximum length is 63.​
dataType​
String​
Yes​
float32​
Data type of the vectors to be inserted into the vector index.​
Valid value: float32​
dimension​
integer​
Yes​
5​
Dimension of the vector to insert into the vector index.​
Valid range: minimum 1, maximum 4096.​
distanceMetric​
String​
Yes​
euclidean​
Distance metric for similarity search.​
Valid values: euclidean | cosine​
metadataConfiguration​
MetadataConfiguration​
No​
{​
"nonFilterableMetadataKeys": [​
"key_c",​
"key_d"​
]​
}​
Metadata configuration for the vector index.​
​
MetadataConfiguration is defined as follows:​
​
Name​
Type​
Example value​
Description​
nonFilterableMetadataKeys​
string[]​
[​
"key_c",​
"key_d"​
]​
List of metadata keys not available for filtering.​
​
Response headers​
For common response headers, see Common parameters.​
Response body elements​
If the operation succeeds, the service returns an HTTP 200 response with an empty response body element.​
If the operation fails, it returns the error code defined in the Response code.​
Sample request​
​
POST /CreateIndex 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",​
"dataType": "float32",​
"dimension": 5,​
"distanceMetric": "euclidean",​
"metadataConfiguration":{​
"nonFilterableMetadataKeys": [​
"key_a",​
"key_b"​
]​
}​
}​
​
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: 0​
​
​
Last updated: 2026.01.04 14:21:24