from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_collection("example-collection", "docs-example")
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/collections" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{
"name": "example-collection",
"source": "docs-example"
}'
Create a collection
Create a Pinecone collection.
Serverless indexes do not support collections.
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_collection("example-collection", "docs-example")
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/collections" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{
"name": "example-collection",
"source": "docs-example"
}'
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
pc.create_collection("example-collection", "docs-example")
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/collections" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{
"name": "example-collection",
"source": "docs-example"
}'
Authorizations
Headers
Required date-based version header
Body
The desired configuration for the collection.
The configuration needed to create a Pinecone collection.
The name of the collection to be created. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'.
1 - 45The name of the index to be used as the source for the collection.
"example-source-index"
Response
The collection has been successfully created.
The CollectionModel describes the configuration and status of a Pinecone collection.
The name of the collection.
"example-collection"
The status of the collection.
Possible values: Initializing, Ready, or Terminating.
"Initializing"
The environment where the collection is hosted.
"us-east1-gcp"
The size of the collection in bytes.
10000000
The dimension of the vectors stored in each record held in the collection.
1 <= x <= 200001536
The number of records stored in the collection.
120000
Was this page helpful?