This page shows you how to create a pod-based index. For guidance on serverless indexes, see Create a serverless index.

You can create an index using the Pinecone console.

Create a pod index

To create a pod index, use the create_index operation as follows:

  • Provide a name for the index.
  • Specify the dimension and metric of the vectors you’ll store in the index. This should match the dimension and metric supported by your embedding model.
  • Set spec.environment to the environment where the index should be deployed. For Python, you also need to import the ServerlessSpec class.
  • Set spec.pod_type to the pod type and size that you want.

Other parameters are optional. See the API reference for details.

from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec

pc = Pinecone(api_key="YOUR_API_KEY")

pc.create_index(
  name="example-index",
  dimension=1536,
  metric="cosine",
  spec=PodSpec(
    environment="us-west1-gcp",
    pod_type="p1.x1",
    pods=1
  ),
  deletion_protection="disabled"

)

Create a pod index from a collection

You can create a pod-based index from a collection. For more details, see Restore an index.