POST
/
indexes
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec

pc = Pinecone(api_key="YOUR_API_KEY")

pc.create_index(
  name="docs-example1",
  dimension=1536,
  metric="cosine",
  spec=ServerlessSpec(
    cloud="aws",
    region="us-east-1",
  ),
  deletion_protection="disabled"
)
# Serverless index
{
    "name": "example-serverless-index",
    "vector_type": "dense",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "example-serverless-index-govk0nt.svc.aped-4627-b74a.pinecone.io",
    "spec": {
        "serverless": {
            "region": "us-east-1",
            "cloud": "aws"
        }
    },
    "deletion_protection": "disabled",
    "tags": {
        "example": "tag"
    }
}

# BYOC index
{
    "name": "example-byoc-index",
    "vector_type": "dense",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "example-byoc-index-govk0nt.svc.private.aped-4627-b74a.pinecone.io",
    "spec": {
        "byoc": {
            "environment": "aws-us-east-1-b921"
        }
    },
    "deletion_protection": "disabled",
    "tags": {
        "example": "tag"
    }
}
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec

pc = Pinecone(api_key="YOUR_API_KEY")

pc.create_index(
  name="docs-example1",
  dimension=1536,
  metric="cosine",
  spec=ServerlessSpec(
    cloud="aws",
    region="us-east-1",
  ),
  deletion_protection="disabled"
)
# Serverless index
{
    "name": "example-serverless-index",
    "vector_type": "dense",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "example-serverless-index-govk0nt.svc.aped-4627-b74a.pinecone.io",
    "spec": {
        "serverless": {
            "region": "us-east-1",
            "cloud": "aws"
        }
    },
    "deletion_protection": "disabled",
    "tags": {
        "example": "tag"
    }
}

# BYOC index
{
    "name": "example-byoc-index",
    "vector_type": "dense",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "example-byoc-index-govk0nt.svc.private.aped-4627-b74a.pinecone.io",
    "spec": {
        "byoc": {
            "environment": "aws-us-east-1-b921"
        }
    },
    "deletion_protection": "disabled",
    "tags": {
        "example": "tag"
    }
}

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Body

application/json

The desired configuration for the index.

The configuration needed to create a Pinecone index.

Response

201
application/json

The index has been successfully created.

The IndexModel describes the configuration and status of a Pinecone index.