# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index_model = pc.indexes.create_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"},
},
)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
const indexModel = await pc.indexes.createForModel({
name: 'docs-example',
cloud: 'aws',
region: 'us-east-1',
embed: {
model: 'multilingual-e5-large',
fieldMap: { text: 'chunk_text' },
},
});
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.CreateIndexForModel(ctx, &pinecone.CreateIndexForModelRequest{
Name: "docs-example",
Cloud: pinecone.CloudAWS,
Region: "us-east-1",
Embed: pinecone.CreateIndexForModelEmbed{
Model: "multilingual-e5-large",
FieldMap: map[string]interface{}{"text": "chunk_text"},
},
})
if err != nil {
log.Fatalf("Failed to create index: %v", err)
}
fmt.Println(idx.Name, idx.Host)
}
# Requires Terraform provider v5.0.0 or later
# Creates a legacy integrated index. For new indexes, declare integrated embedding
# on a string field of a document index instead (provider v5.1.0 or later).
resource "pinecone_index" "docs_example" {
name = "docs-example"
spec = {
serverless = {
cloud = "aws"
region = "us-east-1"
}
}
embed = {
model = "multilingual-e5-large"
field_map = {
text = "chunk_text"
}
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/indexes/create-for-model" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "docs-example",
"cloud": "aws",
"region": "us-east-1",
"embed": {
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
}'
{
"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": {
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"store_text": true,
"type": "string"
},
"your_vector": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
}
}
},
"status": {
"ready": true,
"state": "Ready"
}
}Create a legacy integrated index
Create a legacy integrated index. Legacy integrated indexes created via create-for-model require the legacy Records API.
For new work, create a document index with Create an index, declaring embed or sparse_embed on a string field to enable integrated embedding on it, and read and write the index through the Documents API. Document indexes support integrated embedding alongside full-text search on the same field, and scoring with score_by.
With this type of index, you provide source text, and Pinecone uses a hosted embedding model to convert the text automatically during upsert and search.
The response is this version’s index model, with the embedding configuration surfaced as a semantic_text field in the index schema, named after the field_map text entry. Read and write the index through the legacy Records API.
For guidance and examples, see Create an index.
# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index_model = pc.indexes.create_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"},
},
)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
const indexModel = await pc.indexes.createForModel({
name: 'docs-example',
cloud: 'aws',
region: 'us-east-1',
embed: {
model: 'multilingual-e5-large',
fieldMap: { text: 'chunk_text' },
},
});
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.CreateIndexForModel(ctx, &pinecone.CreateIndexForModelRequest{
Name: "docs-example",
Cloud: pinecone.CloudAWS,
Region: "us-east-1",
Embed: pinecone.CreateIndexForModelEmbed{
Model: "multilingual-e5-large",
FieldMap: map[string]interface{}{"text": "chunk_text"},
},
})
if err != nil {
log.Fatalf("Failed to create index: %v", err)
}
fmt.Println(idx.Name, idx.Host)
}
# Requires Terraform provider v5.0.0 or later
# Creates a legacy integrated index. For new indexes, declare integrated embedding
# on a string field of a document index instead (provider v5.1.0 or later).
resource "pinecone_index" "docs_example" {
name = "docs-example"
spec = {
serverless = {
cloud = "aws"
region = "us-east-1"
}
}
embed = {
model = "multilingual-e5-large"
field_map = {
text = "chunk_text"
}
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/indexes/create-for-model" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "docs-example",
"cloud": "aws",
"region": "us-east-1",
"embed": {
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
}'
{
"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": {
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"store_text": true,
"type": "string"
},
"your_vector": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
}
}
},
"status": {
"ready": true,
"state": "Ready"
}
}# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index_model = pc.indexes.create_for_model(
name="docs-example",
cloud="aws",
region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"},
},
)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
const indexModel = await pc.indexes.createForModel({
name: 'docs-example',
cloud: 'aws',
region: 'us-east-1',
embed: {
model: 'multilingual-e5-large',
fieldMap: { text: 'chunk_text' },
},
});
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
idx, err := pc.CreateIndexForModel(ctx, &pinecone.CreateIndexForModelRequest{
Name: "docs-example",
Cloud: pinecone.CloudAWS,
Region: "us-east-1",
Embed: pinecone.CreateIndexForModelEmbed{
Model: "multilingual-e5-large",
FieldMap: map[string]interface{}{"text": "chunk_text"},
},
})
if err != nil {
log.Fatalf("Failed to create index: %v", err)
}
fmt.Println(idx.Name, idx.Host)
}
# Requires Terraform provider v5.0.0 or later
# Creates a legacy integrated index. For new indexes, declare integrated embedding
# on a string field of a document index instead (provider v5.1.0 or later).
resource "pinecone_index" "docs_example" {
name = "docs-example"
spec = {
serverless = {
cloud = "aws"
region = "us-east-1"
}
}
embed = {
model = "multilingual-e5-large"
field_map = {
text = "chunk_text"
}
}
}
PINECONE_API_KEY="YOUR_API_KEY"
curl "https://api.pinecone.io/indexes/create-for-model" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"name": "docs-example",
"cloud": "aws",
"region": "us-east-1",
"embed": {
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"}
}
}'
Authorizations
An API Key is required to call Pinecone APIs. Get yours from the console.
Body
The desired configuration for the index and associated embedding model.
Specify the integrated embedding configuration for the legacy integrated index.
Once set, the model and field map can't be changed, but you can later update the read parameters and write parameters of a legacy integrated index.
Refer to the model guide for available models and model details.
Show child attributes
Show child attributes
{
"field_map": { "text": "your-text-field" },
"metric": "cosine",
"model": "multilingual-e5-large",
"read_parameters": { "input_type": "query", "truncate": "NONE" },
"write_parameters": { "input_type": "passage" }
}
Whether deletion protection is enabled/disabled for the index.
Possible values: disabled or enabled.
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" }
Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when schema is present, only fields which are present in the fields object with a filterable: true are indexed. Note that filterable: false is not currently supported.
Show child attributes
Show child attributes
{
"fields": {
"description": { "filterable": true },
"genre": { "filterable": true },
"year": { "filterable": true }
}
}
By default the index will be created with read capacity mode OnDemand, for managed and BYOC indexes alike. 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" }
Response
The index has successfully been created for the embedding model.
The IndexModel describes the configuration and status of a Pinecone index.
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 that require predictable performance.managed: Serverless infrastructure managed by Pinecone, including full-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, string fields searched by full-text search or by embeddings, and metadata fields.
Show child attributes
Show child attributes
{
"fields": {
"body": {
"embed": {
"dimension": 1024,
"metric": "cosine",
"model": "llama-text-embed-v2"
},
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"sparse_embed": { "model": "pinecone-sparse-english-v0" },
"store_text": true,
"type": "string"
},
"title": {
"full_text_search": {
"language": "en",
"stemming": false,
"stop_words": false
},
"store_text": true,
"type": "string"
}
}
}
Whether deletion protection is enabled/disabled for the index.
Possible values: disabled or enabled.
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?