Skip to contents

Creates a new Pinecone index. Supports both serverless and pod-based indexes.

Usage

create_index(
  name,
  dimension,
  metric = "cosine",
  spec = NULL,
  deletion_protection = "disabled"
)

Arguments

name

Name of the index (must be unique within project)

dimension

Dimension of vectors to be stored

metric

Distance metric: "cosine", "euclidean", or "dotproduct" (default: "cosine")

spec

Index specification - either serverless or pod configuration (see details)

deletion_protection

Whether to enable deletion protection ("enabled" or "disabled")

Value

List with http response, content (index details including host), and status_code

Details

The `spec` parameter should be a list containing either:

For serverless indexes: list(serverless = list(cloud = "aws", region = "us-east-1"))

For pod-based indexes: list(pod = list(environment = "us-east-1-aws", pod_type = "p1.x1", pods = 1))

Examples

if (FALSE) { # \dontrun{
# Create a serverless index
create_index(
  name = "my-index",
  dimension = 1536,
  metric = "cosine",
  spec = list(serverless = list(cloud = "aws", region = "us-east-1"))
)

# Create a pod-based index
create_index(
  name = "my-pod-index",
  dimension = 1536,
  metric = "cosine",
  spec = list(pod = list(environment = "us-east-1-aws", pod_type = "p1.x1", pods = 1))
)
} # }