Skip to main content
POST
/
indexes
# pip install --upgrade pinecone
import os
from pinecone import Pinecone
from pinecone.preview import 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})
      .add_string_field(name="category", filterable=True)
      .add_float_field(name="year", filterable=True)
      .build()
)

index_model = pc.preview.indexes.create(
    name="articles",
    schema=schema,
    read_capacity={"mode": "OnDemand"},
)

host = index_model.host
// Status: 201 Created
{
  "id": "e51ea4e1-2dda-4607-94dc-9054b1fa8492",
  "name": "articles",
  "host": "articles-jweaq8m.svc.aped-4627-b74a.pinecone.io",
  "status": {
    "ready": false,
    "state": "Initializing"
  },
  "deployment": {
    "deployment_type": "managed",
    "cloud": "aws",
    "region": "us-east-1",
    "environment": "aped-4627-b74a"
  },
  "schema": {
    "version": "v1",
    "fields": {
      "title":    { "type": "string", "full_text_search": { "language": "en", "stemming": false, "stop_words": false, "lowercase": true, "max_token_length": 40 } },
      "body":     { "type": "string", "full_text_search": { "language": "en", "stemming": false, "stop_words": false, "lowercase": true, "max_token_length": 40 } },
      "category": { "type": "string", "filterable": true }
    }
  },
  "read_capacity": {
    "mode": "OnDemand",
    "status": { "state": "Ready" }
  },
  "tags": null,
  "deletion_protection": "disabled"
}

Documentation Index

Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt

Use this file to discover all available pages before exploring further.

Full-text search is in public preview and uses API version 202601-alpha. APIs may continue to evolve before general availability.
Creates a new schema-defined index for full-text search. The index initializes asynchronously; poll GET /indexes/{index_name} until status.ready: true (and, for Dedicated read capacity, read_capacity.status.state: "Ready") before performing data plane operations.
Document-shaped schemas do not support 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.
# pip install --upgrade pinecone
import os
from pinecone import Pinecone
from pinecone.preview import 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})
      .add_string_field(name="category", filterable=True)
      .add_float_field(name="year", filterable=True)
      .build()
)

index_model = pc.preview.indexes.create(
    name="articles",
    schema=schema,
    read_capacity={"mode": "OnDemand"},
)

host = index_model.host
// Status: 201 Created
{
  "id": "e51ea4e1-2dda-4607-94dc-9054b1fa8492",
  "name": "articles",
  "host": "articles-jweaq8m.svc.aped-4627-b74a.pinecone.io",
  "status": {
    "ready": false,
    "state": "Initializing"
  },
  "deployment": {
    "deployment_type": "managed",
    "cloud": "aws",
    "region": "us-east-1",
    "environment": "aped-4627-b74a"
  },
  "schema": {
    "version": "v1",
    "fields": {
      "title":    { "type": "string", "full_text_search": { "language": "en", "stemming": false, "stop_words": false, "lowercase": true, "max_token_length": 40 } },
      "body":     { "type": "string", "full_text_search": { "language": "en", "stemming": false, "stop_words": false, "lowercase": true, "max_token_length": 40 } },
      "category": { "type": "string", "filterable": true }
    }
  },
  "read_capacity": {
    "mode": "OnDemand",
    "status": { "state": "Ready" }
  },
  "tags": null,
  "deletion_protection": "disabled"
}
Responses show the full resolved analyzer config for each full_text_search field. language, stemming, and stop_words reflect request settings or defaults; lowercase and max_token_length are server-applied and cannot be overridden.

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Headers

X-Pinecone-Api-Version
string
default:202601-alpha
required

Required date-based version header

Body

application/json

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.

schema
object
required

The schema to use when creating a Pinecone index. Defines the typed fields that documents in the index can contain, including vector fields, semantic text fields, and metadata fields. At least one primary field (dense_vector, sparse_vector, semantic_text, or a string field with full_text_search) must be present.

Example:
{
"fields": {
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
},
"genre": { "filterable": true, "type": "string" },
"year": { "filterable": true, "type": "float" }
}
}
name
string

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.

Required string length: 1 - 45
Example:

"example-index"

deployment
Pod-based · object

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.

  • pod: Dedicated pod-based infrastructure. - managed: Serverless infrastructure managed by Pinecone, including

    full-text search indexes.

  • byoc: Bring-your-own-compute.

Example:
{
"deployment_type": "pod",
"environment": "us-east1-gcp",
"pod_type": "p1.x1",
"replicas": 1,
"shards": 1
}
source_collection
string

The name of a collection from which to create the index. The collection must have been created from a pod-based index with a compatible schema.

Example:

"movie-embeddings"

source_backup_id
string

The ID of a backup from which to restore the index. Mutually exclusive with source_collection.

Example:

"670e8400-e29b-41d4-a716-446655440000"

cmek_id
string

The ID of a customer-managed encryption key (CMEK) to use for this index. Requires CMEK to be enabled for your organization.

Example:

"arn:aws:kms:us-east-1:123456789012:key/mrk-abc123"

read_capacity
On-demand · object

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.

Example:
{ "mode": "OnDemand" }
tags
object

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.

Example:
{ "tag0": "val0", "tag1": "val1" }
deletion_protection
string
default:disabled

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.

name
string
required

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 '-'.

Required string length: 1 - 45
Example:

"example-index"

host
string
required

The URL address where the index is hosted.

Example:

"semantic-search-c01b5b5.svc.us-west1-gcp.pinecone.io"

status
object
required

The current status of the index.

Example:
{ "ready": true, "state": "Ready" }
deployment
Pod-based · object
required

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.

Example:
{
"deployment_type": "pod",
"environment": "us-east1-gcp",
"pod_type": "p1.x1",
"replicas": 1,
"shards": 1
}
schema
object
required

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.

Example:
{
"fields": {
"embedding": {
"dimension": 1536,
"metric": "cosine",
"type": "dense_vector"
},
"title": {
"full_text_search": { "language": "en" },
"type": "string"
}
}
}
deletion_protection
string
default:disabled
required

Whether deletion protection is enabled/disabled for the index. Possible values: disabled or enabled.

private_host
string

The private endpoint URL of an index.

Example:

"semantic-search-c01b5b5.svc.private.us-west1-gcp.pinecone.io"

read_capacity
On-demand · object

Response containing read capacity configuration

Example:
{
"mode": "OnDemand",
"status": { "state": "Ready" }
}
source_collection
string

The name of the collection this index was created from, if any.

Example:

"movie-embeddings"

source_backup_id
string

The ID of the backup this index was restored from, if any.

Example:

"670e8400-e29b-41d4-a716-446655440000"

cmek_id
string

The ID of the customer-managed encryption key (CMEK) used to encrypt this index, if any.

Example:

"arn:aws:kms:us-east-1:123456789012:key/mrk-abc123"

tags
object

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.

Example:
{ "tag0": "val0", "tag1": "val1" }