from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index_model = pc.create_index_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
)
Create an index with integrated embedding
Create a serverless index with an integrated embedding model. Pinecone automatically embeds text written to the specified field at write time and embeds queries at read time using the same model.
This is a convenience wrapper around Create Index that constructs a semantic_text schema field from the model parameters you provide. For full control over schema composition (e.g., combining semantic text with metadata fields), use Create Index directly.
For guidance and examples, see Create an index.
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index_model = pc.create_index_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
)
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
index_model = pc.create_index_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
)
Authorizations
Headers
Required date-based version header
Body
The desired configuration for the index and associated embedding model.
Configuration for creating an index with an integrated embedding model. The server constructs a semantic_text schema field named field using the provided model parameters.
The name of the schema field that will hold the embedded text. This becomes a semantic_text field in the index schema.
"content"
The name of the embedding model to use. Refer to the model guide for available models and details.
"multilingual-e5-large"
The name of the index. Auto-generated if not provided. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. 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"
Deployment configuration for a serverless (managed) index. Serverless indexes scale automatically and you are billed only for the resources you use. This deployment type also covers full-text search indexes, which are serverless under the hood.
Show child attributes
Show child attributes
{
"cloud": "aws",
"deployment_type": "managed",
"region": "us-east-1"
}The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the vector_type is dense, the metric defaults to 'cosine'.
Possible values: cosine, euclidean, or dotproduct.
Model-specific parameters applied when embedding documents at write time.
{ "input_type": "passage" }Model-specific parameters applied when embedding queries at read time.
{ "input_type": "query", "truncate": "NONE" }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.
- On-demand
- Dedicated
Show child attributes
Show child attributes
{ "mode": "OnDemand" }Custom user tags added to an index. Keys must be 80 characters or less. Values must be 120 characters or less. Keys must be alphanumeric, '', or '-'. Values must be alphanumeric, ';', '@', '', '-', '.', '+', or ' '. To unset a key, set the value to be an empty string.
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" },
"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. Keys must be 80 characters or less. Values must be 120 characters or less. Keys must be alphanumeric, '', or '-'. Values must be alphanumeric, ';', '@', '', '-', '.', '+', or ' '. To unset a key, set the value to be an empty string.
Show child attributes
Show child attributes
{ "tag0": "val0", "tag1": "val1" }Was this page helpful?