Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

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.

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.

Creates a new schema-defined index. The schema declares each field and its type — dense vector, sparse vector, or 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.

For managed (serverless) indexes, the cloud 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

The cloud and region can't be changed after a serverless index is created.

For BYOC indexes, set deployment.environment to the environment ID provisioned for your account instead. See Bring Your Own Cloud for details.

Python
# 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
curl
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" }
      }
    }
  }'

POST /indexes

  • X-Pinecone-Api-Version (header, string, required) — Required date-based version header
  • name (body, string) — The name of the index. Must be unique within the project, start and end with an alphanumeric character, and contain only lower case alphanumeric characters or '-'. Generated automatically if not provided.
  • deployment (body, 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. - managed: Serverless infrastructure managed by Pinecone, including full-text search indexes. - byoc: Bring-your-own-compute.
  • schema (body, object, required) — 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. Me
  • cmek_id (body, string) — 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.
  • read_capacity (body, 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. BYOC indexes do not support OnDemand: a byoc deployment must set mode: Dedicated explicitly, since omitting read_capacity defaults to OnDemand and is reject
  • tags (body, object) — 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.
  • deletion_protection (body, string) — Whether deletion protection is enabled/disabled for the index. Possible values: disabled or enabled.
  • 201 — The index has been successfully created.
  • 400 — Bad request. The request body included invalid request parameters.
  • 401 — Unauthorized. Possible causes: missing or invalid API key.
  • 402 — Payment required. Organization is on a paid plan and is delinquent on payment.
  • 403 — Forbidden. Possible causes: the project's index quota is exhausted, dedicated read capacity is not enabled for the organization, or (when configuring) the index's read capacity is not yet Ready.
  • 404 — Unknown cloud or region when creating a serverless index.
  • 409 — Index of given name already exists.
  • 412 — The project's encryption settings do not allow this index.
  • 422 — Unprocessable entity. The request body could not be deserialized.
  • 500 — Internal server error.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu