Database
- Indexes
- Namespaces
- Vectors
- Search
- Imports
- Backups
Inference
- Embed
- Rerank
- Models
Admin
- API keys
- Projects
- Service accounts
Architecture
Indexes
Create an index
Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.
For guidance and examples, see Create an index.
POST
/
indexes
# pip install "pinecone[grpc]"
# Serverless index
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"
)
# Pod-based index
from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_index(
name="docs-example2",
dimension=1536,
metric="cosine",
spec=PodSpec(
environment="us-west1-gcp",
pod_type="p1.x1",
pods=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"
}
}
# Pod-based index
{
"name": "example-pod-index",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "example-pod-index-4zo0ijk.svc.us-west1-gcp.pinecone.io",
"spec": {
"pod": {
"replicas": 1,
"shards": 1,
"pods": 1,
"pod_type": "p1.x1",
"environment": "us-west1-gcp"
}
},
"deletion_protection": "disabled",
"tags": {
"example": "tag"
}
}
# pip install "pinecone[grpc]"
# Serverless index
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"
)
# Pod-based index
from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_index(
name="docs-example2",
dimension=1536,
metric="cosine",
spec=PodSpec(
environment="us-west1-gcp",
pod_type="p1.x1",
pods=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"
}
}
# Pod-based index
{
"name": "example-pod-index",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "example-pod-index-4zo0ijk.svc.us-west1-gcp.pinecone.io",
"spec": {
"pod": {
"replicas": 1,
"shards": 1,
"pods": 1,
"pod_type": "p1.x1",
"environment": "us-west1-gcp"
}
},
"deletion_protection": "disabled",
"tags": {
"example": "tag"
}
}
Authorizations
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.
Was this page helpful?
# pip install "pinecone[grpc]"
# Serverless index
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"
)
# Pod-based index
from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_index(
name="docs-example2",
dimension=1536,
metric="cosine",
spec=PodSpec(
environment="us-west1-gcp",
pod_type="p1.x1",
pods=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"
}
}
# Pod-based index
{
"name": "example-pod-index",
"metric": "cosine",
"dimension": 1536,
"status": {
"ready": true,
"state": "Ready"
},
"host": "example-pod-index-4zo0ijk.svc.us-west1-gcp.pinecone.io",
"spec": {
"pod": {
"replicas": 1,
"shards": 1,
"pods": 1,
"pod_type": "p1.x1",
"environment": "us-west1-gcp"
}
},
"deletion_protection": "disabled",
"tags": {
"example": "tag"
}
}
Assistant
Responses are generated using AI and may contain mistakes.