Preview¶
Preview — not covered by SemVer
The preview namespace exposes pre-release API features. Signatures,
behavior, and availability may change in any minor SDK release without
notice. Pin your SDK version when relying on preview features.
Preview features are not subject to the SDK’s normal deprecation policy.
Access via pc.preview on a Pinecone instance, or
pc.preview on an AsyncPinecone instance.
Preview (sync)¶
- class pinecone.preview.Preview(http, config)[source]¶
Bases:
objectSync preview namespace — routes to per-area preview classes.
Preview
Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.
- Parameters:
http (HTTPClient) – Shared HTTP client from the parent
Pineconeinstance.config (PineconeConfig) – SDK configuration shared with the parent client.
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> info = pc.preview.indexes.describe("articles-en-preview") >>> print(info.host)
- __init__(http, config)[source]¶
- Parameters:
http (HTTPClient)
config (PineconeConfig)
- Return type:
None
- close()[source]¶
Close preview sub-clients. Idempotent.
Preview
Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> index = pc.preview.index(name="articles-en-preview") >>> pc.preview.close()
Or use the parent client as a context manager, which closes preview automatically:
>>> with Pinecone(api_key="your-api-key") as pc: ... index = pc.preview.index(name="articles-en-preview")
- Return type:
None
- index(*, name=None, host=None)[source]¶
Get a
PreviewIndexfor data-plane operations.Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Exactly one of
nameorhostmust be provided. Whennameis given, the host is resolved viadescribe()and the result is cached on thisPreviewinstance so subsequent calls with the same name avoid an extra control-plane round-trip.- Parameters:
- Returns:
PreviewIndexconnected to the resolved host.- Raises:
PineconeValueError – If neither or both of
nameandhostare provided.NotFoundError – If
nameis given but the index does not exist.ApiError – If the describe call returns an error response.
- Return type:
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> index = pc.preview.index(name="articles-en-preview")
Or pass a host directly to skip the control-plane call:
>>> index = pc.preview.index(host="https://articles-en-preview-xyz.pinecone.io")
- property indexes: PreviewIndexes¶
Access the preview indexes control-plane namespace.
Lazily instantiated on first access. Reuses the parent client’s configuration and credentials.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Returns:
PreviewIndexesinstance.
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> info = pc.preview.indexes.describe("articles-en-preview") >>> print(info.host)
PreviewIndexes¶
- class pinecone.preview.indexes.PreviewIndexes(config)[source]¶
Bases:
objectControl-plane operations for preview indexes (
2026-01.alpha).Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Access via
pc.preview.indexes.- Parameters:
config (PineconeConfig) – SDK configuration used to construct an HTTP client targeting the preview API version.
- close()[source]¶
Close the underlying HTTP client. Idempotent.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Return type:
None
- configure(name, *, schema=None, deletion_protection=None, tags=None, read_capacity=None)[source]¶
Update configuration of an existing preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Only the fields you provide are updated; omitted parameters are left unchanged on the server.
- Parameters:
name (str) – Name of the preview index to configure.
schema (dict[str, Any] | None) –
Updated schema definition. Pass a dict with a
"fields"key mapping field names to typed field definitions. The server only allows additive changes — it rejects requests that remove or modify existing fields. Example:pc.preview.indexes.configure( "my-index", schema={"fields": { "summary": {"type": "string", "full_text_search": {}}, }}, )
deletion_protection (str | None) –
"enabled"to prevent accidental deletion;"disabled"to allow it.tags (dict[str, str] | None) – Replacement set of key-value tags for the index. Keys must be at most 80 characters; values at most 120 characters.
read_capacity (dict[str, Any] | None) – Updated read capacity configuration dict. Must include a
"mode"key ("OnDemand"or"Dedicated").
- Returns:
PreviewIndexModelreflecting the updated index state.- Raises:
PineconeValueError – If name is empty; if all kwargs are
None; if schema, tags, or read_capacity is an empty dict; or if a tag key/value exceeds the length limit.ApiError – If the API returns an error response.
- Return type:
PreviewIndexModel
Examples
pc.preview.indexes.configure( "my-index", schema={"fields": {"summary": {"type": "string"}}}, )
Update read capacity to dedicated:
pc.preview.indexes.configure( "my-index", read_capacity={"mode": "Dedicated", "node_type": "b1", "scaling": "Manual", "manual": {"shards": 2, "replicas": 1}}, )
Update tags:
pc.preview.indexes.configure( "my-index", tags={"env": "prod", "team": "search"}, )
Enable deletion protection:
pc.preview.indexes.configure("my-index", deletion_protection="enabled")
- create(*, schema, name=None, deployment=None, read_capacity=None, deletion_protection=None, tags=None)[source]¶
Create a new preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
Index schema definition. A dict with a
"fields"key mapping field names to their typed field definitions. Example:{ "fields": { "embedding": {"type": "dense_vector", "dimension": 1536}, "title": {"type": "string", "full_text_search": {}}, } }
name (str | None) – Optional name for the index. If omitted, the API assigns one.
deployment (dict[str, Any] | None) – Optional deployment configuration dict. Must include a
"deployment_type"key (e.g."managed","pod","byoc"). When omitted the API uses its default deployment.read_capacity (dict[str, Any] | None) – Optional read capacity configuration dict. Must include a
"mode"key ("OnDemand"or"Dedicated"). When omitted the API uses on-demand mode.deletion_protection (str | None) – Optional deletion-protection setting —
"enabled"or"disabled". Defaults to"disabled"if not provided.tags (dict[str, str] | None) – Optional key-value tags for the index. Keys must be at most 80 characters; values must be at most 120 characters.
- Returns:
PreviewIndexModeldescribing the newly created index. The returned model’sstatus.readymay beFalse— usedescribe()to poll until the index is ready.- Raises:
PineconeValueError – If a tag key exceeds 80 characters or a tag value exceeds 120 characters.
ApiError – If the API returns an error response.
- Return type:
PreviewIndexModel
Examples
pc.preview.indexes.create( schema={"fields": {"embedding": {"type": "dense_vector", "dimension": 1536}}}, name="my-preview-index", )
- create_backup(index_name, *, name=None, description=None)[source]¶
Create a backup of a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
- Returns:
PreviewBackupModeldescribing the newly created backup. Thestatusfield will typically be"Initializing"immediately after creation. Polldescribe_backup()untilstatus == "Ready"before using the backup:backup = pc.preview.indexes.create_backup("my-index", name="nightly") # Poll until ready import time while backup.status != "Ready": time.sleep(5) backup = pc.preview.indexes.describe_backup(backup.backup_id)
- Raises:
PineconeValueError – If index_name is empty.
ApiError – If the API returns an error response.
- Return type:
PreviewBackupModel
Examples
pc.preview.indexes.create_backup("my-index") pc.preview.indexes.create_backup( "my-index", name="nightly", description="Daily backup" )
- delete(name, *, timeout=None)[source]¶
Delete a named preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Sends a DELETE request and, depending on timeout, polls until the index disappears.
- Parameters:
name (str) – Name of the preview index to delete.
timeout (int | None) –
Controls post-delete polling behaviour.
None(default): polldescribe()every 5 seconds with no upper bound until the index is gone.-1: return immediately after the DELETE response without polling.Positive integer: poll until the index is gone or timeout seconds have elapsed. Raises
PineconeTimeoutErrorif the deadline is reached before the index disappears.
- Returns:
None- Raises:
PineconeValueError – If name is empty.
NotFoundError – If the index does not exist.
ForbiddenError – If deletion protection is enabled on the index.
PineconeTimeoutError – If timeout seconds elapse before the index disappears.
ApiError – If the API returns another error response.
- Return type:
None
Examples
pc.preview.indexes.delete("my-preview-index") # Delete and wait up to 60 seconds pc.preview.indexes.delete("my-preview-index", timeout=60) # Delete without polling pc.preview.indexes.delete("my-preview-index", timeout=-1)
- describe(name)[source]¶
Get detailed information about a named preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
name (str) – Name of the preview index to describe.
- Returns:
PreviewIndexModelwith name, host, schema, deployment, read_capacity, status, deletion_protection, and tags.- Raises:
PineconeValueError – If name is empty.
NotFoundError – If the index does not exist.
ApiError – If the API returns another error response.
- Return type:
PreviewIndexModel
Examples
desc = pc.preview.indexes.describe("my-preview-index") print(desc.host)
- exists(name)[source]¶
Check whether a named preview index exists.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Uses
describe()internally; catchesNotFoundErrorand returnsFalse.- Parameters:
name (str) – Name of the preview index to check.
- Returns:
Trueif the index exists,Falseif it does not.- Raises:
PineconeValueError – If name is empty.
ApiError – If the API returns an error other than 404.
- Return type:
Examples
if pc.preview.indexes.exists("my-preview-index"): print("Index found")
- list(*, limit=None, pagination_token=None)[source]¶
List all preview indexes.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.The 2026-01.alpha server returns all indexes in a single page. The returned
Paginatoralways yields exactly one page and then terminates, but the paginator interface is used for consistency with other list methods and forward compatibility.- Parameters:
- Returns:
PaginatoroverPreviewIndexModelinstances.- Raises:
PineconeValueError – If limit is zero or negative.
ApiError – If the API returns an error response.
- Return type:
Paginator[PreviewIndexModel]
Examples
for index in pc.preview.indexes.list(): print(index.name)
Access page-level metadata:
for page in pc.preview.indexes.list().pages(): print(f"Got {len(page.items)} indexes") for index in page.items: print(index.name)
- list_backups(index_name, *, limit=None, pagination_token=None)[source]¶
List backups for a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
- Returns:
PaginatoroverPreviewBackupModelinstances.- Raises:
PineconeValueError – If index_name is empty or limit is zero or negative.
ApiError – If the API returns an error response.
- Return type:
Paginator[PreviewBackupModel]
Examples
for backup in pc.preview.indexes.list_backups("my-index"): print(backup.backup_id, backup.status)
Access page-level metadata:
for page in pc.preview.indexes.list_backups("my-index").pages(): print(f"Got {len(page.items)} backups") for backup in page.items: print(backup.backup_id)
PreviewIndex¶
- class pinecone.preview.index.PreviewIndex(host, config)[source]¶
Bases:
objectData-plane wrapper for a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Obtain via
pc.preview.index(name=...)orpc.preview.index(host=...).- Parameters:
host (str) – Normalized data-plane host URL for this index.
config (PineconeConfig) – SDK configuration shared with the parent client.
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> with pc.preview.index(name="articles-en-preview") as index: ... response = index.documents.upsert( ... namespace="articles-en", ... documents=[{"_id": "doc-1", "title": "Introduction to vectors"}], ... )
Explicit open/close when a context manager is not convenient:
>>> index = pc.preview.index(host="https://my-index.svc.pinecone.io") >>> try: ... response = index.documents.upsert( ... namespace="articles-en", ... documents=[{"_id": "doc-1", "title": "Introduction to vectors"}], ... ) ... finally: ... index.close()
- close()[source]¶
Close the underlying HTTP client. Idempotent.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> index = pc.preview.index(host="https://my-index.svc.pinecone.io") >>> index.close()
- Return type:
None
- property host: str¶
Data-plane host URL for this index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> index = pc.preview.index(host="https://my-index.svc.pinecone.io") >>> print(index.host) https://my-index.svc.pinecone.io
Preview (async)¶
- class pinecone.preview.AsyncPreview(http, config)[source]¶
Bases:
objectAsync preview namespace — routes to per-area async preview classes.
Preview
Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.
- Parameters:
http (AsyncHTTPClient) – Shared async HTTP client from the parent
AsyncPineconeinstance.config (PineconeConfig) – SDK configuration shared with the parent client.
Examples
>>> import asyncio >>> from pinecone import AsyncPinecone >>> async def main(): ... pc = AsyncPinecone(api_key="your-api-key") ... info = await pc.preview.indexes.describe("articles-en-preview") ... print(info.host) >>> asyncio.run(main())
- __init__(http, config)[source]¶
- Parameters:
http (AsyncHTTPClient)
config (PineconeConfig)
- Return type:
None
- async close()[source]¶
Close async preview sub-clients. Idempotent.
Preview
Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.
Examples
>>> import asyncio >>> from pinecone import AsyncPinecone >>> async def main(): ... pc = AsyncPinecone(api_key="your-api-key") ... index = pc.preview.index(name="articles-en-preview") ... await pc.preview.close() >>> asyncio.run(main())
- Return type:
None
- index(*, name=None, host=None)[source]¶
Get an
AsyncPreviewIndexfor data-plane ops.Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Exactly one of
nameorhostmust be provided. Whennameis given, the host is resolved lazily on the first data-plane call viadescribe()and the result is cached on thisAsyncPreviewinstance so subsequent data-plane calls with the same name avoid an extra control-plane round-trip.This method is synchronous (no
awaitrequired). Host resolution only happens when the returnedAsyncPreviewIndexperforms its first I/O operation.- Parameters:
- Returns:
AsyncPreviewIndexconnected to the resolved host.- Raises:
PineconeValueError – If neither or both of
nameandhostare provided.NotFoundError – If
nameis given but the index does not exist (raised on first data-plane call).ApiError – If the describe call returns an error response (raised on first data-plane call).
- Return type:
Examples
>>> import asyncio >>> from pinecone import AsyncPinecone >>> async def main(): ... pc = AsyncPinecone(api_key="your-api-key") ... index = pc.preview.index(name="articles-en-preview") >>> asyncio.run(main())
Or pass a host directly to skip the control-plane call:
>>> async def main(): ... pc = AsyncPinecone(api_key="your-api-key") ... index = pc.preview.index(host="https://articles-en-preview-xyz.pinecone.io") >>> asyncio.run(main())
- property indexes: AsyncPreviewIndexes¶
Access the async preview indexes control-plane namespace.
Lazily instantiated on first access. Reuses the parent client’s configuration and credentials.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Returns:
AsyncPreviewIndexesinstance.
Examples
>>> import asyncio >>> from pinecone import AsyncPinecone >>> async def main(): ... pc = AsyncPinecone(api_key="your-api-key") ... info = await pc.preview.indexes.describe("articles-en-preview") ... print(info.host) >>> asyncio.run(main())
AsyncPreviewIndexes¶
- class pinecone.preview.async_indexes.AsyncPreviewIndexes(config)[source]¶
Bases:
objectAsync control-plane operations for preview indexes (
2026-01.alpha).Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Access via
pc.preview.indexes.- Parameters:
config (PineconeConfig) – SDK configuration used to construct an async HTTP client targeting the preview API version.
Examples
pc = AsyncPinecone(api_key="...") index = await pc.preview.indexes.create( schema={"fields": {"embedding": {"type": "dense_vector", "dimension": 1536}}}, name="my-preview-index", )
- async close()[source]¶
Close the underlying HTTP client. Idempotent.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Return type:
None
- async configure(name, *, schema=None, deletion_protection=None, tags=None, read_capacity=None)[source]¶
Update configuration of an existing preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Only the fields you provide are updated; omitted parameters are left unchanged on the server.
- Parameters:
name (str) – Name of the preview index to configure.
schema (dict[str, Any] | None) –
Updated schema definition. Pass a dict with a
"fields"key mapping field names to typed field definitions. The server only allows additive changes — it rejects requests that remove or modify existing fields. Example:await pc.preview.indexes.configure( "my-index", schema={"fields": { "summary": {"type": "string", "full_text_search": {}}, }}, )
deletion_protection (str | None) –
"enabled"to prevent accidental deletion;"disabled"to allow it.tags (dict[str, str] | None) – Replacement set of key-value tags for the index. Keys must be at most 80 characters; values at most 120 characters.
read_capacity (dict[str, Any] | None) – Updated read capacity configuration dict. Must include a
"mode"key ("OnDemand"or"Dedicated").
- Returns:
PreviewIndexModelreflecting the updated index state.- Raises:
PineconeValueError – If name is empty; if all kwargs are
None; if schema, tags, or read_capacity is an empty dict; or if a tag key/value exceeds the length limit.ApiError – If the API returns an error response.
- Return type:
PreviewIndexModel
Examples
async def main(): await pc.preview.indexes.configure( "my-index", schema={"fields": {"summary": {"type": "string"}}}, )
Update read capacity to dedicated:
async def main(): await pc.preview.indexes.configure( "my-index", read_capacity={"mode": "Dedicated", "node_type": "b1", "scaling": "Manual", "manual": {"shards": 2, "replicas": 1}}, )
Update tags:
async def main(): await pc.preview.indexes.configure( "my-index", tags={"env": "prod", "team": "search"}, )
Enable deletion protection:
async def main(): await pc.preview.indexes.configure("my-index", deletion_protection="enabled")
- async create(*, schema, name=None, deployment=None, read_capacity=None, deletion_protection=None, tags=None)[source]¶
Create a new preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
Index schema definition. A dict with a
"fields"key mapping field names to their typed field definitions. Example:{ "fields": { "embedding": {"type": "dense_vector", "dimension": 1536}, "title": {"type": "string", "full_text_search": {}}, } }
name (str | None) – Optional name for the index. If omitted, the API assigns one.
deployment (dict[str, Any] | None) – Optional deployment configuration dict. Must include a
"deployment_type"key (e.g."managed","pod","byoc"). When omitted the API uses its default deployment.read_capacity (dict[str, Any] | None) – Optional read capacity configuration dict. Must include a
"mode"key ("OnDemand"or"Dedicated"). When omitted the API uses on-demand mode.deletion_protection (str | None) – Optional deletion-protection setting —
"enabled"or"disabled". Defaults to"disabled"if not provided.tags (dict[str, str] | None) – Optional key-value tags for the index. Keys must be at most 80 characters; values must be at most 120 characters.
- Returns:
PreviewIndexModeldescribing the newly created index. The returned model’sstatus.readymay beFalse— usedescribe()to poll until the index is ready.- Raises:
PineconeValueError – If a tag key exceeds 80 characters or a tag value exceeds 120 characters.
ApiError – If the API returns an error response.
- Return type:
PreviewIndexModel
Examples
index = await pc.preview.indexes.create( schema={"fields": {"embedding": {"type": "dense_vector", "dimension": 1536}}}, name="my-preview-index", )
- async create_backup(index_name, *, name=None, description=None)[source]¶
Create a backup of a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
- Returns:
PreviewBackupModeldescribing the newly created backup. Thestatusfield will typically be"Initializing"immediately after creation. Polldescribe_backup()untilstatus == "Ready"before using the backup:backup = await pc.preview.indexes.create_backup("my-index", name="nightly") # Poll until ready import asyncio while backup.status != "Ready": await asyncio.sleep(5) backup = await pc.preview.indexes.describe_backup(backup.backup_id)
- Raises:
PineconeValueError – If index_name is empty.
ApiError – If the API returns an error response.
- Return type:
PreviewBackupModel
Examples
await pc.preview.indexes.create_backup("my-index") await pc.preview.indexes.create_backup( "my-index", name="nightly", description="Daily backup" )
- async delete(name, *, timeout=None)[source]¶
Delete a named preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Sends a DELETE request and, depending on timeout, polls until the index disappears.
- Parameters:
name (str) – Name of the preview index to delete.
timeout (int | None) –
Controls post-delete polling behaviour.
None(default): polldescribe()every 5 seconds with no upper bound until the index is gone.-1: return immediately after the DELETE response without polling.Positive integer: poll until the index is gone or timeout seconds have elapsed. Raises
PineconeTimeoutErrorif the deadline is reached before the index disappears.
- Returns:
None- Raises:
PineconeValueError – If name is empty.
NotFoundError – If the index does not exist.
ForbiddenError – If deletion protection is enabled.
PineconeTimeoutError – If timeout seconds elapse before the index disappears.
ApiError – If the API returns another error response.
- Return type:
None
Examples
await pc.preview.indexes.delete("product-search-preview") # Delete and wait up to 60 seconds await pc.preview.indexes.delete("product-search-preview", timeout=60) # Delete without polling await pc.preview.indexes.delete("product-search-preview", timeout=-1)
- async describe(name)[source]¶
Get detailed information about a named preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
name (str) – Name of the preview index to describe.
- Returns:
PreviewIndexModelwith name, host, schema, deployment, read_capacity, status, deletion_protection, and tags.- Raises:
PineconeValueError – If name is empty.
NotFoundError – If the index does not exist.
ApiError – If the API returns another error response.
- Return type:
PreviewIndexModel
Examples
desc = await pc.preview.indexes.describe("product-search-preview") print(desc.host)
- async exists(name)[source]¶
Check whether a named preview index exists.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Uses
describe()internally; catchesNotFoundErrorand returnsFalse.- Parameters:
name (str) – Name of the preview index to check.
- Returns:
Trueif the index exists,Falseif it does not.- Raises:
PineconeValueError – If name is empty.
ApiError – If the API returns an error other than 404.
- Return type:
Examples
if await pc.preview.indexes.exists("product-search-preview"): print("Index found")
- list(*, limit=None, pagination_token=None)[source]¶
List all preview indexes.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.The 2026-01.alpha server returns all indexes in a single page. The returned
AsyncPaginatoralways yields exactly one page and then terminates, but the paginator interface is used for consistency and forward compatibility.- Parameters:
- Returns:
AsyncPaginatoroverPreviewIndexModelinstances.- Raises:
PineconeValueError – If limit is zero or negative.
ApiError – If the API returns an error response.
- Return type:
AsyncPaginator[PreviewIndexModel]
Examples
async for index in pc.preview.indexes.list(): print(index.name)
Collect all into a list:
all_indexes = await pc.preview.indexes.list().to_list()
- list_backups(index_name, *, limit=None, pagination_token=None)[source]¶
List backups for a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Parameters:
- Returns:
AsyncPaginatoroverPreviewBackupModelinstances.- Raises:
PineconeValueError – If index_name is empty or limit is zero or negative.
ApiError – If the API returns an error response.
- Return type:
AsyncPaginator[PreviewBackupModel]
Examples
async for backup in pc.preview.indexes.list_backups("my-index"): print(backup.backup_id, backup.status)
Access page-level metadata:
paginator = pc.preview.indexes.list_backups("my-index") async for page in paginator.pages(): print(f"Got {len(page.items)} backups") for backup in page.items: print(backup.backup_id)
AsyncPreviewIndex¶
- class pinecone.preview.async_index.AsyncPreviewIndex(config, host=None, _host_provider=None)[source]¶
Bases:
objectAsync data-plane wrapper for a preview index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Obtain via
pc.preview.index(name=...)orpc.preview.index(host=...).- Parameters:
config (PineconeConfig) – SDK configuration shared with the parent client.
host (str | None) – Normalized data-plane host URL. Provide either
hostor_host_provider._host_provider (Callable[[], Awaitable[str]] | None) – Async callable that resolves the host on first data-plane use. Used internally when the factory is called with
name=; callers should not pass this directly.
Examples
>>> import asyncio >>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> async def main() -> None: ... async with pc.preview.index(name="articles-en-preview") as index: ... response = await index.documents.upsert( ... namespace="articles-en", ... documents=[{"_id": "doc-1", "title": "Introduction to vectors"}], ... ) >>> asyncio.run(main())
Explicit open/close when a context manager is not convenient:
>>> async def main() -> None: ... index = pc.preview.index(host="https://my-index.svc.pinecone.io") ... try: ... response = await index.documents.upsert( ... namespace="articles-en", ... documents=[{"_id": "doc-1", "title": "Introduction to vectors"}], ... ) ... finally: ... await index.close() >>> asyncio.run(main())
- async close()[source]¶
Close the underlying HTTP client if initialized. Idempotent.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Examples
>>> import asyncio >>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> async def main() -> None: ... index = pc.preview.index(host="https://my-index.svc.pinecone.io") ... await index.close() >>> asyncio.run(main())
- Return type:
None
- property documents: AsyncPreviewDocuments¶
Documents sub-namespace for data-plane operations on this index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.Examples
>>> import asyncio >>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> async def main() -> None: ... async with pc.preview.index(name="articles-en-preview") as index: ... docs = index.documents ... response = await docs.upsert( ... namespace="articles-en", ... documents=[{"_id": "doc-1", "title": "Introduction to vectors"}], ... ) >>> asyncio.run(main())
- property host: str¶
Data-plane host URL for this index.
Preview
Uses Pinecone API version
2026-01.alpha. Preview surface is not covered by SemVer — signatures and behavior may change in any minor SDK release. Pin your SDK version when relying on preview features.- Raises:
RuntimeError – If the host has not yet been resolved. When the index was created with
name=rather thanhost=, the host is resolved lazily on the first data-plane call. Accesshostonly after at least one data-plane operation has completed.
Examples
>>> from pinecone import Pinecone >>> pc = Pinecone(api_key="your-api-key") >>> index = pc.preview.index(host="https://my-index.svc.pinecone.io") >>> print(index.host) https://my-index.svc.pinecone.io