Skip to main content
Managed vector database for semantic search and retrieval-augmented generation. Use it to create indexes, generate embeddings and rerank results with Pinecone Inference, and upsert/query/fetch/delete vectors with metadata filtering. Unlike a general datastore, Pinecone is purpose-built for low-latency similarity search over high-dimensional embeddings at scale. 11 endpoints available through Lava’s AI Gateway. See the Pinecone API docs for full documentation.
This provider requires your own credentials — connect your API key or OAuth account before use.

Endpoints

List all indexes in the project

GET https://api.pinecone.io/indexes — Free
const data = await lava.gateway('https://api.pinecone.io/indexes', { method: 'GET' });

Create a serverless index. dimension must match your embedding model (e.g. 1024 for multilingual-e5-large).

POST https://api.pinecone.io/indexes — Free
const data = await lava.gateway('https://api.pinecone.io/indexes', {
  body: {
"name": "my-index",
"dimension": 1024,
"metric": "cosine",
"spec": {
  "serverless": {
    "cloud": "aws",
    "region": "us-east-1"
  }
}
},
});

Describe an index by name. Returns the host for data-plane requests (upsert/query/fetch/delete) on that index.

GET https://api.pinecone.io/indexes/my-index — Free
const data = await lava.gateway('https://api.pinecone.io/indexes/my-index', { method: 'GET' });

Delete an index by name

DELETE https://api.pinecone.io/indexes/my-index — Free
const data = await lava.gateway('https://api.pinecone.io/indexes/my-index', { method: 'DELETE' });

Generate embeddings for input text with a hosted Pinecone model (e.g. multilingual-e5-large, llama-text-embed-v2)

POST https://api.pinecone.io/embed — Free
const data = await lava.gateway('https://api.pinecone.io/embed', {
  body: {
"model": "multilingual-e5-large",
"parameters": {
  "input_type": "passage",
  "truncate": "END"
},
"inputs": [
  {
    "text": "The quick brown fox"
  }
]
},
});

Rerank documents against a query with a hosted reranking model (e.g. bge-reranker-v2-m3)

POST https://api.pinecone.io/rerank — Free
const data = await lava.gateway('https://api.pinecone.io/rerank', {
  body: {
"model": "bge-reranker-v2-m3",
"query": "what is a vector database",
"top_n": 2,
"documents": [
  {
    "id": "1",
    "text": "Pinecone is a vector database"
  },
  {
    "id": "2",
    "text": "A fox is an animal"
  }
]
},
});

Upsert vectors into a namespace. Target the index host from describe-index. values length must match the index dimension.

POST https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/upsert — Free
const data = await lava.gateway('https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/upsert', {
  body: {
"namespace": "ns1",
"vectors": [
  {
    "id": "v1",
    "values": [
      0.1,
      0.2,
      0.3
    ],
    "metadata": {
      "text": "hello"
    }
  }
]
},
});

Query a namespace for the topK nearest vectors. Target the index host from describe-index. Supports metadata filter.

POST https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/query — Free
const data = await lava.gateway('https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/query', {
  body: {
"namespace": "ns1",
"vector": [
  0.1,
  0.2,
  0.3
],
"topK": 3,
"includeMetadata": true,
"includeValues": false
},
});

Fetch vectors by id from a namespace. Target the index host from describe-index. Pass ids and namespace as query params.

GET https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/fetch?ids=v1&namespace=ns1 — Free
const data = await lava.gateway('https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/fetch?ids=v1&namespace=ns1', { method: 'GET' });

Delete vectors by id (or by metadata filter / deleteAll) from a namespace. Target the index host from describe-index.

POST https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/delete — Free
const data = await lava.gateway('https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/vectors/delete', { body: {"namespace":"ns1","ids":["v1","v2"]} });

Get vector counts and fullness per namespace for an index. Target the index host from describe-index.

POST https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/describe_index_stats — Free
const data = await lava.gateway('https://my-index-abc123.svc.aped-4627-b74a.pinecone.io/describe_index_stats', { body: {} });

Next Steps

All Providers

Browse all supported AI providers

Forward Proxy

Learn how to construct proxy URLs and authenticate requests