# Pinecone Docs

## Docs

- [null](https://docs.pinecone.io/.github/pull_request_template)
- [Notebooks](https://docs.pinecone.io/examples/notebooks)
- [Reference architectures](https://docs.pinecone.io/examples/reference-architectures)
- [Sample apps](https://docs.pinecone.io/examples/sample-apps)
- [Legal semantic search](https://docs.pinecone.io/examples/sample-apps/legal-semantic-search)
- [Namespace Notes](https://docs.pinecone.io/examples/sample-apps/namespace-notes)
- [Pinecone Assistant](https://docs.pinecone.io/examples/sample-apps/pinecone-assistant)
- [Shop The Look](https://docs.pinecone.io/examples/sample-apps/shop-the-look)
- [Chat with an assistant](https://docs.pinecone.io/guides/assistant/chat-with-assistant)
- [Create an assistant](https://docs.pinecone.io/guides/assistant/create-assistant)
- [Evaluate answers](https://docs.pinecone.io/guides/assistant/evaluate-answers)
- [Manage assistants](https://docs.pinecone.io/guides/assistant/manage-assistants)
- [Manage files](https://docs.pinecone.io/guides/assistant/manage-files)
- [Understanding Pinecone Assistant](https://docs.pinecone.io/guides/assistant/understanding-assistant)
- [Understanding Evaluation API](https://docs.pinecone.io/guides/assistant/understanding-evaluation)
- [Upload a file to an assistant](https://docs.pinecone.io/guides/assistant/upload-file)
- [Create and load private datasets](https://docs.pinecone.io/guides/data/create-and-load-private-datasets)
- [Check data freshness](https://docs.pinecone.io/guides/data/data-freshness/check-data-freshness)
- [Understanding data freshness](https://docs.pinecone.io/guides/data/data-freshness/understanding-data-freshness)
- [Delete data](https://docs.pinecone.io/guides/data/delete-data)
- [Encode sparse vectors](https://docs.pinecone.io/guides/data/encode-sparse-vectors)
- [Fetch data](https://docs.pinecone.io/guides/data/fetch-data)
- [Import data](https://docs.pinecone.io/guides/data/import-data)
- [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids)
- [Manage RAG documents](https://docs.pinecone.io/guides/data/manage-rag-documents)
- [Query data](https://docs.pinecone.io/guides/data/query-data)
- [Query sparse-dense vectors](https://docs.pinecone.io/guides/data/query-sparse-dense-vectors)
- [Target an index](https://docs.pinecone.io/guides/data/target-an-index)
- [Understanding hybrid search](https://docs.pinecone.io/guides/data/understanding-hybrid-search)
- [Understanding imports](https://docs.pinecone.io/guides/data/understanding-imports)
- [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata)
- [Update data](https://docs.pinecone.io/guides/data/update-data)
- [Upsert data](https://docs.pinecone.io/guides/data/upsert-data)
- [Upsert sparse-dense vectors](https://docs.pinecone.io/guides/data/upsert-sparse-dense-vectors)
- [Use public Pinecone datasets](https://docs.pinecone.io/guides/data/use-public-pinecone-datasets)
- [Use sample datasets](https://docs.pinecone.io/guides/data/use-sample-datasets)
- [Pinecone Assistant quickstart](https://docs.pinecone.io/guides/get-started/assistant-quickstart)
- [Build a RAG chatbot](https://docs.pinecone.io/guides/get-started/build-a-rag-chatbot)
- [More examples](https://docs.pinecone.io/guides/get-started/examples)
- [Glossary](https://docs.pinecone.io/guides/get-started/glossary)
- [Image search](https://docs.pinecone.io/guides/get-started/image-search)
- [Implement multitenancy using namespaces](https://docs.pinecone.io/guides/get-started/implement-multitenancy)
- [Upsert and search documents](https://docs.pinecone.io/guides/get-started/integrated-inference)
- [Key features](https://docs.pinecone.io/guides/get-started/key-features)
- [Multimodal search](https://docs.pinecone.io/guides/get-started/multimodal-search)
- [Pinecone Documentation](https://docs.pinecone.io/guides/get-started/overview)
- [Pinecone Database quickstart](https://docs.pinecone.io/guides/get-started/quickstart)
- [Recommender](https://docs.pinecone.io/guides/get-started/recommender)
- [Semantic search](https://docs.pinecone.io/guides/get-started/semantic-search)
- [Threat detection](https://docs.pinecone.io/guides/get-started/threat-detection)
- [Back up an index](https://docs.pinecone.io/guides/indexes/back-up-an-index)
- [Choose a pod type and size](https://docs.pinecone.io/guides/indexes/choose-a-pod-type-and-size)
- [Configure an index](https://docs.pinecone.io/guides/indexes/configure-an-index)
- [Convert a gcp-starter index to serverless](https://docs.pinecone.io/guides/indexes/convert-a-gcp-starter-index-to-serverless)
- [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index)
- [Delete an index](https://docs.pinecone.io/guides/indexes/delete-an-index)
- [Migrate a pod-based index to serverless](https://docs.pinecone.io/guides/indexes/migrate-a-pod-based-index-to-serverless)
- [Prevent index deletion](https://docs.pinecone.io/guides/indexes/prevent-index-deletion)
- [Restore an index](https://docs.pinecone.io/guides/indexes/restore-an-index)
- [Scale pod-based indexes](https://docs.pinecone.io/guides/indexes/scale-pod-based-indexes)
- [Tag an index](https://docs.pinecone.io/guides/indexes/tag-an-index)
- [Understanding backups and collections](https://docs.pinecone.io/guides/indexes/understanding-backups-and-collections)
- [Understanding indexes](https://docs.pinecone.io/guides/indexes/understanding-indexes)
- [Use namespaces](https://docs.pinecone.io/guides/indexes/use-namespaces)
- [View index information](https://docs.pinecone.io/guides/indexes/view-index-information)
- [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings)
- [Rerank documents](https://docs.pinecone.io/guides/inference/rerank)
- [Understanding Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference)
- [CI/CD with Pinecone Local and GitHub Actions](https://docs.pinecone.io/guides/operations/automated-testing)
- [Configure customer-managed encryption keys](https://docs.pinecone.io/guides/operations/configure-cmek)
- [Connect to AWS PrivateLink](https://docs.pinecone.io/guides/operations/connect-to-aws-privatelink)
- [Integrate with Amazon S3](https://docs.pinecone.io/guides/operations/integrations/integrate-with-amazon-s3)
- [Manage storage integrations](https://docs.pinecone.io/guides/operations/integrations/manage-storage-integrations)
- [Local development with Pinecone Local](https://docs.pinecone.io/guides/operations/local-development)
- [Monitoring](https://docs.pinecone.io/guides/operations/monitoring)
- [Move to production](https://docs.pinecone.io/guides/operations/move-to-production)
- [Performance tuning](https://docs.pinecone.io/guides/operations/performance-tuning)
- [Understanding security](https://docs.pinecone.io/guides/operations/understanding-security)
- [Configure SSO with Okta](https://docs.pinecone.io/guides/organizations/configure-single-sign-on/okta)
- [Change your billing plan](https://docs.pinecone.io/guides/organizations/manage-billing/changing-your-billing-plan)
- [Set up billing through AWS Marketplace](https://docs.pinecone.io/guides/organizations/manage-billing/setting-up-billing-through-aws-marketplace)
- [Set up billing through Azure Marketplace](https://docs.pinecone.io/guides/organizations/manage-billing/setting-up-billing-through-azure-marketplace)
- [Set up billing through GCP Marketplace](https://docs.pinecone.io/guides/organizations/manage-billing/setting-up-billing-through-gcp-marketplace)
- [Subscription status](https://docs.pinecone.io/guides/organizations/manage-billing/subscription-status)
- [Understanding subscription status](https://docs.pinecone.io/guides/organizations/manage-billing/understanding-subscription-status)
- [Costs](https://docs.pinecone.io/guides/organizations/manage-cost/costs)
- [Manage cost](https://docs.pinecone.io/guides/organizations/manage-cost/manage-cost)
- [Monitor your usage](https://docs.pinecone.io/guides/organizations/manage-cost/monitor-your-usage)
- [Understanding cost](https://docs.pinecone.io/guides/organizations/manage-cost/understanding-cost)
- [Manage organization members](https://docs.pinecone.io/guides/organizations/manage-organization-members)
- [Understanding organizations](https://docs.pinecone.io/guides/organizations/understanding-organizations)
- [Create a project](https://docs.pinecone.io/guides/projects/create-a-project)
- [Manage API keys](https://docs.pinecone.io/guides/projects/manage-api-keys)
- [Manage project members](https://docs.pinecone.io/guides/projects/manage-project-members)
- [Rename a project](https://docs.pinecone.io/guides/projects/rename-a-project)
- [Set a project pod limit](https://docs.pinecone.io/guides/projects/set-a-project-pod-limit)
- [Understanding projects](https://docs.pinecone.io/guides/projects/understanding-projects)
- [Airbyte](https://docs.pinecone.io/integrations/airbyte)
- [Amazon Bedrock](https://docs.pinecone.io/integrations/amazon-bedrock): Pinecone as a Knowledge Base for Amazon Bedrock
- [Amazon SageMaker](https://docs.pinecone.io/integrations/amazon-sagemaker)
- [Anyscale](https://docs.pinecone.io/integrations/anyscale)
- [Apify](https://docs.pinecone.io/integrations/apify)
- [Aryn](https://docs.pinecone.io/integrations/aryn)
- [Amazon Web Services (AWS)](https://docs.pinecone.io/integrations/aws)
- [Azure](https://docs.pinecone.io/integrations/azure)
- [Attribute usage to your integration](https://docs.pinecone.io/integrations/build-integration/attribute-usage-to-your-integration)
- [Become a Pinecone partner](https://docs.pinecone.io/integrations/build-integration/become-a-partner)
- [Connect your users to Pinecone](https://docs.pinecone.io/integrations/build-integration/connect-your-users-to-pinecone)
- [Cohere](https://docs.pinecone.io/integrations/cohere): Using Cohere and Pinecone to generate and index high-quality vector embeddings
- [Confluent](https://docs.pinecone.io/integrations/confluent)
- [Context Data](https://docs.pinecone.io/integrations/context-data)
- [Databricks](https://docs.pinecone.io/integrations/databricks): Using Databricks and Pinecone to create and index vector embeddings at scale
- [Datadog](https://docs.pinecone.io/integrations/datadog): Monitoring Pinecone with Datadog
- [Datavolo](https://docs.pinecone.io/integrations/datavolo)
- [Elasticsearch](https://docs.pinecone.io/integrations/elasticsearch)
- [Estuary](https://docs.pinecone.io/integrations/estuary)
- [Fleak](https://docs.pinecone.io/integrations/fleak)
- [FlowiseAI](https://docs.pinecone.io/integrations/flowise)
- [Gathr](https://docs.pinecone.io/integrations/gathr)
- [Google Cloud Platform (GCP)](https://docs.pinecone.io/integrations/gcp)
- [GitHub Copilot](https://docs.pinecone.io/integrations/github-copilot)
- [Haystack](https://docs.pinecone.io/integrations/haystack): Using Haystack and Pinecone to keep your NLP-driven apps up-to-date
- [Hugging Face Inference Endpoints](https://docs.pinecone.io/integrations/hugging-face-inference-endpoints): Using Hugging Face Inference Endpoints and Pinecone to generate and index high-quality vector embeddings
- [Instill AI](https://docs.pinecone.io/integrations/instill)
- [Jina AI](https://docs.pinecone.io/integrations/jina)
- [LangChain](https://docs.pinecone.io/integrations/langchain): Using LangChain and Pinecone to add knowledge to LLMs
- [Langtrace](https://docs.pinecone.io/integrations/langtrace)
- [LlamaIndex](https://docs.pinecone.io/integrations/llamaindex): Using LlamaIndex and Pinecone to build semantic search and RAG applications
- [Matillion](https://docs.pinecone.io/integrations/matillion)
- [New Relic](https://docs.pinecone.io/integrations/new-relic)
- [Nexla](https://docs.pinecone.io/integrations/nexla)
- [Nuclia](https://docs.pinecone.io/integrations/nuclia)
- [OctoAI](https://docs.pinecone.io/integrations/octoai)
- [OpenAI](https://docs.pinecone.io/integrations/openai): Using OpenAI and Pinecone to combine deep learning capabilities for embedding generation with efficient vector storage and retrieval
- [Integrations](https://docs.pinecone.io/integrations/overview): Pinecone integrations enable you to build and deploy AI applications faster and more efficiently. Integrate Pinecone with your favorite frameworks, data sources, and infrastructure providers.
- [Pulumi](https://docs.pinecone.io/integrations/pulumi)
- [Redpanda](https://docs.pinecone.io/integrations/redpanda)
- [Snowflake](https://docs.pinecone.io/integrations/snowflake)
- [StreamNative](https://docs.pinecone.io/integrations/streamnative)
- [Terraform](https://docs.pinecone.io/integrations/terraform): Using Terraform to manage Pinecone resources
- [Traceloop](https://docs.pinecone.io/integrations/traceloop)
- [TruLens](https://docs.pinecone.io/integrations/trulens): Using TruLens and Pinecone to evaluate grounded LLM applications
- [Twelve Labs](https://docs.pinecone.io/integrations/twelve-labs)
- [Unstructured](https://docs.pinecone.io/integrations/unstructured)
- [Vercel](https://docs.pinecone.io/integrations/vercel)
- [Voyage AI](https://docs.pinecone.io/integrations/voyage): Using Voyage AI and Pinecone to generate and index high-quality vector embeddings
- [CLIP-ViT-B-32-laion2B-s34B-b79K](https://docs.pinecone.io/models/CLIP-ViT-B-32-laion2B-s34B-b79K)
- [all-MiniLM-L12-v2](https://docs.pinecone.io/models/all-MiniLM-L12-v2)
- [all-mpnet-base-v2](https://docs.pinecone.io/models/all-mpnet-base-v2)
- [bge-reranker-v2-m3](https://docs.pinecone.io/models/bge-reranker-v2-m3)
- [CLIP](https://docs.pinecone.io/models/clip)
- [embed-english-v3.0](https://docs.pinecone.io/models/cohere-embed-english-v3.0)
- [embed-multilingual-v3.0](https://docs.pinecone.io/models/cohere-embed-multilingual-v3.0)
- [e5-base-v2](https://docs.pinecone.io/models/e5-base-v2)
- [e5-large-v2](https://docs.pinecone.io/models/e5-large-v2)
- [gte-base](https://docs.pinecone.io/models/gte-base)
- [gte-large](https://docs.pinecone.io/models/gte-large)
- [instructor-large](https://docs.pinecone.io/models/instructor-large)
- [instructor-xl](https://docs.pinecone.io/models/instructor-xl)
- [jina-clip-v2](https://docs.pinecone.io/models/jina-clip-v2)
- [jina-embeddings-v2-base-en](https://docs.pinecone.io/models/jina-embeddings-v2-base-en)
- [jina-embeddings-v3](https://docs.pinecone.io/models/jina-embeddings-v3)
- [Marengo-retrieval-2.6](https://docs.pinecone.io/models/marengo-retrieval-2-6)
- [mistral-embed](https://docs.pinecone.io/models/mistral-embed)
- [multilingual-e5-large](https://docs.pinecone.io/models/multilingual-e5-large)
- [Model Gallery](https://docs.pinecone.io/models/overview): Pinecone integrations enable you to build and deploy AI applications faster and more efficiently. Integrate Pinecone with your favorite frameworks, data sources, and infrastructure providers.
- [pinecone-rerank-v0](https://docs.pinecone.io/models/pinecone-rerank-v0)
- [rerank-english-v2](https://docs.pinecone.io/models/rerank-english-v2)
- [text-embedding-3-large](https://docs.pinecone.io/models/text-embedding-3-large)
- [text-embedding-3-small](https://docs.pinecone.io/models/text-embedding-3-small)
- [text-embedding-ada-002](https://docs.pinecone.io/models/text-embedding-ada-002)
- [voyage-2](https://docs.pinecone.io/models/voyage-02)
- [voyage-code-2](https://docs.pinecone.io/models/voyage-code-2)
- [voyage-large-2](https://docs.pinecone.io/models/voyage-large-2)
- [Configure an index](https://docs.pinecone.io/reference/api/2024-04/control-plane/configure_index): This operation configures the pod size and number of replicas for a pod-based index.

It is not possible to change the pod type of an index. However, you can create a collection from an index and then [create a new index with a different pod type](http://docs.pinecone.io/guides/indexes/create-an-index#create-an-index-from-a-collection) from the collection.
- [Create a collection](https://docs.pinecone.io/reference/api/2024-04/control-plane/create_collection): This operation creates a Pinecone collection.

Serverless indexes do not support collections.

- [Create an index](https://docs.pinecone.io/reference/api/2024-04/control-plane/create_index): This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.

For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index).

- [Delete a collection](https://docs.pinecone.io/reference/api/2024-04/control-plane/delete_collection): This operation deletes an existing collection.

Serverless indexes do not support collections.

- [Delete an index](https://docs.pinecone.io/reference/api/2024-04/control-plane/delete_index): This operation deletes an existing index.
- [Describe a collection](https://docs.pinecone.io/reference/api/2024-04/control-plane/describe_collection): This operation gets a description of a collection.

Serverless indexes do not support collections.

- [Describe an index](https://docs.pinecone.io/reference/api/2024-04/control-plane/describe_index): Get a description of an index.
- [List collections](https://docs.pinecone.io/reference/api/2024-04/control-plane/list_collections): This operation returns a list of all collections in a project.

Serverless indexes do not support collections.

- [List indexes](https://docs.pinecone.io/reference/api/2024-04/control-plane/list_indexes): This operation returns a list of all indexes in a project.
- [Delete vectors](https://docs.pinecone.io/reference/api/2024-04/data-plane/delete): The `delete` operation deletes vectors, by id, from a single namespace.

For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data).
- [Get index stats](https://docs.pinecone.io/reference/api/2024-04/data-plane/describeindexstats): The `describe_index_stats` operation returns statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.

Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.

For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).
- [Fetch vectors](https://docs.pinecone.io/reference/api/2024-04/data-plane/fetch): The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data).
- [List vector IDs](https://docs.pinecone.io/reference/api/2024-04/data-plane/list): The `list` operation lists the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix.

`list` returns up to 100 IDs at a time by default in sorted order (bitwise "C" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return.

For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids).

**Note:** `list` is supported only for serverless indexes.
- [Query vectors](https://docs.pinecone.io/reference/api/2024-04/data-plane/query): The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
- [Update a vector](https://docs.pinecone.io/reference/api/2024-04/data-plane/update): The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.

For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
- [Upsert vectors](https://docs.pinecone.io/reference/api/2024-04/data-plane/upsert): The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.

For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data).
- [Configure an index](https://docs.pinecone.io/reference/api/2024-07/control-plane/configure_index): This operation configures an existing index. 


For serverless indexes, you can configure only index deletion protection. For pod-based indexes, you can configure the pod size, number of replicas, and index deletion protection. 


It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/create-an-index#create-an-index-from-a-collection) from the collection.
For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index).
- [Create a collection](https://docs.pinecone.io/reference/api/2024-07/control-plane/create_collection): This operation creates a Pinecone collection.
  
Serverless indexes do not support collections.

- [Create an index](https://docs.pinecone.io/reference/api/2024-07/control-plane/create_index): This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.
  
For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index).

- [Delete a collection](https://docs.pinecone.io/reference/api/2024-07/control-plane/delete_collection): This operation deletes an existing collection.
Serverless indexes do not support collections.

- [Delete an index](https://docs.pinecone.io/reference/api/2024-07/control-plane/delete_index): This operation deletes an existing index.
- [Describe a collection](https://docs.pinecone.io/reference/api/2024-07/control-plane/describe_collection): This operation gets a description of a collection.
Serverless indexes do not support collections.

- [Describe an index](https://docs.pinecone.io/reference/api/2024-07/control-plane/describe_index): Get a description of an index.
- [List collections](https://docs.pinecone.io/reference/api/2024-07/control-plane/list_collections): This operation returns a list of all collections in a project.
Serverless indexes do not support collections.

- [List indexes](https://docs.pinecone.io/reference/api/2024-07/control-plane/list_indexes): This operation returns a list of all indexes in a project.
- [Delete vectors](https://docs.pinecone.io/reference/api/2024-07/data-plane/delete): The `delete` operation deletes vectors, by id, from a single namespace.

For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data).
- [Get index stats](https://docs.pinecone.io/reference/api/2024-07/data-plane/describeindexstats): The `describe_index_stats` operation returns statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.

Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.

For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).
- [Fetch vectors](https://docs.pinecone.io/reference/api/2024-07/data-plane/fetch): The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data).
- [List vector IDs](https://docs.pinecone.io/reference/api/2024-07/data-plane/list): The `list` operation lists the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix.

`list` returns up to 100 IDs at a time by default in sorted order (bitwise "C" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return.

For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids).

**Note:** `list` is supported only for serverless indexes.
- [Query vectors](https://docs.pinecone.io/reference/api/2024-07/data-plane/query): The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
- [Update a vector](https://docs.pinecone.io/reference/api/2024-07/data-plane/update): The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.

For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
- [Upsert vectors](https://docs.pinecone.io/reference/api/2024-07/data-plane/upsert): The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.

For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data).
- [Embed data](https://docs.pinecone.io/reference/api/2024-07/inference/generate-embeddings): Generate embeddings for input data.

For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings).
- [Configure an index](https://docs.pinecone.io/reference/api/2024-10/control-plane/configure_index): This operation configures an existing index. 

For serverless indexes, you can configure only index deletion protection and tags. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. 

It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/create-an-index#create-an-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index).
- [Create a collection](https://docs.pinecone.io/reference/api/2024-10/control-plane/create_collection): This operation creates a Pinecone collection.
  
Serverless indexes do not support collections.

- [Create an index](https://docs.pinecone.io/reference/api/2024-10/control-plane/create_index): This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.
  
For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index).

- [Delete a collection](https://docs.pinecone.io/reference/api/2024-10/control-plane/delete_collection): This operation deletes an existing collection.
Serverless indexes do not support collections.

- [Delete an index](https://docs.pinecone.io/reference/api/2024-10/control-plane/delete_index): This operation deletes an existing index.
- [Describe a collection](https://docs.pinecone.io/reference/api/2024-10/control-plane/describe_collection): This operation gets a description of a collection.
Serverless indexes do not support collections.

- [Describe an index](https://docs.pinecone.io/reference/api/2024-10/control-plane/describe_index): Get a description of an index.
- [List collections](https://docs.pinecone.io/reference/api/2024-10/control-plane/list_collections): This operation returns a list of all collections in a project.
Serverless indexes do not support collections.

- [List indexes](https://docs.pinecone.io/reference/api/2024-10/control-plane/list_indexes): This operation returns a list of all indexes in a project.
- [Cancel an import](https://docs.pinecone.io/reference/api/2024-10/data-plane/cancel_import): The `cancel_import` operation cancels an import operation if it is not yet finished. It has no effect if the operation is already finished. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).
- [Delete vectors](https://docs.pinecone.io/reference/api/2024-10/data-plane/delete): The `delete` operation deletes vectors, by id, from a single namespace.

For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data).
- [Describe an import](https://docs.pinecone.io/reference/api/2024-10/data-plane/describe_import): The `describe_import` operation returns details of a specific import operation. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).
- [Get index stats](https://docs.pinecone.io/reference/api/2024-10/data-plane/describeindexstats): The `describe_index_stats` operation returns statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.

Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.

For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).
- [Fetch vectors](https://docs.pinecone.io/reference/api/2024-10/data-plane/fetch): The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data).
- [List vector IDs](https://docs.pinecone.io/reference/api/2024-10/data-plane/list): The `list` operation lists the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix.

By default, `list` returns up to 100 IDs per page in sorted order (bitwise "C" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return.

For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids).

**Note:** `list_vectors` is supported only for serverless indexes.
- [List imports](https://docs.pinecone.io/reference/api/2024-10/data-plane/list_imports): The `list_imports` operation lists all recent and ongoing import operations. 

By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return.

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).
- [Query vectors](https://docs.pinecone.io/reference/api/2024-10/data-plane/query): The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).
- [Start import](https://docs.pinecone.io/reference/api/2024-10/data-plane/start_import): The `start_import` operation starts an asynchronous import of vectors from object storage into an index. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).
- [Update a vector](https://docs.pinecone.io/reference/api/2024-10/data-plane/update): The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.

For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).
- [Upsert vectors](https://docs.pinecone.io/reference/api/2024-10/data-plane/upsert): The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.

For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data).
- [Embed data](https://docs.pinecone.io/reference/api/2024-10/inference/generate-embeddings): Generate embeddings for input data.

For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings).
- [Rerank documents](https://docs.pinecone.io/reference/api/2024-10/inference/rerank): Rerank documents according to their relevance to a query.

For guidance and examples, see [Rerank documents](https://docs.pinecone.io/guides/inference/rerank).
- [Chat with an assistant](https://docs.pinecone.io/reference/api/assistant/chat_assistant): The `chat_assistant` operation allows you to [chat with an assistant](https://docs.pinecone.io/guides/assistant/chat-with-assistant) and get back citations in structured form. 

This is the recommended way to chat with an assistant, as it offers more functionality and control over the assistant's responses and references than the `chat_completion_assistant` operation.
- [Chat through an OpenAI-compatible interface](https://docs.pinecone.io/reference/api/assistant/chat_completion_assistant): The `chat_completion_assistant` endpoint is used to [chat with an assistant](https://docs.pinecone.io/guides/assistant/chat-with-assistant). This endpoint is based on the OpenAI Chat Completion API, a commonly used and adopted API. 

It is useful if you need inline citations or OpenAI-compatible responses, but has limited functionality compared to the [`chat_assistant`](https://docs.pinecone.io/reference/api/assistant/chat_assistant) endpoint.
- [Create an assistant](https://docs.pinecone.io/reference/api/assistant/create_assistant): The `create_assistant` endpoint [creates a Pinecone Assistant](https://docs.pinecone.io/guides/assistant/create-assistant). This is where you specify the underlying training model, which cloud provider you would like to deploy with, and more.
- [Upload file to assistant](https://docs.pinecone.io/reference/api/assistant/create_file): The `upload_file` endpoint [uploads a file](https://docs.pinecone.io/guides/assistant/upload-file) to the specified assistant.
- [Delete an assistant](https://docs.pinecone.io/reference/api/assistant/delete_assistant): The `delete_assistant` endpoint [deletes an existing assistant](https://docs.pinecone.io/guides/assistant/manage-assistants#delete-an-assistant).
- [Delete an uploaded file](https://docs.pinecone.io/reference/api/assistant/delete_file): The `delete_file` endpoint [deletes an uploaded file](https://docs.pinecone.io/guides/assistant/manage-files#delete-a-file) from an assistant.
- [Describe a file upload](https://docs.pinecone.io/reference/api/assistant/describe_file): The `describe_file` endpoint provides the [current status and metadata of a file](https://docs.pinecone.io/guides/assistant/manage-files#get-the-status-of-a-file) uploaded to an assistant.
- [Check assistant status](https://docs.pinecone.io/reference/api/assistant/get_assistant): The `get_assistant` endpoint [gets the status](https://docs.pinecone.io/guides/assistant/manage-assistants#get-the-status-of-an-assistant) of an assistant.
- [List assistants](https://docs.pinecone.io/reference/api/assistant/list_assistants): The `list_assistants` endpoint returns a [list of all assistants](https://docs.pinecone.io/guides/assistant/list-assistants-for-a-project) in a project.
- [List Files](https://docs.pinecone.io/reference/api/assistant/list_files): The `list_files` endpoint returns a [list of all files in an assistant](https://docs.pinecone.io//guides/assistant/manage-files#list-files-in-an-assistant), with an option to filter files with metadata.
- [Evaluate an answer](https://docs.pinecone.io/reference/api/assistant/metrics_alignment): The `metrics_alignment` endpoint [evaluates](https://docs.pinecone.io/guides/assistant/understanding-evaluation) the correctness, completeness, and alignment of a generated answer with respect to a question and a ground truth answer. The correctness and completeness are evaluated based on the precision and recall of the generated answer with respect to the ground truth answer facts. Alignment is the harmonic mean of correctness and completeness.
- [Update an assistant](https://docs.pinecone.io/reference/api/assistant/update_assistant): The `update_assistant` endpoint [updates an existing assistant](https://docs.pinecone.io/guides/assistant/manage-assistants#update-an-existing-assistant). You can modify the assistant's instructions and metadata.
- [Authentication](https://docs.pinecone.io/reference/api/authentication)
- [Errors](https://docs.pinecone.io/reference/api/errors)
- [API reference](https://docs.pinecone.io/reference/api/introduction)
- [Create an index for an embedding model](https://docs.pinecone.io/reference/api/unstable/control-plane/create_for_model): This operation creates a serverless index configured for a specific embedding model.

- [Search a namespace](https://docs.pinecone.io/reference/api/unstable/data-plane/search_records): This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores.
- [Upsert records into a namespace](https://docs.pinecone.io/reference/api/unstable/data-plane/upsert_records): This operation converts input data to vector embeddings and then upserts the embeddings into a namespace.
- [API versioning](https://docs.pinecone.io/reference/api/versioning)
- [Pod-based architecture](https://docs.pinecone.io/reference/architecture/pod-based-architecture)
- [Serverless architecture](https://docs.pinecone.io/reference/architecture/serverless-architecture)
- [.NET SDK](https://docs.pinecone.io/reference/dotnet-sdk)
- [Go SDK](https://docs.pinecone.io/reference/go-sdk)
- [Java SDK](https://docs.pinecone.io/reference/java-sdk)
- [Known limitations](https://docs.pinecone.io/reference/known-limitations)
- [Node.js SDK](https://docs.pinecone.io/reference/node-sdk)
- [Object identifiers](https://docs.pinecone.io/reference/object-identifiers)
- [Introduction](https://docs.pinecone.io/reference/pinecone-sdks)
- [Python SDK](https://docs.pinecone.io/reference/python-sdk)
- [Quotas and limits](https://docs.pinecone.io/reference/quotas-and-limits)
- [Rust SDK](https://docs.pinecone.io/reference/rust-sdk)
- [Pinecone datasets](https://docs.pinecone.io/reference/tools/pinecone-datasets)
- [Spark-Pinecone connector](https://docs.pinecone.io/reference/tools/pinecone-spark-connector)
- [Pinecone text client](https://docs.pinecone.io/reference/tools/pinecone-text-client)
- [2022 releases](https://docs.pinecone.io/release-notes/2022)
- [2023 releases](https://docs.pinecone.io/release-notes/2023)
- [2024 releases](https://docs.pinecone.io/release-notes/2024)
- [Feature availability](https://docs.pinecone.io/release-notes/feature-availability)
- [Available cloud regions](https://docs.pinecone.io/troubleshooting/available-cloud-regions)
- [Best Practices](https://docs.pinecone.io/troubleshooting/best-practices)
- [Billing disputes and refunds](https://docs.pinecone.io/troubleshooting/billing-disputes-and-refunds)
- [Contact Support](https://docs.pinecone.io/troubleshooting/contact-support)
- [CORS Issues](https://docs.pinecone.io/troubleshooting/cors-issues)
- [Create and manage vectors with metadata](https://docs.pinecone.io/troubleshooting/create-and-manage-vectors-with-metadata)
- [Custom data processing agreements](https://docs.pinecone.io/troubleshooting/custom-data-processing-agreements)
- [Debug model vs. Pinecone recall issues](https://docs.pinecone.io/troubleshooting/debug-model-vs-pinecone-recall-issues)
- [Delete a namespace](https://docs.pinecone.io/troubleshooting/delete-a-namespace)
- [Delete your account](https://docs.pinecone.io/troubleshooting/delete-your-account)
- [Delete your organization](https://docs.pinecone.io/troubleshooting/delete-your-organization)
- [Differences between Lexical and Semantic Search regarding relevancy](https://docs.pinecone.io/troubleshooting/differences-between-lexical-semantic-search)
- [Embedding values changed when upserted](https://docs.pinecone.io/troubleshooting/embedding-values-changed-when-upserted)
- [Error: Cannot import name 'Pinecone' from 'pinecone'](https://docs.pinecone.io/troubleshooting/error-cannot-import-name-pinecone)
- [Error: Handshake read failed when connecting](https://docs.pinecone.io/troubleshooting/error-handshake-read-failed)
- [Export indexes](https://docs.pinecone.io/troubleshooting/export-indexes)
- [Handle large numbers of deletes by metadata](https://docs.pinecone.io/troubleshooting/handle-deletes-by-metadata)
- [How and when to add replicas](https://docs.pinecone.io/troubleshooting/how-and-when-to-add-replicas)
- [How and when to increase index size](https://docs.pinecone.io/troubleshooting/how-and-when-to-increase-index-size)
- [How to work with Support](https://docs.pinecone.io/troubleshooting/how-to-work-with-support)
- [Serverless index creation error - max serverless indexes](https://docs.pinecone.io/troubleshooting/index-creation-error-max-serverless)
- [Index creation error - missing spec parameter](https://docs.pinecone.io/troubleshooting/index-creation-error-missing-spec)
- [Keep customer data separate in Pinecone](https://docs.pinecone.io/troubleshooting/keep-customer-data-separate)
- [Limitations of querying by ID](https://docs.pinecone.io/troubleshooting/limitations-of-querying-by-id)
- [Login code issues](https://docs.pinecone.io/troubleshooting/login-code-issues)
- [Metadata re-configuration](https://docs.pinecone.io/troubleshooting/metadata-reconfiguration)
- [Metadata string value returned as a datetime object](https://docs.pinecone.io/troubleshooting/metadata-string-value-returned-as-datetime)
- [Minimize latencies](https://docs.pinecone.io/troubleshooting/minimize-latencies)
- [Python AttributeError: module pinecone has no attribute init](https://docs.pinecone.io/troubleshooting/module-pinecone-has-no-attribute-init)
- [Namespaces vs. metadata filtering](https://docs.pinecone.io/troubleshooting/namespaces-vs-metadata-filtering)
- [Node.JS Troubleshooting](https://docs.pinecone.io/troubleshooting/nodejs-troubleshooting)
- [Non-indexed field filter issues](https://docs.pinecone.io/troubleshooting/non-indexed-field-filter-issues)
- [Parallel queries](https://docs.pinecone.io/troubleshooting/parallel-queries)
- [PineconeAttribute errors with LangChain](https://docs.pinecone.io/troubleshooting/pinecone-attribute-errors-with-langchain)
- [Pinecone Support SLAs](https://docs.pinecone.io/troubleshooting/pinecone-support-slas)
- [Pods are full](https://docs.pinecone.io/troubleshooting/pods-are-full)
- [Remove a metadata field from a record](https://docs.pinecone.io/troubleshooting/remove-metadata-field)
- [Restrictions on index names](https://docs.pinecone.io/troubleshooting/restrictions-on-index-names)
- [Return all vectors in an index](https://docs.pinecone.io/troubleshooting/return-all-vectors-in-an-index)
- [Select index type and size](https://docs.pinecone.io/troubleshooting/select-index-type-and-size)
- [Serverless index connection errors](https://docs.pinecone.io/troubleshooting/serverless-index-connection-errors)
- [Unable to pip install](https://docs.pinecone.io/troubleshooting/unable-to-pip-install)
- [Use namespaces instead of several indexes](https://docs.pinecone.io/troubleshooting/use-namespaces-instead-of-several-indexes)
- [Vertically downscaling](https://docs.pinecone.io/troubleshooting/vertically-downscaling)
- [Wait for index creation to be complete](https://docs.pinecone.io/troubleshooting/wait-for-index-creation)


# Create a collection

control_2024-07 post /collections
This operation creates a Pinecone collection.
  
Serverless indexes do not support collections.


<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="API_KEY")
  pc.create_collection("example-collection", "example-index")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({
    apiKey: 'YOUR_API_KEY'
  });

  await pc.createCollection({
    name: "example-collection",
    source: "example-index",
  });
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;

  public class CreateCollectionExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();

          pc.createCollection("example-collection", "example-index");
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      collection, err := pc.CreateCollection(ctx, &pinecone.CreateCollectionRequest{
          Name: "example-collection", 
          Source: "example-index",
      })
      if err != nil {
          log.Fatalf("Failed to create collection: %v", err)
      } else {
          fmt.Printf("Successfully created collection: %v", collection.Name)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var collectionModel = await pinecone.CreateCollectionAsync(new CreateCollectionRequest {
      Name = "example-collection",
      Source = "example-index",
  });
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -s "https://api.pinecone.io/collections" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-07" \
    -d '{
          "name": "example-collection",
          "source": "example-index"
    }'
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -s https://api.pinecone.io/collections \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-07" \
    -d '{
          "name": "example-collection",
          "source": "example-index"
    }'
  ```
</RequestExample>


# Delete a collection

control_2024-07 delete /collections/{collection_name}
This operation deletes an existing collection.
Serverless indexes do not support collections.


<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='API_KEY')
  pc.delete_collection("example-collection")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  await pc.deleteCollection("example-collection");
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;

  public class DeleteCollectionExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.deleteCollection("example-collection");
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      collectionName := "example-collection"

      err = pc.DeleteCollection(ctx, collectionName)
      if err != nil {
  	    log.Fatalf("Failed to delete collection: %v\n", err)
      } else {
          if len(collections) == 0 {
              fmt.Printf("No collections found in project")
          } else {
              fmt.Printf("Successfully deleted collection \"%v\"\n", collectionName)
          }
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  await pinecone.DeleteCollectionAsync("example-collection");
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X DELETE "https://api.pinecone.io/collections/example-collection" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-07"
  ```
</RequestExample>


# Describe a collection

control_2024-07 get /collections/{collection_name}
This operation gets a description of a collection.
Serverless indexes do not support collections.


<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='API_KEY')
  pc.describe_collection("tiny-collection")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  await pc.describeCollection('tiny-collection');
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import org.openapitools.client.model.CollectionModel;

  public class DescribeCollectionExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          CollectionModel collectionModel = pc.describeCollection("tiny-collection");
          System.out.println(collectionModel);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      collectionName := "tiny-collection"

      collection, err := pc.DescribeCollection(ctx, collectionName)
      if err != nil {
          log.Fatalf("Error describing collection %v: %v", collectionName, err)
      } else {
          fmt.Printf("Collection: %+v", collection)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var collectionModel = await pinecone.DescribeCollectionAsync("tiny-collection");

  Console.WriteLine(collectionModel);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X GET "https://api.pinecone.io/collections/tiny-collection" \
      -H "Api-Key: $PINECONE_API_KEY" \
      -H "X-Pinecone-API-Version: 2024-07"
  ```
</RequestExample>


# List collections

control_2024-07 get /collections
This operation returns a list of all collections in a project.
Serverless indexes do not support collections.


<RequestExample>
  ```python Python
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='YOUR_API_KEY')

  active_collections = pc.list_collections()
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  await pc.listCollections();
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import org.openapitools.client.model.CollectionModel;

  public class ListCollectionsExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          List<CollectionModel> collectionList = pc.listCollections().getCollections();
          System.out.println(collectionList);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "encoding/json"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func prettifyStruct(obj interface{}) string {
      bytes, _ := json.MarshalIndent(obj, "", "  ")
      return string(bytes)
  }

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      collections, err := pc.ListCollections(ctx)
      if err != nil {
  	    log.Fatalf("Failed to list collections: %v", err)
      } else {
          if len(collections) == 0 {
              fmt.Printf("No collections found in project")
          } else {
              for _, collection := range collections {
                  fmt.Printf("collection: %v\n", prettifyStruct(collection))
              }
          }
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var collectionList = await pinecone.ListCollectionsAsync();

  Console.WriteLine(collectionList);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X GET "https://api.pinecone.io/collections" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-07"
  ```
</RequestExample>


# Configure an index

control_2024-10 patch /indexes/{index_name}
This operation configures an existing index. 

For serverless indexes, you can configure only index deletion protection and tags. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. 

It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/create-an-index#create-an-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/configure-an-index).

<RequestExample>
  ```python Python
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  pc.configure_index(
      name="example-index", 
      pod_type="p1.x2", 
      replicas=4,
      deletion_protection="enabled")
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone'

  const pinecone = new Pinecone({
    apiKey: 'YOUR_API_KEY'
  });

  await pinecone.configureIndex('example-index', { podType: 'p1.x2', replicas: 4, deletionProtection: 'enabled' });
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;

  public class ConfigureIndexExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.configureIndex("example-index", "p1.x2", 4, DeletionProtection.ENABLED);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      idx, err := pc.ConfigureIndex(ctx, "example-index", pinecone.ConfigureIndexParams{PodType: "p1.x2", Replicas: 4, DeletionProtection: "enabled"})
    	if err != nil {
          log.Fatalf("Failed to configure index \"%v\": %v", idx.Name, err)
      } else {
          fmt.Printf("Successfully configured index \"%v\"", idx.Name)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var indexMetadata = await pinecone.ConfigureIndexAsync("example-index", new ConfigureIndexRequest
  {
      Spec = new ConfigureIndexRequestSpec
      {
          Pod = new ConfigureIndexRequestSpecPod {
              Replicas = 4,
              PodType = "p1.x2",
          }
      },
      DeletionProtection = DeletionProtection.Disabled,
  });
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -s -X PATCH "https://api.pinecone.io/indexes/example-index" \
      -H "Content-Type: application/json" \
      -H "Api-Key: $PINECONE_API_KEY" \
      -H "X-Pinecone-API-Version: 2024-10" \
      -d '{
              "spec": {
                  "pod": {
                      "pod_type": "p1.x2",
                      "replicas": 4
                  }
              },
              deletion_protection": "enabled"
          }'
  ```
</RequestExample>


# Create an index

control_2024-10 post /indexes
This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.
  
For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index).


<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  # Serverless index
  from pinecone.grpc import PineconeGRPC as Pinecone
  from pinecone import ServerlessSpec

  pc = Pinecone(api_key="YOUR_API_KEY")

  pc.create_index(
    name="example-index1",
    dimension=1536,
    metric="cosine",
    spec=ServerlessSpec(
      cloud="aws",
      region="us-east-1",
    ),
    deletion_protection="disabled"
  )

  # Pod-based index
  from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec

  pc = Pinecone(api_key="YOUR_API_KEY")

  pc.create_index(
    name="example-index2",
    dimension=1536,
    metric="cosine",
    spec=PodSpec(
      environment="us-west1-gcp",
      pod_type="p1.x1",
      pods=1,
    ),
    deletion_protection="disabled"
  )
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  // Serverles index
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({
    apiKey: 'YOUR_API_KEY'
  });

  await pc.createIndex({
    name: 'severless-index',
    dimension: 1536,
    metric: 'cosine',
    spec: {
      serverless: {
        cloud: 'aws',
        region: 'us-east-1'
      }
    },
    deletionProtection: 'disabled',
  });

  // Pod-based index
  await pc.createIndex({
    name: 'example-index2',
    dimension: 1536,
    metric: 'cosine',
    spec: {
      pod: {
        environment: 'us-west1-gcp',
        podType: 'p1.x1',
        pods: 1
      }
    },
    deletionProtection: 'disabled',
  });
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;

  // Serverless index
  public class CreateServerlessIndexExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.createServerlessIndex("example-index1", "cosine", 1536, "aws", "us-east-1", DeletionProtection.disabled);
      }
  }

  // Pod-based index
  public class CreatePodIndexExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.createPodsIndex("example-index2", 1536, "us-west1-gcp",
                  "p1.x1", "cosine", DeletionProtection.disabled);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // Serverless index
      idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{
          Name:      "example-index1",
          Dimension: 1536,
          Metric:    pinecone.Cosine,
          Cloud:     pinecone.Aws,
          Region:    "us-east-1",
          DeletionProtection: "disabled",
      })
    	if err != nil {
          log.Fatalf("Failed to create serverless index: %v", idx.Name)
      } else {
          fmt.Printf("Successfully created serverless index: %v", idx.Name)
      }

      // Pod-based index
      idx, err := pc.CreatePodIndex(ctx, &pinecone.CreatePodIndexRequest{
          Name:        "example-index2",
          Dimension:   1536,
          Metric:      pinecone.Cosine,
          Environment: "us-east1-gcp",
          PodType:     "p1.x1",
          DeletionProtection: "disabled",
      })
    	if err != nil {
          log.Fatalf("Failed to create pod-based index: %v", idx.Name)
      } else {
          fmt.Printf("Successfully created pod-based index: %v", idx.Name)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // Serverless index
  var createIndexRequest = await pinecone.CreateIndexAsync(new CreateIndexRequest
  {
      Name = "example-index1",
      Dimension = 1536,
      Metric = CreateIndexRequestMetric.Cosine,
      Spec = new ServerlessIndexSpec
      {
          Serverless = new ServerlessSpec
          {
              Cloud = ServerlessSpecCloud.Aws,
              Region = "us-east-1",
          }
      },
      DeletionProtection = DeletionProtection.Disabled
  });

  // Pod-based index
  var createIndexRequest = await pinecone.CreateIndexAsync(new CreateIndexRequest
  {
      Name = "pod index",
      Dimension = 1536,
      Metric = CreateIndexRequestMetric.Cosine,
      Spec = new PodIndexSpec
      {
          Pod = new PodSpec
          {
              Environment = "us-east1-gcp",
              PodType = "p1.x1",
              Pods = 1,
          }
      },
      DeletionProtection = DeletionProtection.Disabled
  });
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  # Serverless index
  curl -s "https://api.pinecone.io/indexes" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
          "name": "example-index1",
          "dimension": 1536,
          "metric": "cosine",
          "spec": {
          "serverless": {
              "cloud": "aws",
              "region": "us-east-1"
              }
          },
           "tags"={
              "example": "tag",
              "environment": "production"
          },
           "deletion_protection"="disabled"
        }'

  # Pod-based index
  curl -s "https://api.pinecone.io/indexes" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-07" \
    -d '{
           "name": "example-index2",
           "dimension": 1536,
           "metric": "cosine",
           "spec": {
              "pod": {
                 "environment": "us-west1-gcp",
                 "pod_type": "p1.x1",
                 "pods": 1
              }
           },
           "tags"={
              "example": "tag",
              "environment": "production"
          },
           "deletion_protection"="disabled"
        }'

  ```
</RequestExample>

<ResponseExample>
  ```shell
  # Serverless index
  {
      "name": "example-index1",
      "metric": "cosine",
      "dimension": 1536,
      "status": {
          "ready": true,
          "state": "Ready"
      },
      "host": "example-index1-4zo0ijk.svc.dev-us-west2-aws.pinecone.io",
      "spec": {
          "serverless": {
              "region": "us-east-1",
              "cloud": "aws"
          },
      "tags": {
              "example": "tag",
              "environment": "production"
          }
      }
  }

  # Pod-based index
  {
      "name": "example-index2",
      "metric": "cosine",
      "dimension": 1536,
      "status": {
          "ready": true,
          "state": "Ready"
      },
      "host": "example-index2-4zo0ijk.svc.us-west1-gcp.pinecone.io",
      "spec": {
          "pod": {
              "replicas": 1,
              "shards": 1,
              "pods": 1,
              "pod_type": "p1.x1",
              "environment": "us-west1-gcp"
          },
      "tags": {
          "example": "tag",
          "environment": "production"
      }
      }
  }
  ```
</ResponseExample>


# Delete an index

control_2024-10 delete /indexes/{index_name}
This operation deletes an existing index.

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone, PodSpec

  pc = Pinecone(api_key="YOUR_API_KEY")

  pc.delete_index("example-index")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({
    apiKey: 'YOUR_API_KEY'
  });

  await pc.deleteIndex('example-index');
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;

  public class DeleteIndexExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.deleteIndex("example-index");
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      indexName := "example-index"

      err = pc.DeleteIndex(ctx, indexName)
      if err != nil {
          log.Fatalf("Failed to delete index: %v", err)
      } else {
          fmt.Println("Index \"%v\" deleted successfully", indexName)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  await pinecone.DeleteIndexAsync("example-index");
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X DELETE "https://api.pinecone.io/indexes/example-index" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# Describe an index

control_2024-10 get /indexes/{index_name}
Get a description of an index.

<Warning>
  **Do not target an index by name in production.**

  When you target an index by name for data operations such as `upsert` and `query`, the SDK gets the unique DNS host for the index using the `describe_index` operation. This is convenient for testing but should be avoided in production because `describe_index` uses a different API than data operations and therefore adds an additional network call and point of failure. Instead, you should get an index host once and cache it for reuse or specify the host directly.
</Warning>

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  pc.describe_index("movie-recommendations")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  await pc.describeIndex('movie-recommendations');
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import org.openapitools.db_control.client.model.*;

  public class DescribeIndexExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOURE_API_KEY").build();
          IndexModel indexModel = pc.describeIndex("movie-recommendations");
          System.out.println(indexModel);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "encoding/json"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func prettifyStruct(obj interface{}) string {
      bytes, _ := json.MarshalIndent(obj, "", "  ")
      return string(bytes)
  }

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      idx, err := pc.DescribeIndex(ctx, "movie-recommendations")
      if err != nil {
          log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
      } else {
          fmt.Printf("index: %v\n", prettifyStruct(idx))
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var indexModel = await pinecone.DescribeIndexAsync("example-index");

  Console.WriteLine(indexModel);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X GET "https://api.pinecone.io/indexes/movie-recommendations" \
      -H "Api-Key: $PINECONE_API_KEY" \
      -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# List indexes

control_2024-10 get /indexes
This operation returns a list of all indexes in a project.

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")
  pc.list_indexes()
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  await pc.listIndexes();
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import org.openapitools.db_control.client.model.*;

  public class ListIndexesExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          IndexList indexList = pc.listIndexes();
          System.out.println(indexList);
      }
  }
  ```

  ```go Go
  package main

  import (
  	"context"
  	"encoding/json"
  	"fmt"
  	"log"

  	"github.com/pinecone-io/go-pinecone/pinecone"
  )

  func prettifyStruct(obj interface{}) string {
  	bytes, _ := json.MarshalIndent(obj, "", "  ")
  	return string(bytes)
  }

  func main() {
  	ctx := context.Background()

  	pc, err := pinecone.NewClient(pinecone.NewClientParams{
  		ApiKey: "YOUR_API_KEY",
  	})
  	if err != nil {
  		log.Fatalf("Failed to create Client: %v", err)
  	}

  	idxs, err := pc.ListIndexes(ctx)
  	if err != nil {
  		log.Fatalf("Failed to list indexes: %v", err)
  	} else {
  		for _, index := range idxs {
  			fmt.Printf("index: %v\n", prettifyStruct(index))
  		}
  	}
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  var indexList = await pinecone.ListIndexesAsync();

  Console.WriteLine(indexList);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X GET "https://api.pinecone.io/indexes" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# Cancel an import

data_2024-10 delete /bulk/imports/{id}
The `cancel_import` operation cancels an import operation if it is not yet finished. It has no effect if the operation is already finished. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).

<Note>
  This feature is in [public preview](/release-notes/feature-availability) and available only on [Standard and Enterprise plans](https://www.pinecone.io/pricing/).
</Note>

<RequestExample>
  ```python Python
  from pinecone import Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.cancel_import(id="101")
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  await index.cancelImport(id='101');
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import io.pinecone.clients.AsyncIndex;
  import org.openapitools.db_data.client.ApiException;

  public class CancelImport {
      public static void main(String[] args) throws ApiException {
          // Initialize a Pinecone client with your API key
          Pinecone pinecone = new Pinecone.Builder("YOUR_API_KEY").build();

          // Get async imports connection object
          AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection("example-index");

          // Cancel import
          asyncIndex.cancelImport("2");
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      importID := "101"

      err = idxConnection.CancelImport(ctx, importID)
      if err != nil {
          log.Fatalf("Failed to cancel import: %s", importID)
      }

      importDesc, err := idxConnection.DescribeImport(ctx, importID)
      if err != nil {
          log.Fatalf("Failed to describe import: %s - %v", importID, err)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var cancelResponse = await index.CancelBulkImportAsync("101");
  ```

  ```bash curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X DELETE "https://{INDEX_HOST}/bulk/imports/101" \
    -H 'Api-Key: $YOUR_API_KEY' \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# Delete vectors

data_2024-10 post /vectors/delete
The `delete` operation deletes vectors, by id, from a single namespace.

For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.delete(ids=["id-1", "id-2"], namespace="example-namespace")
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const ns = index.namespace('example-namespace')
  // Delete one record by ID.
  await ns.deleteOne('id-1');
  // Delete more than one record by ID.
  await ns.deleteMany(['id-2', 'id-3']);
  ```

  ```java Java
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;

  import java.util.Arrays;
  import java.util.List;

  public class DeleteVectorsExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          List<String> ids = Arrays.asList("id-1  ", "id-2");
          index.deleteByIds(ids, "example-namespace");
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      id1 := "id-1"
      id2 := "id-2"

      err = idxConnection.DeleteVectorsByID(ctx, []string{id1, id2})
      if err != nil {
          log.Fatalf("Failed to delete vector with ID %v: %v", id, err)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var deleteResponse = await index.DeleteAsync(new DeleteRequest {
      Ids = new List<string> { "id-1", "id-2" },
      Namespace = "example-namespace",
  });
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl "https://$INDEX_HOST/vectors/delete" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
      "ids": [
        "id-1", 
        "id-2"
      ],
      "namespace": "example-namespace"
    }
  '
  ```
</RequestExample>


# Describe an import

data_2024-10 get /bulk/imports/{id}
The `describe_import` operation returns details of a specific import operation. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).

<Note>
  This feature is in [public preview](/release-notes/feature-availability) and available only on [Standard and Enterprise plans](https://www.pinecone.io/pricing/).
</Note>

<RequestExample>
  ```python Python
  from pinecone import Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.describe_import(id="101")
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });


  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const results = await index.describeImport(id='101');
  console.log(results);
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import io.pinecone.clients.AsyncIndex;
  import org.openapitools.db_data.client.ApiException;
  import org.openapitools.db_data.client.model.ImportModel;

  public class DescribeImport {
      public static void main(String[] args) throws ApiException {
          // Initialize a Pinecone client with your API key
          Pinecone pinecone = new Pinecone.Builder("YOUR_API_KEY").build();

          // Get async imports connection object
          AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection("example-index");

          // Describe import
          ImportModel importDetails = asyncIndex.describeImport("101");

          System.out.println(importDetails);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      importID := "101"

      importDesc, err := idxConnection.DescribeImport(ctx, importID)
      if err != nil {
          log.Fatalf("Failed to describe import: %s - %v", importID, err)
      }
      fmt.Printf("Import ID: %s, Status: %s", importDesc.Id, importDesc.Status)
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var importDetails = await index.DescribeBulkImportAsync("101");
  ```

  ```bash curl
  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X GET "https://{INDEX_HOST}/bulk/imports/101" \
    -H 'Api-Key: $YOUR_API_KEY' \
    -H 'X-Pinecone-API-Version: 2024-10'
  ```
</RequestExample>


# Get index stats

data_2024-10 post /describe_index_stats
The `describe_index_stats` operation returns statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.

Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.

For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://docs.pinecone.io/reference/api/control-plane/describe_index).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.describe_index_stats()
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const stats = await index.describeIndexStats();
  ```

  ```java Java
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;
  import io.pinecone.proto.DescribeIndexStatsResponse;

  public class DescribeIndexStatsExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          DescribeIndexStatsResponse indexStatsResponse = index.describeIndexStats();
          System.out.println(indexStatsResponse);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      stats, err := idxConnection.DescribeIndexStats(ctx)
      if err != nil {
          log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
      } else {
          fmt.Printf("%+v", *stats)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var indexStatsResponse = await index.DescribeIndexStatsAsync(new DescribeIndexStatsRequest());

  Console.WriteLine(indexStatsResponse);
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X POST "https://$INDEX_HOST/describe_index_stats" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>

{/* <ResponseExample>

```shell
{
  "namespaces": {
    "example-namespace1": {
      "vectorCount": 4
    },
    "example-namespace2": {
      "vectorCount": 4
    }
  },
  "dimension": 8,
  "indexFullness": 0.00008,
  "totalVectorCount": 8
}
```

</ResponseExample> */}


# Fetch vectors

data_2024-10 get /vectors/fetch
The `fetch` operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.fetch(ids=["id-1", "id-2"], namespace="example-namespace")
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const fetchResult = await index.namespace('example-namespace').fetch(['id-1', 'id-2']);
  ```

  ```java Java
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;
  import io.pinecone.proto.FetchResponse;

  import java.util.Arrays;
  import java.util.List;

  public class FetchExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          List<String> ids = Arrays.asList("id-1", "id-2");
          FetchResponse fetchResponse = index.fetch(ids, "example-namespace");
          System.out.println(fetchResponse);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "encoding/json"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func prettifyStruct(obj interface{}) string {
  	bytes, _ := json.MarshalIndent(obj, "", "  ")
  	return string(bytes)
  }

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      res, err := idxConnection.FetchVectors(ctx, []string{"id-1", "id-2"})
      if err != nil {
          log.Fatalf("Failed to fetch vectors: %+v", err)
      } else {
          fmt.Printf(prettifyStruct(res))
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var fetchResponse = await index.FetchAsync(new FetchRequest {
      Ids = new List<string> { "id-1", "id-2" },
      Namespace = "example-namespace",
  });

  Console.WriteLine(fetchResponse);
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X GET "https://$INDEX_HOST/vectors/fetch?ids=id-1&ids=id-2&namespace=example-namespace" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>

{/* <ResponseExample>

```shell
{
  "vectors": {
    "id-1": {
      "id": "id-1",
      "values": [0.568879, 0.632687092, 0.856837332, ...]
    },
    "id-2": {
      "id": "id-2",
      "values": [0.00891787093, 0.581895, 0.315718859, ...]
    }
  },
  "namespace": "example-namespace"
  "usage": {"readUnits": 1},
}
```

</ResponseExample> */}


# List vector IDs

data_2024-10 get /vectors/list
The `list` operation lists the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix.

By default, `list` returns up to 100 IDs per page in sorted order (bitwise "C" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return.

For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids).

**Note:** `list_vectors` is supported only for serverless indexes.

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='YOUR_API_KEY')

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  # To iterate over all result pages using a generator function
  for ids in index.list(prefix="document1#", namespace="example-namespace"):
      print(ids)

  # For manual control over pagination
  results = index.list_paginated(
      prefix="document1#",
      limit=3,
      namespace="example-namespace",
      pagination_token="eyJza2lwX3Bhc3QiOiIxMDEwMy0="
  )
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone';
  const pc = new Pinecone();

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST").namespace("example-namespace");

  const results = await index.listPaginated({ prefix: 'document1#' });
  console.log(results);

  // Fetch the next page of results
  await index.listPaginated({ prefix: 'document1#', paginationToken: results.pagination.next});
  ```

  ```java Java
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;
  import io.pinecone.proto.ListResponse;

  public class ListExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          ListResponse listResponse = index.list("example-namespace", "document1#");
          System.out.println(listResponse);
      }
  }
  ```

  ```go Go
  package main

  import (
  	"context"
  	"encoding/json"
  	"fmt"
  	"log"

  	"github.com/pinecone-io/go-pinecone/pinecone"
  )

  func prettifyStruct(obj interface{}) string {
  	bytes, _ := json.MarshalIndent(obj, "", "  ")
  	return string(bytes)
  }

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      limit := uint32(3)
      prefix := "document1#"

      res, err := idxConnection.ListVectors(ctx, &pinecone.ListVectorsRequest{
          Limit:  &limit,
          Prefix: &prefix,
      })
      if len(res.VectorIds) == 0 {
          fmt.Println("No vectors found")
      } else {
          fmt.Printf(prettifyStruct(res))
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var listResponse = await index.ListAsync(new ListRequest {
      Namespace = "example-namespace",
      Prefix = "document1#",
  });

  Console.WriteLine(listResponse);
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X GET "https://$INDEX_HOST/vectors/list?namespace=example-namespace&prefix=document1#" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# List imports

data_2024-10 get /bulk/imports
The `list_imports` operation lists all recent and ongoing import operations. 

By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return.

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).

<Note>
  This feature is in [public preview](/release-notes/feature-availability) and available only on [Standard and Enterprise plans](https://www.pinecone.io/pricing/).
</Note>

<RequestExample>
  ```python Python
  from pinecone import Pinecone, ImportErrorMode

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  # List using a generator that handles pagination
  for i in index.list_imports():
    print(f"id: {i.id} status: {i.status}")

  # List using a generator that fetches all results at once
  operations = list(index.list_imports())
  print(operations)
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const results = await index.listImports();
  console.log(results);

  // Fetch the next page of results
  const results = await index.listImports({ paginationToken: 'Tm90aGluZyB0byBzZWUgaGVyZQo' });
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import io.pinecone.clients.AsyncIndex;
  import org.openapitools.db_data.client.ApiException;
  import org.openapitools.db_data.client.model.ListImportsResponse;

  public class ListImports {
      public static void main(String[] args) throws ApiException {
          // Initialize a Pinecone client with your API key
          Pinecone pinecone = new Pinecone.Builder("YOUR_API_KEY").build();

          // Get async imports connection object
          AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection("example-index");

          // List imports
          ListImportsResponse response = asyncIndex.listImports(10, "Tm90aGluZyB0byBzZWUgaGVyZQo");

          System.out.println(response);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      limit := int32(10)
      firstImportPage, err := idxConnection.ListImports(ctx, &limit, nil)
      if err != nil {
          log.Fatalf("Failed to list imports: %v", err)
      }
      fmt.Printf("First page of imports: %+v", firstImportPage.Imports)

      paginationToken := firstImportPage.NextPaginationToken
      nextImportPage, err := idxConnection.ListImports(ctx, &limit, paginationToken)
      if err != nil {
          log.Fatalf("Failed to list imports: %v", err)
      }
      fmt.Printf("Second page of imports: %+v", nextImportPage.Imports)
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var imports = await index.ListBulkImportsAsync(new ListBulkImportsRequest
  {
      Limit = 10,
      PaginationToken = "Tm90aGluZyB0byBzZWUgaGVyZQo"
  });
  ```

  ```bash curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl -X GET "https://$INDEX_HOST/bulk/imports?paginationToken==Tm90aGluZyB0byBzZWUgaGVyZQo" \
    -H "Api-Key: $YOUR_API_KEY" \
    -H "X-Pinecone-API-Version: 2024-10"
  ```
</RequestExample>


# Query vectors

data_2024-10 post /query
The `query` operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.query(
      namespace="example-namespace",
      vector=[0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
      filter={
          "genre": {"$eq": "documentary"}
      },
      top_k=3,
      include_values=True
  )
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const queryResponse = await index.namespace('example-namespace').query({
      vector: [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
      filter: {
        'genre': {'$eq': 'documentary'}
      },
      topK: 3,
      includeValues: true
  });
  ```

  ```java Java
  import com.google.protobuf.Struct;
  import com.google.protobuf.Value;
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;
  import io.pinecone.unsigned_indices_model.QueryResponseWithUnsignedIndices;

  import java.util.Arrays;
  import java.util.List;

  public class QueryExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          List<Float> query = Arrays.asList(0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f);
          Struct filter = Struct.newBuilder()
                  .putFields("genre", Value.newBuilder()
                          .setStructValue(Struct.newBuilder()
                                  .putFields("$eq", Value.newBuilder()
                                          .setStringValue("documentary")
                                          .build()))
                          .build())
                  .build();

          QueryResponseWithUnsignedIndices queryResponse = index.query(3, query, null, null, null, "example-namespace", filter, false, true);

          System.out.println(queryResponse);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "encoding/json"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
      "google.golang.org/protobuf/types/known/structpb"
  )

  func prettifyStruct(obj interface{}) string {
  	bytes, _ := json.MarshalIndent(obj, "", "  ")
  	return string(bytes)
  }

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      queryVector := []float32{0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3}

      metadataMap := map[string]interface{}{
          "genre": map[string]interface{}{
              "$eq": "documentary",
          },
      }

      metadataFilter, err := structpb.NewStruct(metadataMap)
      if err != nil {
          log.Fatalf("Failed to create metadata map: %v", err)
      }

      res, err := idxConnection.QueryByVectorValues(ctx, &pinecone.QueryByVectorValuesRequest{
          Vector:         queryVector,
          TopK:           3,
          MetadataFilter: metadataFilter,
          IncludeValues:  true,
      })
      if err != nil {
          log.Fatalf("Error encountered when querying by vector: %v", err)
      } else {
          fmt.Printf(prettifyStruct(res))
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var queryResponse = await index.QueryAsync(new QueryRequest {
      Vector = new[] { 0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f, 0.3f },
      Namespace = "example-namespace",
      TopK = 3,
      Filter = new Metadata
      {
          ["genre"] =
              new Metadata
              {
                  ["$eq"] = "documentary",
              }
      }
  });

  Console.WriteLine(queryResponse);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl "https://$INDEX_HOST/query" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
      "namespace": "example-namespace",
      "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
      "filter": {"genre": {"$eq": "documentary"}},
      "topK": 3,
      "includeValues": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```shell
  {
    "matches":[
      {
        "id": "vec3",
        "score": 0,
        "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]
      },
      {
        "id": "vec2",
        "score": 0.0800000429,
        "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
      },
      {
        "id": "vec4",
        "score": 0.0799999237,
        "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
      }
    ],
    "namespace": "example-namespace",
    "usage": {"read_units": 6}
  }
  ```
</ResponseExample>


# Start import

data_2024-10 post /bulk/imports
The `start_import` operation starts an asynchronous import of vectors from object storage into an index. 

For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data).

<Note>
  This feature is in [public preview](/release-notes/feature-availability) and available only on [Standard and Enterprise plans](https://www.pinecone.io/pricing/).
</Note>

<RequestExample>
  ```python Python
  from pinecone import Pinecone, ImportErrorMode

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")
  root = "s3://BUCKET_NAME/PATH/TO/DIR"

  index.start_import(
      uri=root,
      error_mode=ImportErrorMode.CONTINUE, # or ImportErrorMode.ABORT
      integration_id="a12b3d4c-47d2-492c-a97a-dd98c8dbefde" # Optional for public buckets
  )
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  const storageURI = 's3://BUCKET_NAME/PATH/TO/DIR';
  const errorMode = 'continue'; // or 'abort'
  const integrationID = 'a12b3d4c-47d2-492c-a97a-dd98c8dbefde'; // Optional for public buckets

  await index.startImport(storageURI, errorMode, integrationID); 
  ```

  ```java Java
  import io.pinecone.clients.Pinecone;
  import io.pinecone.clients.AsyncIndex;
  import org.openapitools.db_data.client.ApiException;
  import org.openapitools.db_data.client.model.ImportErrorMode;
  import org.openapitools.db_data.client.model.StartImportResponse;

  public class StartImport {
      public static void main(String[] args) throws ApiException {
          // Initialize a Pinecone client with your API key
          Pinecone pinecone = new Pinecone.Builder("YOUR_API_KEY").build();

          // Get async imports connection object
          AsyncIndex asyncIndex = pinecone.getAsyncIndexConnection("example-index");

          // s3 uri
          String uri = "s3://BUCKET_NAME/PATH/TO/DIR";

          // Integration ID (optional for public buckets)
          String integrationId = "a12b3d4c-47d2-492c-a97a-dd98c8dbefde";

          // Start an import
          StartImportResponse response = asyncIndex.startImport(uri, integrationId, ImportErrorMode.OnErrorEnum.CONTINUE);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
  	}

      uri := "s3://BUCKET_NAME/PATH/TO/DIR"
      errorMode := "continue" // or "abort"
      importRes, err := idxConnection.StartImport(ctx, uri, nil, (*pinecone.ImportErrorMode)(&errorMode))
      if err != nil {
          log.Fatalf("Failed to start import: %v", err)
      }
      fmt.Printf("Import started with ID: %s", importRes.Id)
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var uri = "s3://BUCKET_NAME/PATH/TO/DIR";

  var response = await index.StartBulkImportAsync(new StartImportRequest
  {
      Uri = uri,
      IntegrationId = "a12b3d4c-47d2-492c-a97a-dd98c8dbefde",
      ErrorMode = new ImportErrorMode { OnError = ImportErrorModeOnError.Continue }
  });
  ```

  ```bash curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl "https://$INDEX_HOST/bulk/imports" \
    -H 'Api-Key: $YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -H 'X-Pinecone-API-Version: 2024-10' \
    -d '{
          "integrationId": "a12b3d4c-47d2-492c-a97a-dd98c8dbefde",
          "uri": "s3://BUCKET_NAME/PATH/TO/DIR",
          "errorMode": {
              "onError": "continue"
              }
          }'
  ```
</RequestExample>


# Update a vector

data_2024-10 post /vectors/update
The `update` operation updates a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value.

For guidance and examples, see [Update data](https://docs.pinecone.io/guides/data/update-data).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  index.update(
  	id="id-3", 
  	values=[4.0, 2.0], 
  	set_metadata={"genre": "comedy"},
  	namespace="example-namespace"
  )
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: "YOUR_API_KEY" })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  await index.namespace('example-namespace').update({
    id: 'id-3',
    values: [4.0, 2.0],
    metadata: {
      genre: "comedy",
    },
  });
  ```

  ```java Java
  import com.google.protobuf.Struct;
  import com.google.protobuf.Value;
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;
  import io.pinecone.proto.UpdateResponse;

  import java.util.Arrays;
  import java.util.List;

  public class UpdateExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          List<Float> values = Arrays.asList(4.0f, 2.0f);
  		Struct metaData = Struct.newBuilder()
  			.putFields("genre",
  					Value.newBuilder().setStringValue("comedy").build())
  			.build();
          UpdateResponse updateResponse = index.update("id-3", values, metaData, "example-namespace", null, null);
          System.out.println(updateResponse);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
      "google.golang.org/protobuf/types/known/structpb"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST", Namespace: "example-namespace"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      id := "id-3"

      metadataMap := map[string]interface{}{
          "genre": "comedy",
      }

      metadataFilter, err := structpb.NewStruct(metadataMap)
      if err != nil {
          log.Fatalf("Failed to create metadata map: %v", err)
      }

      err = idxConnection.UpdateVector(ctx, &pinecone.UpdateVectorRequest{
          Id:       id,
          Metadata: metadataFilter,
      })
      if err != nil {
          log.Fatalf("Failed to update vector with ID %v: %v", id, err)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var updateResponse = await index.UpdateAsync(new UpdateRequest {
      Id = "id-3",
      Values = new[] { 4.0f, 2.0f },
      SetMetadata = new Metadata { ["genre"] = "comedy" },
      Namespace = "example-namespace",
  });
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl "https://$INDEX_HOST/vectors/update" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
          "id": "id-3",
          "values": [4.0, 2.0],
          "setMetadata": {"type": "comedy"},
          "namespace": "example-namespace"
        }'
  ```
</RequestExample>


# Upsert vectors

data_2024-10 post /vectors/upsert
The `upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.

For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data).

<RequestExample>
  ```python Python
  # pip install pinecone[grpc]
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  # To get the unique host for an index, 
  # see https://docs.pinecone.io/guides/data/target-an-index
  index = pc.Index(host="INDEX_HOST")

  upsert_response = index.upsert(
      vectors=[
          {
              "id": "vec1",
              "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
              "sparse_values": {
                  "indices": [1, 5],
                  "values": [0.5, 0.5]
              },
              "metadata": {
                  "genre": "drama"
              }
          },
          {
              "id": "vec2",
              "values": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
              "sparse_values": {
                  "indices": [5, 6],
                  "values": [0.4, 0.5]
              },
              "metadata": {
                  "genre": "action"
              }
          }
      ],
      namespace="example-namespace"
  )
  ```

  ```javascript JavaScript
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: "YOUR_API_KEY" })

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  const index = pc.index("INDEX_NAME", "INDEX_HOST")

  await index.namespace('example-namespace').upsert([
    {
      id: 'vec1',
      values: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
      sparseValues: {
          indices: [1, 5],
          values: [0.5, 0.5]
      },
      metadata: {'genre': 'drama'},
    },
    {
      id: 'vec2',
      values: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
      metadata: {'genre': 'action'},
      sparseValues: {
          indices: [5, 6],
          values: [0.4, 0.5]
      }
    }
  ])
  ```

  ```java Java
  import com.google.protobuf.Struct;
  import com.google.protobuf.Value;
  import io.pinecone.clients.Index;
  import io.pinecone.configs.PineconeConfig;
  import io.pinecone.configs.PineconeConnection;

  import java.util.Arrays;
  import java.util.List;

  public class UpsertExample {
      public static void main(String[] args) {
          PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
          // To get the unique host for an index, 
          // see https://docs.pinecone.io/guides/data/target-an-index
          config.setHost("INDEX_HOST");
          PineconeConnection connection = new PineconeConnection(config);
          Index index = new Index(connection, "INDEX_NAME");
          List<Float> values1 = Arrays.asList(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f);
          List<Float> values2 = Arrays.asList(0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f);
          Struct metaData1 = Struct.newBuilder()
                  .putFields("genre", Value.newBuilder().setStringValue("drama").build())
                  .build();
          Struct metaData2 = Struct.newBuilder()
                  .putFields("genre", Value.newBuilder().setStringValue("action").build())
                  .build();

          index.upsert("A", values1, null, null, metaData1, null);
          index.upsert("B", values2, null, null, metaData2, null);
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
      "google.golang.org/protobuf/types/known/structpb"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // To get the unique host for an index, 
      // see https://docs.pinecone.io/guides/data/target-an-index
      idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
      if err != nil {
          log.Fatalf("Failed to create IndexConnection for Host: %v", err)
    	}

      sparseValues1 := pinecone.SparseValues{
          Indices: []uint32{1, 5},
          Values:  []float32{0.5, 0.5},
      }

      sparseValues2 := pinecone.SparseValues{
          Indices: []uint32{5, 6},
          Values:  []float32{0.4, 0.5},
      }

      metadataMap1 := map[string]interface{}{
          "genre": "comedy",
          "year": 2020,
      }

      metadata1, err := structpb.NewStruct(metadataMap1)
      if err != nil {
          log.Fatalf("Failed to create metadata map: %v", err)
      }

      metadataMap2 := map[string]interface{}{
          "genre": "documentary",
          "year": 2019,
      }

      metadata2, err := structpb.NewStruct(metadataMap2)
      if err != nil {
          log.Fatalf("Failed to create metadata map: %v", err)
      }

      vectors := []*pinecone.Vector{
          {
              Id:     "vec1",
              Values: []float32{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8},
              SparseValues: &sparseValues1,
              Metadata: metadata1,
          },
          {
              Id:     "vec2",
              Values: []float32{0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9},
              SparseValues: &sparseValues2,
              Metadata: metadata2,
          },
      }

      count, err := idxConnection.UpsertVectors(ctx, vectors)
      if err != nil {
  	      log.Fatalf("Failed to upsert vectors: %v", err)
      } else {
  	      fmt.Printf("Successfully upserted %d vector(s)!\n", count)
      }
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // To get the unique host for an index, 
  // see https://docs.pinecone.io/guides/data/target-an-index
  var index = pinecone.Index(host: "INDEX_HOST");

  var upsertResponse = await index.UpsertAsync(new UpsertRequest {
      Vectors = new[]
      {
          new Vector
          {
              Id = "vec1",
              Values = new[] { 1.0f, 1.5f },
              SparseValues = new SparseValues
              {
                  Indices = [1, 5],
                  Values = new[] { 0.5f, 0.5f },
              },
              Metadata = new Metadata {
                  ["genre"] = new("comedy"),
                  ["year"] = new(2020),
              }
          },
          new Vector
          {
              Id = "vec2",
              Values = new[] { 2.0f, 1.0f },
              SparseValues = new SparseValues
              {
                  Indices = [5, 6],
                  Values = new[] { 0.4f, 0.5f },
              },
              Metadata = new Metadata {
                  ["genre"] = new("documentary"),
                  ["year"] = new(2019),
              },
          }
      },
      Namespace = "example-namespace",
  });
  ```

  ```shell curl
  # To get the unique host for an index,
  # see https://docs.pinecone.io/guides/data/target-an-index
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="INDEX_HOST"

  curl "https://$INDEX_HOST/vectors/upsert" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
          "vectors": [
            {
              "id": "vec1",
              "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
              "sparseValues": {
                "indices": [2, 7],
                "values": [0.4, 0.5]
              },
              "metadata": {
                "genre": "drama"
              }
            },
            {
              "id": "vec2",
              "values": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
              "sparseValues": {
                "indices": [1, 4],
                "values": [0.1, 0.2]
              },
              "metadata": {
                "genre": "action"
              }
            }
          ],
          "namespace": "example-namespace"
        }'
  ```
</RequestExample>


# Embed data

inference_2024-10 post /embed
Generate embeddings for input data.

For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings).

<RequestExample>
  ```python Python
  # Import the Pinecone library
  from pinecone.grpc import PineconeGRPC as Pinecone
  from pinecone import ServerlessSpec
  import time

  # Initialize a Pinecone client with your API key
  pc = Pinecone(api_key="YOUR_API_KEY")

  # Define a sample dataset where each item has a unique ID and piece of text
  data = [
      {"id": "vec1", "text": "Apple is a popular fruit known for its sweetness and crisp texture."},
      {"id": "vec2", "text": "The tech company Apple is known for its innovative products like the iPhone."},
      {"id": "vec3", "text": "Many people enjoy eating apples as a healthy snack."},
      {"id": "vec4", "text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
      {"id": "vec5", "text": "An apple a day keeps the doctor away, as the saying goes."},
      {"id": "vec6", "text": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."}
  ]

  # Convert the text into numerical vectors that Pinecone can index
  embeddings = pc.inference.embed(
      model="multilingual-e5-large",
      inputs=[d['text'] for d in data],
      parameters={"input_type": "passage", "truncate": "END"}
  )

  print(embeddings)
  ```

  ```javascript JavaScript
  // Import the Pinecone library
  import { Pinecone } from '@pinecone-database/pinecone';

  // Initialize a Pinecone client with your API key
  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  // Define a sample dataset where each item has a unique ID and piece of text
  const data = [
    { id: 'vec1', text: 'Apple is a popular fruit known for its sweetness and crisp texture.' },
    { id: 'vec2', text: 'The tech company Apple is known for its innovative products like the iPhone.' },
    { id: 'vec3', text: 'Many people enjoy eating apples as a healthy snack.' },
    { id: 'vec4', text: 'Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.' },
    { id: 'vec5', text: 'An apple a day keeps the doctor away, as the saying goes.' },
    { id: 'vec6', text: 'Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership.' }
  ];

  // Convert the text into numerical vectors that Pinecone can index
  const model = 'multilingual-e5-large';

  const embeddings = await pc.inference.embed(
    model,
    data.map(d => d.text),
    { inputType: 'passage', truncate: 'END' }
  );

  console.log(embeddings);
  ```

  ```java Java
  // Import the required classes
  import io.pinecone.clients.Index;
  import io.pinecone.clients.Inference;
  import io.pinecone.clients.Pinecone;
  import org.openapitools.inference.client.ApiException;
  import org.openapitools.inference.client.model.Embedding;

  import java.math.BigDecimal;
  import java.util.*;
  import java.util.stream.Collectors;

  public class GenerateEmbeddings {
      public static void main(String[] args) throws ApiException {
          // Initialize a Pinecone client with your API key
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          Inference inference = pc.getInferenceClient();

          // Prepare input sentences to be embedded
          List<DataObject> data = Arrays.asList(
              new DataObject("vec1", "Apple is a popular fruit known for its sweetness and crisp texture."),
              new DataObject("vec2", "The tech company Apple is known for its innovative products like the iPhone."),
              new DataObject("vec3", "Many people enjoy eating apples as a healthy snack."),
              new DataObject("vec4", "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."),
              new DataObject("vec5", "An apple a day keeps the doctor away, as the saying goes."),
              new DataObject("vec6", "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership.")
          );

          List<String> inputs = data.stream()
              .map(DataObject::getText)
              .collect(Collectors.toList());

          // Specify the embedding model and parameters
          String embeddingModel = "multilingual-e5-large";

          Map<String, Object> parameters = new HashMap<>();
          parameters.put("input_type", "passage");
          parameters.put("truncate", "END");

          // Convert the text into numerical vectors that Pinecone can index
          List<Embedding> embeddingsList = inference.embed(embeddingModel, parameters, inputs).getData();
      }

      private static List<Float> convertBigDecimalToFloat(List<BigDecimal> bigDecimalValues) {
          return bigDecimalValues.stream()
              .map(BigDecimal::floatValue)
              .collect(Collectors.toList());
      }
  }

  class DataObject {
      private String id;
      private String text;

      public DataObject(String id, String text) {
          this.id = id;
          this.text = text;
      }

      public String getId() {
          return id;
      }
      public String getText() {
          return text;
      }
  }
  ```

  ```go Go
  package main

  // Import the required packages
  import (
      "context"
     	"encoding/json"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  type Data struct {
      ID   string
      Text string
  }

  type Query struct {
  	Text string
  }

  func prettifyStruct(obj interface{}) string {
      bytes, _ := json.MarshalIndent(obj, "", "  ")
      return string(bytes)
  }

  func main() {
      ctx := context.Background()

      // Initialize a Pinecone client with your API key
      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      // Define a sample dataset where each item has a unique ID and piece of text
      data := []Data{
          {ID: "vec1", Text: "Apple is a popular fruit known for its sweetness and crisp texture."},
          {ID: "vec2", Text: "The tech company Apple is known for its innovative products like the iPhone."},
          {ID: "vec3", Text: "Many people enjoy eating apples as a healthy snack."},
          {ID: "vec4", Text: "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
          {ID: "vec5", Text: "An apple a day keeps the doctor away, as the saying goes."},
          {ID: "vec6", Text: "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."},
      }

      // Specify the embedding model and parameters
      embeddingModel := "multilingual-e5-large"

      docParameters := pinecone.EmbedParameters{
          InputType: "passage",
          Truncate:  "END",
      }

      // Convert the text into numerical vectors that Pinecone can index
      var documents []string
      for _, d := range data {
          documents = append(documents, d.Text)
      }

      docEmbeddingsResponse, err := pc.Inference.Embed(ctx, &pinecone.EmbedRequest{
          Model:      embeddingModel,
          TextInputs: documents,
          Parameters: docParameters,
      }) 
      if err != nil {
          log.Fatalf("Failed to embed documents: %v", err)
      } else {
          fmt.Printf(prettifyStruct(docEmbeddingsResponse))
      }
  }
  ```

  ```csharp C#
  using Pinecone;
  using System;
  using System.Collections.Generic;

  // Initialize a Pinecone client with your API key
  var pinecone = new PineconeClient("YOUR_API_KEY");

  // Prepare input sentences to be embedded
  var data = new[]
  {
      new
      {
          Id = "vec1",
          Text = "Apple is a popular fruit known for its sweetness and crisp texture."
      },
      new
      {
          Id = "vec2",
          Text = "The tech company Apple is known for its innovative products like the iPhone."
      },
      new
      {
          Id = "vec3",
          Text = "Many people enjoy eating apples as a healthy snack."
      },
      new
      {
          Id = "vec4",
          Text = "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."
      },
      new
      {
          Id = "vec5",
          Text = "An apple a day keeps the doctor away, as the saying goes."
      },
      new
      {
          Id = "vec6",
          Text = "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."
      }
  };

  // Specify the embedding model and parameters
  var embeddingModel = "multilingual-e5-large";

  // Generate embeddings for the input data
  var embeddings = await pinecone.Inference.EmbedAsync(new EmbedRequest
  {
      Model = embeddingModel,
      Inputs = data.Select(item => new EmbedRequestInputsItem { Text = item.Text }),
      Parameters = new EmbedRequestParameters
      {
          InputType = "passage",
          Truncate = "END"
      }
  });

  Console.WriteLine(embeddings);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl https://api.pinecone.io/embed \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -d '{
        "model": "multilingual-e5-large",
        "parameters": {
          "input_type": "passage",
          "truncate": "END"
        },
        "inputs": [
          {"text": "Apple is a popular fruit known for its sweetness and crisp texture."},
          {"text": "The tech company Apple is known for its innovative products like the iPhone."},
          {"text": "Many people enjoy eating apples as a healthy snack."},
          {"text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
          {"text": "An apple a day keeps the doctor away, as the saying goes."},
          {"text": "Apple Computer Company was founded on April 1, 1976, by Steve Jobs, Steve Wozniak, and Ronald Wayne as a partnership."}
        ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```python Python
  EmbeddingsList(
      model='multilingual-e5-large',
      data=[
          {'values': [0.04925537109375, -0.01313018798828125, -0.0112762451171875, ...]},
          ...
      ],
      usage={'total_tokens': 130}
  )
  ```

  ```javascript JavaScript
  EmbeddingsList(1) [
    {
      values: [
        0.04925537109375, 
        -0.01313018798828125, 
        -0.0112762451171875,
        ...
      ]
    },
    ...
    model: 'multilingual-e5-large',
    data: [ { values: [Array] } ],
    usage: { totalTokens: 130 }
  ]
  ```

  ```java Java
  class EmbeddingsList {
      model: multilingual-e5-large
      data: [class Embedding {
          values: [0.04925537109375, -0.01313018798828125, -0.0112762451171875, ...]
          additionalProperties: null
      }, ...]
      usage: class EmbeddingsListUsage {
          totalTokens: 130
          additionalProperties: null
      }
      additionalProperties: null
  }
  ```

  ```go Go
  {
    "data": [
      {
        "values": [
          0.03942871,
          -0.010177612,
          -0.046051025,
          ...
        ]
      },
      ...
    ], 
    "model": "multilingual-e5-large",
    "usage": {
      "total_tokens": 130
    }
  }
  ```

  ```csharp C#
  {
    "model": "multilingual-e5-large",
    "data": [
      {
        "values": [
          0.04913330078125,
          -0.01306915283203125,
          -0.01116180419921875,
          ...
        ]
      },
      ...
    ],
    "usage": {
      "total_tokens": 130
    }
  }
  ```

  ```json curl
  {
    "data": [
      {
        "values": [
          0.04925537109375,
          -0.01313018798828125,
          -0.0112762451171875,
          ...
        ]
      }, 
      ...
    ],
    "model": "multilingual-e5-large",
    "usage": {
      "total_tokens": 130
    }
  }
  ```
</ResponseExample>


# Rerank documents

inference_2024-10 post /rerank
Rerank documents according to their relevance to a query.

For guidance and examples, see [Rerank documents](https://docs.pinecone.io/guides/inference/rerank).

<RequestExample>
  ```python Python
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key="YOUR_API_KEY")

  result = pc.inference.rerank(
      model="bge-reranker-v2-m3",
      query="The tech company Apple is known for its innovative products like the iPhone.",
      documents=[
          {"id": "vec1", "text": "Apple is a popular fruit known for its sweetness and crisp texture."},
          {"id": "vec2", "text": "Many people enjoy eating apples as a healthy snack."},
          {"id": "vec3", "text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
          {"id": "vec4", "text": "An apple a day keeps the doctor away, as the saying goes."},
      ],
      top_n=4,
      return_documents=True,
      parameters={
          "truncate": "END"
      }
  )

  print(result)
  ```

  ```javascript JavaScript
  import { Pinecone } from '@pinecone-database/pinecone';

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

  const rerankingModel = 'bge-reranker-v2-m3';

  const query = 'The tech company Apple is known for its innovative products like the iPhone.';

  const documents = [
    { id: 'vec1', text: 'Apple is a popular fruit known for its sweetness and crisp texture.' },
    { id: 'vec2', text: 'Many people enjoy eating apples as a healthy snack.' },
    { id: 'vec3', text: 'Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.' },
    { id: 'vec4', text: 'An apple a day keeps the doctor away, as the saying goes.' },
  ];

  const rerankOptions = {
    topN: 4,
    returnDocuments: true,
    parameters: {
      truncate: 'END'
    }, 
  };

  const response = await pc.inference.rerank(
    rerankingModel,
    query,
    documents,
    rerankOptions
  );

  console.log(response);
  ```

  ```java Java
  import io.pinecone.clients.Inference;
  import io.pinecone.clients.Pinecone;
  import org.openapitools.inference.client.model.RerankResult;
  import org.openapitools.inference.client.ApiException;

  import java.util.*;

  public class RerankExample {
      public static void main(String[] args) throws ApiException {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          Inference inference = pc.getInferenceClient();

          // The model to use for reranking
          String model = "bge-reranker-v2-m3";

          // The query to rerank documents against
          String query = "The tech company Apple is known for its innovative products like the iPhone.";

          // Add the documents to rerank
          List<Map<String, String>> documents = new ArrayList<>();
          Map<String, String> doc1 = new HashMap<>();
          doc1.put("id", "vec1");
          doc1.put("text", "Apple is a popular fruit known for its sweetness and crisp texture.");
          documents.add(doc1);

          Map<String, String> doc2 = new HashMap<>();
          doc2.put("id", "vec2");
          doc2.put("text", "Many people enjoy eating apples as a healthy snack.");
          documents.add(doc2);

          Map<String, String> doc3 = new HashMap<>();
          doc3.put("id", "vec3");
          doc3.put("text", "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.");
          documents.add(doc3);

          Map<String, String> doc4 = new HashMap<>();
          doc4.put("id", "vec4");
          doc4.put("text", "An apple a day keeps the doctor away, as the saying goes.");
          documents.add(doc4);

          // The fields to rank the documents by. If not provided, the default is "text"
          List<String> rankFields = Arrays.asList("text");

          // The number of results to return sorted by relevance. Defaults to the number of inputs
          int topN = 4;

          // Whether to return the documents in the response
          boolean returnDocuments = true;

          // Additional model-specific parameters for the reranker
          Map<String, String> parameters = new HashMap<>();
          parameters.put("truncate", "END");

          // Send ranking request
          RerankResult result = inference.rerank(model, query, documents, rankFields, topN, returnDocuments, parameters);

          // Get ranked data
          System.out.println(result.getData());
      }
  }
  ```

  ```go Go
  package main

  import (
      "context"
      "fmt"
      "log"

      "github.com/pinecone-io/go-pinecone/pinecone"
  )

  func main() {
      ctx := context.Background()

      pc, err := pinecone.NewClient(pinecone.NewClientParams{
          ApiKey: "YOUR_API_KEY",
      })
      if err != nil {
          log.Fatalf("Failed to create Client: %v", err)
      }

      rerankModel := "bge-reranker-v2-m3"
      topN := 4
      returnDocuments := true
      documents := []pinecone.Document{
          {"id": "vec1", "text": "Apple is a popular fruit known for its sweetness and crisp texture."},
          {"id": "vec2", "text": "Many people enjoy eating apples as a healthy snack."},
          {"id": "vec3", "text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
          {"id": "vec4", "text": "An apple a day keeps the doctor away, as the saying goes."},
      }

      ranking, err := pc.Inference.Rerank(ctx, &pinecone.RerankRequest{
          Model:           rerankModel,
          Query:           "The tech company Apple is known for its innovative products like the iPhone.",
          ReturnDocuments: &returnDocuments,
          TopN:            &topN,
          RankFields:      &[]string{"text"},
          Documents:       documents,
      })
      if err != nil {
          log.Fatalf("Failed to rerank: %v", err)
      }
      fmt.Printf("Rerank result: %+v\n", ranking)
  }
  ```

  ```csharp C#
  using Pinecone;

  var pinecone = new PineconeClient("YOUR_API_KEY");

  // The model to use for reranking
  var model = "bge-reranker-v2-m3";

  // The query to rerank documents against
  var query = "The tech company Apple is known for its innovative products like the iPhone.";

  // Add the documents to rerank
  var documents = new List<Dictionary<string, string>>
  {
      new()
      {
          ["id"] = "vec1",
          ["my_field"] = "Apple is a popular fruit known for its sweetness and crisp texture."
      },
      new()
      {
          ["id"] = "vec2",
          ["my_field"] = "Many people enjoy eating apples as a healthy snack."
      },
      new()
      {
          ["id"] = "vec3",
          ["my_field"] =
              "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."
      },
      new()
      {
          ["id"] = "vec4",
          ["my_field"] = "An apple a day keeps the doctor away, as the saying goes."
      }
  };

  // The fields to rank the documents by. If not provided, the default is "text"
  var rankFields = new List<string> { "my_field" };

  // The number of results to return sorted by relevance. Defaults to the number of inputs
  int topN = 4;

  // Whether to return the documents in the response
  bool returnDocuments = true;

  // Additional model-specific parameters for the reranker
  var parameters = new Dictionary<string, string>
  {
      ["truncate"] = "END"
  };

  // Send ranking request
  var result = await pinecone.Inference.RerankAsync(
      new RerankRequest
      {
          Model = model,
          Query = query,
          Documents = documents,
          RankFields = rankFields,
          TopN = topN,
          Parameters = parameters
      });

  Console.WriteLine(result);
  ```

  ```shell curl
  PINECONE_API_KEY="YOUR_API_KEY"

  curl https://api.pinecone.io/rerank \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-Pinecone-API-Version: 2024-10" \
    -H "Api-Key: $PINECONE_API_KEY" \
  -d '{
    "model": "bge-reranker-v2-m3",
    "query": "The tech company Apple is known for its innovative products like the iPhone.",
    "return_documents": true,
    "top_n": 4,
    "documents": [
      {"id": "vec1", "text": "Apple is a popular fruit known for its sweetness and crisp texture."},
      {"id": "vec2", "text": "Many people enjoy eating apples as a healthy snack."},
      {"id": "vec3", "text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."},
      {"id": "vec4", "text": "An apple a day keeps the doctor away, as the saying goes."}
    ],
    "parameters": {
      "truncate": "END"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```python Python
  RerankResult(
    model='bge-reranker-v2-m3',
    data=[
      { index=2, score=0.48357219,
        document={id="vec3", text="Apple Inc. has re..."} },
      { index=0, score=0.048405956,
        document={id="vec1", text="Apple is a popula..."} },
      { index=3, score=0.007846239,
        document={id="vec4", text="An apple a day ke..."} },
      { index=1, score=0.0006563728,
        document={id="vec2", text="Many people enjoy..."} }
    ],
    usage={'rerank_units': 1}
  )
  ```

  ```javascript JavaScript
  {
    model: 'bge-reranker-v2-m3',
    data: [
      { index: 2, score: 0.48357219, document: [Object] },
      { index: 0, score: 0.048405956, document: [Object] },
      { index: 3, score: 0.007846239, document: [Object] },
      { index: 1, score: 0.0006563728, document: [Object] }
    ],
    usage: { rerankUnits: 1 }
  }
  ```

  ```java Java
  [class RankedDocument {
      index: 2
      score: 0.48357219
      document: {id=vec3, text=Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.}
      additionalProperties: null
  }, class RankedDocument {
      index: 0
      score: 0.048405956
      document: {id=vec1, text=Apple is a popular fruit known for its sweetness and crisp texture.}
      additionalProperties: null
  }, class RankedDocument {
      index: 3
      score: 0.007846239
      document: {id=vec4, text=An apple a day keeps the doctor away, as the saying goes.}
      additionalProperties: null
  }, class RankedDocument {
      index: 1
      score: 0.0006563728
      document: {id=vec2, text=Many people enjoy eating apples as a healthy snack.}
      additionalProperties: null
  }]
  ```

  ```go Go
  Rerank result: {
    "data": [
      {
        "document": {
          "id": "vec3",
          "text": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."
        },
        "index": 2,
        "score": 0.48357219
      },
      {
        "document": {
          "id": "vec1",
          "text": "Apple is a popular fruit known for its sweetness and crisp texture."
        },
        "index": 0,
        "score": 0.048405956
      },
      {
        "document": {
          "id": "vec4",
          "text": "An apple a day keeps the doctor away, as the saying goes."
        },
        "index": 3,
        "score": 0.007846239
      },
      {
        "document": {
          "id": "vec2",
          "text": "Many people enjoy eating apples as a healthy snack."
        },
        "index": 1,
        "score": 0.0006563728
      }
    ],
    "model": "bge-reranker-v2-m3",
    "usage": {
      "rerank_units": 1
    }
  }
  ```

  ```csharp C#
  {
    "model": "bge-reranker-v2-m3",
    "data": [
      {
        "index": 2,
        "score": 0.48357219,
        "document": {
          "id": "vec3",
          "my_field": "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."
        }
      },
      {
        "index": 0,
        "score": 0.048405956,
        "document": {
          "id": "vec1",
          "my_field": "Apple is a popular fruit known for its sweetness and crisp texture."
        }
      },
      {
        "index": 3,
        "score": 0.007846239,
        "document": {
          "id": "vec4",
          "my_field": "An apple a day keeps the doctor away, as the saying goes."
        }
      },
      {
        "index": 1,
        "score": 0.0006563728,
        "document": {
          "id": "vec2",
          "my_field": "Many people enjoy eating apples as a healthy snack."
        }
      }
    ],
    "usage": {
      "rerank_units": 1
    }
  }
  ```

  ```JSON curl
  {
    "data":[
      {
        "index":2,
        "document":{
          "id":"vec3",
          "text":"Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces."
        },
        "score":0.47654688
      },
      {
        "index":0,
        "document":{
          "id":"vec1",
          "text":"Apple is a popular fruit known for its sweetness and crisp texture."
        },
        "score":0.047963805
      },
      {
        "index":3,
        "document":{
          "id":"vec4",
          "text":"An apple a day keeps the doctor away, as the saying goes."
        },
        "score":0.007587992
      },
      {
        "index":1,
        "document":{
          "id":"vec2",
          "text":"Many people enjoy eating apples as a healthy snack."
        },
        "score":0.0006491712
      }
    ],
    "usage":{
      "rerank_units":1
    }
  }
  ```
</ResponseExample>