Skip to content

Get Vector

client.VectorStores.Vectors.Get(ctx, vectorID, params) (*VectorDocument, error)
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
vectorID string

The ID of the vector to retrieve

params VectorStoreVectorGetParams
VectorStoreName param.Field[string]

Path param: The name of the vector store

IncludeVectors param.Field[bool]Optional

Query param: Include embedding vectors

ReturnsExpand Collapse
type VectorDocument struct{…}

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

ID string

Document ID

Content TextContentOptional

Text content for documents.

Text string

Text content to be embedded

Type TextContentTypeOptional

Content type identifier

Metadata map[string, any]Optional

Key-value metadata

Vector []float64Optional

Embedding vector (if requested)

Get Vector

package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  vectorDocument, err := client.VectorStores.Vectors.Get(
    context.TODO(),
    "vector_id",
    sgpdev.VectorStoreVectorGetParams{
      VectorStoreName: "vector_store_name",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorDocument.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
  ]
}