create_index

This operation creates a Pinecone index. You can use it to specify the measure of similarity, the dimension of vectors to be stored in the index, the numbers of shards and replicas to use, and more.

Request
Security:
ApiKeyAuth
Request Body schema: application/json
name
required
string

The name of the index to be created. The maximum length is 45 characters.

dimension
required
integer

The dimensions of the vectors to be inserted in the index

index_type
string
Deprecated
Default: "approximated"

The type of vector index. Pinecone supports 'approximated'.

metric
string
Default: "cosine"

The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.

pods
integer
Default: 1

The number of pods for the index to use,including replicas.

replicas
integer
Default: 1

The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.

shards
integer
Default: 1

The number of shards to be used in the index.

pod_type
string
Default: "p1.x1"

The type of pod to use. One of s1, p1, or p2 appended with . and one of x1, x2, x4, or x8.

ApproximatedConfig (object)
Deprecated
metadata_config
object or null

Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form:

 {"indexed": ["example_metadata_field"]} 
source_collection
string

The name of the collection to create an index from

Responses
201

The index has been successfully created

400

Bad request. Encountered when request exceeds quota or an invalid index name.

409

Index of given name already exists.

500

Internal error. Can be caused by invalid parameters.

post/databases
Request samples
application/json
{
  • "name": "example-index",
  • "dimension": 1024,
  • "index_type": "approximated",
  • "metric": "cosine",
  • "pods": 1,
  • "replicas": 1,
  • "shards": 1,
  • "pod_type": "p1.x1",
  • "index_config": {
    },
  • "metadata_config": { },
  • "source_collection": "string"
}