# pip install --upgrade pinecone
import os
from pinecone import Pinecone, SchemaBuilder
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
schema = (
SchemaBuilder()
.add_string_field(name="title", full_text_search={})
.add_string_field(name="body", full_text_search={"language": "en", "stemming": True, "stop_words": True})
.build()
)
index_model = pc.indexes.create(
name="articles",
schema=schema,
read_capacity={"mode": "OnDemand"},
)
host = index_model.host
PINECONE_API_KEY="YOUR_API_KEY"
# EXAMPLE REQUEST 1: On-demand read capacity (default)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": {
"type": "string",
"full_text_search": {}
},
"body": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": { "mode": "OnDemand" },
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 2: Dedicated read capacity
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-dedicated",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"content": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 3: Multi-field schema (text + dense + sparse ranking fields)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-multifield",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": { "type": "string", "full_text_search": {} },
"body": { "type": "string", "full_text_search": { "language": "en", "stemming": true, "stop_words": true } },
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" },
"sparse_embedding": { "type": "sparse_vector" }
}
}
}'
# EXAMPLE REQUEST 4: Classic vector index — reserved `_values` field, served by the Vectors API.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "classic-index",
"schema": {
"fields": {
"_values": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
# EXAMPLE REQUEST 5: Bring-your-own-cloud (BYOC) deployment.
# BYOC indexes require Dedicated read capacity — OnDemand is rejected.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "byoc-index",
"deployment": {
"deployment_type": "byoc",
"environment": "aws-us-east-1-b921"
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"schema": {
"fields": {
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
{
"deletion_protection": "disabled",
"deployment": {
"cloud": "aws",
"deployment_type": "managed",
"region": "us-east-1"
},
"host": "my-index-abc123.svc.pinecone.io",
"name": "my-index",
"read_capacity": {
"mode": "OnDemand",
"status": {
"state": "Ready"
}
},
"schema": {
"fields": {
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
},
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"type": "string"
}
}
},
"status": {
"ready": true,
"state": "Ready"
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Bad request. The request body included invalid request parameters."
},
"status": 400
}"Invalid API key"{
"error": {
"code": "PAYMENT_REQUIRED",
"message": "Request failed. Pay all past due invoices to lift restrictions on your account."
},
"status": 402
}{
"error": {
"code": "FORBIDDEN",
"message": "Increase your quota or upgrade to create more indexes."
},
"status": 403
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource cloud: aws region: us-west1 not found."
},
"status": 404
}{
"error": {
"code": "ALREADY_EXISTS",
"message": "Resource already exists."
},
"status": 409
}{
"error": {
"code": "FAILED_PRECONDITION",
"message": "Index creation failed. Indexes with full_text_search fields are not supported in CMEK-encrypted projects"
},
"status": 412
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"message": "Failed to deserialize the JSON body into the target type: missing field `metric` at line 1 column 16"
},
"status": 422
}{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}Create an index
Create a Pinecone index. Define the schema for your index — dense vector, sparse vector, and full-text search fields — and, optionally, the deployment infrastructure (managed serverless or BYOC). To create an index with an integrated embedding model, use Create an index with integrated embedding. If deployment is omitted, the index is deployed as a managed (serverless) index on aws in us-east-1.
The index schema cannot be modified after creation. Field types, dimensions, metrics, and text-analysis settings are permanent. Choose your schema carefully before creating an index.
To create an index from a backup, use Create index from backup.
For guidance and examples, see Create an index.
# pip install --upgrade pinecone
import os
from pinecone import Pinecone, SchemaBuilder
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
schema = (
SchemaBuilder()
.add_string_field(name="title", full_text_search={})
.add_string_field(name="body", full_text_search={"language": "en", "stemming": True, "stop_words": True})
.build()
)
index_model = pc.indexes.create(
name="articles",
schema=schema,
read_capacity={"mode": "OnDemand"},
)
host = index_model.host
PINECONE_API_KEY="YOUR_API_KEY"
# EXAMPLE REQUEST 1: On-demand read capacity (default)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": {
"type": "string",
"full_text_search": {}
},
"body": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": { "mode": "OnDemand" },
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 2: Dedicated read capacity
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-dedicated",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"content": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 3: Multi-field schema (text + dense + sparse ranking fields)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-multifield",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": { "type": "string", "full_text_search": {} },
"body": { "type": "string", "full_text_search": { "language": "en", "stemming": true, "stop_words": true } },
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" },
"sparse_embedding": { "type": "sparse_vector" }
}
}
}'
# EXAMPLE REQUEST 4: Classic vector index — reserved `_values` field, served by the Vectors API.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "classic-index",
"schema": {
"fields": {
"_values": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
# EXAMPLE REQUEST 5: Bring-your-own-cloud (BYOC) deployment.
# BYOC indexes require Dedicated read capacity — OnDemand is rejected.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "byoc-index",
"deployment": {
"deployment_type": "byoc",
"environment": "aws-us-east-1-b921"
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"schema": {
"fields": {
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
{
"deletion_protection": "disabled",
"deployment": {
"cloud": "aws",
"deployment_type": "managed",
"region": "us-east-1"
},
"host": "my-index-abc123.svc.pinecone.io",
"name": "my-index",
"read_capacity": {
"mode": "OnDemand",
"status": {
"state": "Ready"
}
},
"schema": {
"fields": {
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
},
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"type": "string"
}
}
},
"status": {
"ready": true,
"state": "Ready"
}
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Bad request. The request body included invalid request parameters."
},
"status": 400
}"Invalid API key"{
"error": {
"code": "PAYMENT_REQUIRED",
"message": "Request failed. Pay all past due invoices to lift restrictions on your account."
},
"status": 402
}{
"error": {
"code": "FORBIDDEN",
"message": "Increase your quota or upgrade to create more indexes."
},
"status": 403
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource cloud: aws region: us-west1 not found."
},
"status": 404
}{
"error": {
"code": "ALREADY_EXISTS",
"message": "Resource already exists."
},
"status": 409
}{
"error": {
"code": "FAILED_PRECONDITION",
"message": "Index creation failed. Indexes with full_text_search fields are not supported in CMEK-encrypted projects"
},
"status": 412
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"message": "Failed to deserialize the JSON body into the target type: missing field `metric` at line 1 column 16"
},
"status": 422
}{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}GET /indexes/{index_name} until status.ready: true (and, for Dedicated read capacity, read_capacity.status.state: "Ready") before performing data plane operations.
_values (dense) and/or _sparse_values (sparse) schema fields. These replace the top-level dimension, metric, and vector_type of earlier API versions, and are REST-only for now.semantic_text fields. To combine semantic ranking with full-text search, declare a dense_vector field and provide vector values when you upsert documents. For integrated embedding indexes that use the Records API, see Create an index.Cloud regions
For managed (serverless) indexes, thecloud and region fields in deployment accept the following values:
| Cloud | Region | Supported plans | Availability phase |
|---|---|---|---|
aws | us-east-1 (Virginia) | Starter, Builder, Standard, Enterprise | General availability |
aws | us-west-2 (Oregon) | Builder, Standard, Enterprise | General availability |
aws | eu-west-1 (Ireland) | Builder, Standard, Enterprise | General availability |
aws | eu-central-1 (Frankfurt) | Builder, Standard, Enterprise | General availability |
aws | ap-southeast-1 (Singapore) | Builder, Standard, Enterprise | General availability |
gcp | us-central1 (Iowa) | Builder, Standard, Enterprise | General availability |
gcp | europe-west4 (Netherlands) | Builder, Standard, Enterprise | General availability |
azure | eastus2 (Virginia) | Builder, Standard, Enterprise | General availability |
us-east-1 region of AWS only. To create indexes in other regions, upgrade to the Builder, Standard, or Enterprise plan.deployment.environment to the environment ID provisioned for your account instead. See Bring your own cloud for details.
# pip install --upgrade pinecone
import os
from pinecone import Pinecone, SchemaBuilder
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
schema = (
SchemaBuilder()
.add_string_field(name="title", full_text_search={})
.add_string_field(name="body", full_text_search={"language": "en", "stemming": True, "stop_words": True})
.build()
)
index_model = pc.indexes.create(
name="articles",
schema=schema,
read_capacity={"mode": "OnDemand"},
)
host = index_model.host
PINECONE_API_KEY="YOUR_API_KEY"
# EXAMPLE REQUEST 1: On-demand read capacity (default)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": {
"type": "string",
"full_text_search": {}
},
"body": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": { "mode": "OnDemand" },
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 2: Dedicated read capacity
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-dedicated",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"content": {
"type": "string",
"full_text_search": {}
}
}
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"deletion_protection": "disabled"
}'
# EXAMPLE REQUEST 3: Multi-field schema (text + dense + sparse ranking fields)
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "articles-multifield",
"deployment": {
"deployment_type": "managed",
"cloud": "aws",
"region": "us-east-1"
},
"schema": {
"fields": {
"title": { "type": "string", "full_text_search": {} },
"body": { "type": "string", "full_text_search": { "language": "en", "stemming": true, "stop_words": true } },
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" },
"sparse_embedding": { "type": "sparse_vector" }
}
}
}'
# EXAMPLE REQUEST 4: Classic vector index — reserved `_values` field, served by the Vectors API.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "classic-index",
"schema": {
"fields": {
"_values": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
# EXAMPLE REQUEST 5: Bring-your-own-cloud (BYOC) deployment.
# BYOC indexes require Dedicated read capacity — OnDemand is rejected.
curl "https://api.pinecone.io/indexes" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "byoc-index",
"deployment": {
"deployment_type": "byoc",
"environment": "aws-us-east-1-b921"
},
"read_capacity": {
"mode": "Dedicated",
"dedicated": {
"node_type": "b1",
"scaling": "Manual",
"manual": { "shards": 1, "replicas": 1 }
}
},
"schema": {
"fields": {
"embedding": { "type": "dense_vector", "dimension": 1536, "metric": "cosine" }
}
}
}'
full_text_search field’s resolved analyzer config: language, stemming, and stop_words reflect your request settings or the defaults applied at index creation.Authorizations
Headers
Required date-based version header
Body
The desired configuration for the index.
The configuration needed to create a Pinecone index.
The schema field is required and defines the typed fields for the index. The deployment field selects infrastructure and defaults to managed (serverless) on AWS us-east-1 if omitted. The name is auto-generated if not provided.
The schema to use when creating a Pinecone index. Defines the fields the index searches over: dense vector, sparse vector, and full-text search fields.
At least one of dense_vector, sparse_vector, or a string field with full_text_search must be present; an empty fields map is rejected. At most one dense_vector and one sparse_vector field, and at most 100 full_text_search fields. Metadata used for filtering is not declared in the schema; it is indexed automatically from the documents you upsert.
Show child attributes
Show child attributes
{
"fields": {
"body": {
"full_text_search": { "language": "en" },
"type": "string"
},
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
}
}
}
The name of the index. Must be unique within the project. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. If not provided, a name is generated automatically. Callers that require retry-safe behavior should provide an explicit name — a duplicate request with the same name returns 409, making success detectable on retry.
1 - 45"example-index"
The deployment configuration for index creation. The deployment_type field selects the infrastructure model. Defaults to managed (serverless) in us-east-1 on aws if omitted.
-
managed: Serverless infrastructure managed by Pinecone, includingfull-text search indexes.
-
byoc: Bring-your-own-compute.
- Serverless
- BYOC
Show child attributes
Show child attributes
{
"cloud": "aws",
"deployment_type": "managed",
"region": "us-east-1"
}
The ID of a customer-managed encryption key (CMEK) to use for this index. Requires CMEK to be enabled for your organization. Encrypted indexes cannot have full_text_search fields: a request that sets cmek_id and declares one is rejected, and a project that enforces CMEK rejects any schema with a full_text_search field with 412.
"arn:aws:kms:us-east-1:123456789012:key/mrk-abc123"
By default the index will be created with read capacity mode OnDemand. If you prefer to allocate dedicated read nodes for your workload, you must specify mode Dedicated and additional configurations for node_type and scaling. BYOC indexes do not support OnDemand: a byoc deployment must set mode: Dedicated explicitly, since omitting read_capacity defaults to OnDemand and is rejected.
- On-demand
- Dedicated
Show child attributes
Show child attributes
{ "mode": "OnDemand" }
Custom user tags added to an index, at most 20 per index. Keys must be 80 characters or less and alphanumeric, '_', or '-'. Values must be 120 characters or less and consist of printable ASCII characters or spaces. To unset a key, set the value to be an empty string. null in responses when the index has no tags.
Show child attributes
Show child attributes
{ "tag0": "val0", "tag1": "val1" }
Whether deletion protection is enabled/disabled for the index.
Possible values: disabled or enabled.
Response
The index has been successfully created.
The IndexModel describes the configuration and status of a Pinecone index.
The name of the index. 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 - 45"example-index"
The URL address where the index is hosted.
"semantic-search-c01b5b5.svc.us-west1-gcp.pinecone.io"
The current status of the index.
Show child attributes
Show child attributes
{ "ready": true, "state": "Ready" }
The deployment configuration of a Pinecone index. The deployment_type field indicates which infrastructure model the index uses.
-
pod: Dedicated pod-based infrastructure. Suitable for workloads thatrequire predictable performance.
-
managed: Serverless infrastructure managed by Pinecone, includingfull-text search indexes. Scales automatically; billed per usage.
-
byoc: Bring-your-own-compute. Runs in customer-managed infrastructure.
- Pod-based
- Serverless
- BYOC
Show child attributes
Show child attributes
{
"deployment_type": "pod",
"environment": "us-east1-gcp",
"pod_type": "p1.x1",
"replicas": 1,
"shards": 1
}
The schema of a Pinecone index. The schema defines the typed fields that documents in the index can contain, including vector fields, semantic text fields, and metadata fields.
Show child attributes
Show child attributes
{
"fields": {
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
},
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"type": "string"
}
}
}
Whether deletion protection is enabled/disabled for the index.
Possible values: disabled or enabled.
The private endpoint URL of an index.
"semantic-search-c01b5b5.svc.private.us-west1-gcp.pinecone.io"
Response containing read capacity configuration
- On-demand
- Dedicated
Show child attributes
Show child attributes
{
"mode": "OnDemand",
"status": { "state": "Ready" }
}
The name of the collection this index was created from, if any.
"movie-embeddings"
The ID of the backup this index was restored from, if any.
"670e8400-e29b-41d4-a716-446655440000"
The ID of the customer-managed encryption key (CMEK) used to encrypt this index, if any.
"arn:aws:kms:us-east-1:123456789012:key/mrk-abc123"
Custom user tags added to an index, at most 20 per index. Keys must be 80 characters or less and alphanumeric, '_', or '-'. Values must be 120 characters or less and consist of printable ASCII characters or spaces. To unset a key, set the value to be an empty string. null in responses when the index has no tags.
Show child attributes
Show child attributes
{ "tag0": "val0", "tag1": "val1" }
Was this page helpful?