Skip to content

Get Vector

vector_stores.vectors.retrieve(strvector_id, VectorRetrieveParams**kwargs) -> VectorDocument
GET/v5/vector-stores/{vector_store_name}/vectors/{vector_id}

Retrieve a single document by its unique ID.

Returns the document’s full content, metadata, and optionally its embedding vector. Use this endpoint for direct lookups when the exact document ID is known. For content similarity search, use the query endpoint.

ParametersExpand Collapse
vector_store_name: str

The name of the vector store

vector_id: str

The ID of the vector to retrieve

include_vectors: Optional[bool]

Include embedding vectors

ReturnsExpand Collapse
class VectorDocument: …

A document returned from direct lookups (get/list operations).

id: str

Document ID

content: Optional[TextContent]

Text content for documents.

text: str

Text content to be embedded

type: Optional[Literal["text"]]

Content type identifier

metadata: Optional[Dict[str, object]]

Key-value metadata

vector: Optional[List[float]]

Embedding vector (if requested)

Get Vector

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
vector_document = client.vector_stores.vectors.retrieve(
    vector_id="vector_id",
    vector_store_name="vector_store_name",
)
print(vector_document.id)
{
  "id": "id",
  "content": {
    "text": "text",
    "type": "text"
  },
  "metadata": {
    "foo": "bar"
  },
  "vector": [
    0
  ]
}
Returns Examples
{
  "id": "id",
  "content": {
    "text": "text",
    "type": "text"
  },
  "metadata": {
    "foo": "bar"
  },
  "vector": [
    0
  ]
}