# Vector Stores

## List Vector Stores

`client.VectorStores.List(ctx, query) (*CursorPageByName[VectorStore], error)`

**get** `/v5/vector-stores`

List all vector stores in your account with pagination.

Returns vector stores sorted by creation date (newest first). Each store includes its configuration,
embedding model, dimensions, indexed fields, and timestamps.

### Parameters

- `query VectorStoreListParams`

  - `EndingBefore param.Field[string]`

  - `Limit param.Field[int64]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type VectorStore struct{…}`

  Response model for vector store operations.

  - `ID string`

    The unique identifier of the vector store

  - `CreatedAt Time`

    Timestamp of creation

  - `EmbeddingDimensions int64`

    Dimensionality of the embedding vectors

  - `Name string`

    The name of the vector store

  - `UpdatedAt Time`

    Timestamp of last update

  - `EmbeddingConfig EmbeddingConfigUnion`

    Embedding configuration identifying the model and its type. None for raw-embedding-only stores.

    - `type EmbeddingConfigModelsAPI struct{…}`

      - `ModelDeploymentID string`

        The ID of the deployment of the created model in the Models API V3.

      - `Type ModelsAPI`

        The type of the embedding configuration.

        - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

    - `type EmbeddingConfigBase struct{…}`

      - `EmbeddingModel EmbeddingModelName`

        The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

        - `type EmbeddingModelName string`

          - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

          - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

          - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

          - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

          - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

          - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

          - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

          - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

          - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

        - `string`

      - `Type EmbeddingConfigBaseType`

        The type of the embedding configuration.

        - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

  - `IndexedMetadataFields map[string, string]`

    Dictionary mapping metadata field names to their types

    - `const VectorStoreIndexedMetadataFieldString VectorStoreIndexedMetadataField = "string"`

    - `const VectorStoreIndexedMetadataFieldNumber VectorStoreIndexedMetadataField = "number"`

    - `const VectorStoreIndexedMetadataFieldBoolean VectorStoreIndexedMetadataField = "boolean"`

### Example

```go
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"),
  )
  page, err := client.VectorStores.List(context.TODO(), sgpdev.VectorStoreListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "embedding_dimensions": 0,
      "name": "name",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "embedding_config": {
        "model_deployment_id": "model_deployment_id",
        "type": "models_api"
      },
      "indexed_metadata_fields": {
        "foo": "string"
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```

## Create Vector Store

`client.VectorStores.New(ctx, body) (*VectorStore, error)`

**post** `/v5/vector-stores/create`

Create a new vector store for storing and querying document embeddings.

The vector store name must be unique within your account and follow naming conventions (3-63 characters,
alphanumeric with hyphens/underscores). Once created, the embedding configuration and dimensions
are immutable and cannot be changed. To use a different model, you must create a new vector store.

**Embedding Configuration:** Provide `embedding_config` (for base or custom model deployments),
`embedding_model` (shorthand for a base model), or `dimensions` only (raw embeddings).

- With `embedding_config` or `embedding_model`: dimensions are auto-derived, and documents can be
  upserted with text content (auto-embedded) or with pre-computed embeddings.
- With `dimensions` only: the store accepts only pre-computed embeddings. Semantic/hybrid queries
  are not supported (lexical search only).

**Indexed Fields:** Optionally specify metadata fields to index at creation time. Only indexed fields
can be used for filtering -- indexing is required, not just a performance optimization. Additional indexed
fields can be added later using the configure endpoint, but cannot be removed once added. Keep in mind
that each indexed field increases write latency and storage overhead, so only index fields you actively filter on.

### Parameters

- `body VectorStoreNewParams`

  - `Name param.Field[string]`

    A unique name for the vector store within the account

  - `Dimensions param.Field[int64]`

    Dimension size of embedding vectors. Required when neither 'embedding_config' nor 'embedding_model' is set. Automatically derived when an embedding model is provided.

  - `EmbeddingConfig param.Field[EmbeddingConfigUnion]`

    The embedding configuration. Either 'base' type with an embedding_model, or 'models_api' type with a model_deployment_id for custom models.

  - `EmbeddingModel param.Field[EmbeddingModelName]`

    The base embedding model to use. Shorthand for embedding_config with type 'base'. Provide either embedding_config or embedding_model, not both.

  - `IndexedMetadataFields param.Field[map[string, string]]`

    Dictionary mapping metadata field names to their types for efficient filtering. Only STRING, NUMBER, and BOOLEAN types can be indexed.

    - `const VectorStoreNewParamsIndexedMetadataFieldString VectorStoreNewParamsIndexedMetadataField = "string"`

    - `const VectorStoreNewParamsIndexedMetadataFieldNumber VectorStoreNewParamsIndexedMetadataField = "number"`

    - `const VectorStoreNewParamsIndexedMetadataFieldBoolean VectorStoreNewParamsIndexedMetadataField = "boolean"`

### Returns

- `type VectorStore struct{…}`

  Response model for vector store operations.

  - `ID string`

    The unique identifier of the vector store

  - `CreatedAt Time`

    Timestamp of creation

  - `EmbeddingDimensions int64`

    Dimensionality of the embedding vectors

  - `Name string`

    The name of the vector store

  - `UpdatedAt Time`

    Timestamp of last update

  - `EmbeddingConfig EmbeddingConfigUnion`

    Embedding configuration identifying the model and its type. None for raw-embedding-only stores.

    - `type EmbeddingConfigModelsAPI struct{…}`

      - `ModelDeploymentID string`

        The ID of the deployment of the created model in the Models API V3.

      - `Type ModelsAPI`

        The type of the embedding configuration.

        - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

    - `type EmbeddingConfigBase struct{…}`

      - `EmbeddingModel EmbeddingModelName`

        The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

        - `type EmbeddingModelName string`

          - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

          - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

          - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

          - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

          - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

          - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

          - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

          - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

          - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

        - `string`

      - `Type EmbeddingConfigBaseType`

        The type of the embedding configuration.

        - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

  - `IndexedMetadataFields map[string, string]`

    Dictionary mapping metadata field names to their types

    - `const VectorStoreIndexedMetadataFieldString VectorStoreIndexedMetadataField = "string"`

    - `const VectorStoreIndexedMetadataFieldNumber VectorStoreIndexedMetadataField = "number"`

    - `const VectorStoreIndexedMetadataFieldBoolean VectorStoreIndexedMetadataField = "boolean"`

### Example

```go
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"),
  )
  vectorStore, err := client.VectorStores.New(context.TODO(), sgpdev.VectorStoreNewParams{
    Name: "name",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStore.ID)
}
```

#### Response

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "embedding_dimensions": 0,
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "embedding_config": {
    "model_deployment_id": "model_deployment_id",
    "type": "models_api"
  },
  "indexed_metadata_fields": {
    "foo": "string"
  }
}
```

## Get Vector Store

`client.VectorStores.Get(ctx, vectorStoreName) (*VectorStore, error)`

**get** `/v5/vector-stores/{vector_store_name}`

Retrieve detailed configuration and metadata for a specific vector store.

Returns the store's embedding model, dimensions, indexed metadata field definitions,
creation timestamp, and last update timestamp. Use this to verify store settings before
performing operations or to display store information in your application.

### Parameters

- `vectorStoreName string`

  The name of the vector store

### Returns

- `type VectorStore struct{…}`

  Response model for vector store operations.

  - `ID string`

    The unique identifier of the vector store

  - `CreatedAt Time`

    Timestamp of creation

  - `EmbeddingDimensions int64`

    Dimensionality of the embedding vectors

  - `Name string`

    The name of the vector store

  - `UpdatedAt Time`

    Timestamp of last update

  - `EmbeddingConfig EmbeddingConfigUnion`

    Embedding configuration identifying the model and its type. None for raw-embedding-only stores.

    - `type EmbeddingConfigModelsAPI struct{…}`

      - `ModelDeploymentID string`

        The ID of the deployment of the created model in the Models API V3.

      - `Type ModelsAPI`

        The type of the embedding configuration.

        - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

    - `type EmbeddingConfigBase struct{…}`

      - `EmbeddingModel EmbeddingModelName`

        The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

        - `type EmbeddingModelName string`

          - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

          - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

          - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

          - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

          - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

          - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

          - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

          - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

          - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

        - `string`

      - `Type EmbeddingConfigBaseType`

        The type of the embedding configuration.

        - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

  - `IndexedMetadataFields map[string, string]`

    Dictionary mapping metadata field names to their types

    - `const VectorStoreIndexedMetadataFieldString VectorStoreIndexedMetadataField = "string"`

    - `const VectorStoreIndexedMetadataFieldNumber VectorStoreIndexedMetadataField = "number"`

    - `const VectorStoreIndexedMetadataFieldBoolean VectorStoreIndexedMetadataField = "boolean"`

### Example

```go
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"),
  )
  vectorStore, err := client.VectorStores.Get(context.TODO(), "vector_store_name")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStore.ID)
}
```

#### Response

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "embedding_dimensions": 0,
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "embedding_config": {
    "model_deployment_id": "model_deployment_id",
    "type": "models_api"
  },
  "indexed_metadata_fields": {
    "foo": "string"
  }
}
```

## Configure Vector Store

`client.VectorStores.Configure(ctx, vectorStoreName, body) (*VectorStore, error)`

**post** `/v5/vector-stores/{vector_store_name}/configure`

Update the indexed metadata fields configuration for a vector store.

This replaces the current set of indexed metadata fields. Only indexed fields can be used for
filtering during query, list, and count operations; non-indexed fields are still stored and
returned, but cannot be filtered on.

**Field Types:** Only STRING, NUMBER, and BOOLEAN fields can be indexed (maximum 20 fields).
OBJECT and LIST types are stored but cannot be indexed for filtering.

**Adding Fields:** New indexed fields can be added at any time. They are indexed for documents
upserted after the change; to make existing documents filterable on a new field, re-upsert them.

**Removing Fields:** Omitting a field removes it from this configuration, so it can no longer be
filtered on. The underlying index is append-only, so removal does not reclaim storage or reduce
write overhead; the field stays in the physical index until the store is recreated. Prefer
indexing only the fields you filter on.

**Note:** The `name` and `embedding_config` are immutable after creation.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `body VectorStoreConfigureParams`

  - `IndexedMetadataFields param.Field[map[string, string]]`

    Dictionary mapping metadata field names to their types. Only STRING, NUMBER, and BOOLEAN types can be indexed.

    - `const VectorStoreConfigureParamsIndexedMetadataFieldString VectorStoreConfigureParamsIndexedMetadataField = "string"`

    - `const VectorStoreConfigureParamsIndexedMetadataFieldNumber VectorStoreConfigureParamsIndexedMetadataField = "number"`

    - `const VectorStoreConfigureParamsIndexedMetadataFieldBoolean VectorStoreConfigureParamsIndexedMetadataField = "boolean"`

### Returns

- `type VectorStore struct{…}`

  Response model for vector store operations.

  - `ID string`

    The unique identifier of the vector store

  - `CreatedAt Time`

    Timestamp of creation

  - `EmbeddingDimensions int64`

    Dimensionality of the embedding vectors

  - `Name string`

    The name of the vector store

  - `UpdatedAt Time`

    Timestamp of last update

  - `EmbeddingConfig EmbeddingConfigUnion`

    Embedding configuration identifying the model and its type. None for raw-embedding-only stores.

    - `type EmbeddingConfigModelsAPI struct{…}`

      - `ModelDeploymentID string`

        The ID of the deployment of the created model in the Models API V3.

      - `Type ModelsAPI`

        The type of the embedding configuration.

        - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

    - `type EmbeddingConfigBase struct{…}`

      - `EmbeddingModel EmbeddingModelName`

        The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

        - `type EmbeddingModelName string`

          - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

          - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

          - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

          - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

          - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

          - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

          - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

          - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

          - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

        - `string`

      - `Type EmbeddingConfigBaseType`

        The type of the embedding configuration.

        - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

  - `IndexedMetadataFields map[string, string]`

    Dictionary mapping metadata field names to their types

    - `const VectorStoreIndexedMetadataFieldString VectorStoreIndexedMetadataField = "string"`

    - `const VectorStoreIndexedMetadataFieldNumber VectorStoreIndexedMetadataField = "number"`

    - `const VectorStoreIndexedMetadataFieldBoolean VectorStoreIndexedMetadataField = "boolean"`

### Example

```go
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"),
  )
  vectorStore, err := client.VectorStores.Configure(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreConfigureParams{
      IndexedMetadataFields: map[string]string{
      "foo": "string",
      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStore.ID)
}
```

#### Response

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "embedding_dimensions": 0,
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "embedding_config": {
    "model_deployment_id": "model_deployment_id",
    "type": "models_api"
  },
  "indexed_metadata_fields": {
    "foo": "string"
  }
}
```

## Drop Vector Store

`client.VectorStores.Drop(ctx, vectorStoreName) (*VectorStoreDropResponse, error)`

**post** `/v5/vector-stores/{vector_store_name}/drop`

Permanently delete a vector store and all its contents.

**⚠️ WARNING:** This is a destructive operation that cannot be undone. All documents, embeddings, metadata,
and index configurations will be permanently deleted. Data recovery is not possible after deletion.

### Parameters

- `vectorStoreName string`

  The name of the vector store

### Returns

- `type VectorStoreDropResponse struct{…}`

  Response for vector store deletion.

  - `Name string`

    The name of the deleted vector store

### Example

```go
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"),
  )
  response, err := client.VectorStores.Drop(context.TODO(), "vector_store_name")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Name)
}
```

#### Response

```json
{
  "name": "name"
}
```

## Upsert Vectors

`client.VectorStores.Upsert(ctx, vectorStoreName, body) (*VectorStoreUpsertResponse, error)`

**post** `/v5/vector-stores/{vector_store_name}/upsert`

Insert new documents or update existing documents in a vector store.

**Upsert Behavior:** If a document ID already exists, it will be completely replaced with the new content
and metadata. The previous document's text, embedding, and all metadata fields are discarded. If the ID
does not exist, a new document is created.

**Document Content:** Each document supports several modes:

- `content` only: text is automatically embedded using the store's configured model.
- `embedding` only: pre-computed embedding vector is used directly. Dimension must match the store's configuration.
- Both `content` and `embedding`: the pre-computed embedding is stored and text is kept for retrieval/search.
- Neither (metadata-only): only metadata is updated on an existing document without re-embedding.
  If the document does not exist, it will appear as a failure in the batch response.

A store created without an embedding model (dimensions-only) only accepts documents with pre-computed `embedding`.

**Batch Operations:** This endpoint supports batch operations with partial success handling and mixed
document types (some with raw embeddings, some with content) in the same call.

**Metadata:** Supports nested metadata with string, number, boolean, object, and array types. Null values
are not permitted—omit the field or use an empty string instead.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `body VectorStoreUpsertParams`

  - `Vectors param.Field[[]VectorStoreUpsertParamsVector]`

    Array of documents to upsert

    - `ID string`

      Unique document ID

    - `Content TextContent`

      Text content for documents.

      - `Text string`

        Text content to be embedded

      - `Type TextContentType`

        Content type identifier

        - `const TextContentTypeText TextContentType = "text"`

    - `Embedding []float64`

      Pre-computed embedding vector

    - `Metadata map[string, any]`

      Key-value metadata

### Returns

- `type VectorStoreUpsertResponse struct{…}`

  Response for batch insert/upsert operations.

  - `FailureCount int64`

    Number of failed documents

  - `SuccessCount int64`

    Number of successfully processed documents

  - `Failed []VectorStoreUpsertResponseFailed`

    Failed documents with their error messages

    - `ID string`

      Document ID

    - `Error string`

      Error message describing why the document failed

  - `Succeeded []string`

    IDs of successfully processed documents

### Example

```go
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"),
  )
  response, err := client.VectorStores.Upsert(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreUpsertParams{
      Vectors: []sgpdev.VectorStoreUpsertParamsVector{sgpdev.VectorStoreUpsertParamsVector{
        ID: "id",
      }},
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.FailureCount)
}
```

#### Response

```json
{
  "failure_count": 0,
  "success_count": 0,
  "failed": [
    {
      "id": "id",
      "error": "error"
    }
  ],
  "succeeded": [
    "string"
  ]
}
```

## Delete Vectors

`client.VectorStores.Delete(ctx, vectorStoreName, body) (*VectorStoreDeleteResponse, error)`

**post** `/v5/vector-stores/{vector_store_name}/delete`

Delete documents from a vector store by document IDs or metadata filter criteria.

**Delete by IDs:** Provide an array of document IDs to delete specific documents. Non-existent documents
are silently skipped.

**Delete by Filter:** Use metadata filters to delete all documents matching the specified criteria (e.g.,
delete all documents where `status: "archived"`). The filter must specify at least one condition and cannot
be empty. To delete all documents, use the drop endpoint instead.

**Filter Operators:** Supports MongoDB-style operators including equality (`{"field": "value"}`),
comparison (`$gt`, `$gte`, `$lt`, `$lte`, `$eq`, `$ne`), logical (`$and`, `$or`, `$not`),
and membership (`$in`, `$nin`). Only indexed metadata fields can be used for filtering.

**Best Practice:** Use the count endpoint with the same filter to preview the number of documents that
will be deleted before executing the deletion operation.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `body VectorStoreDeleteParams`

  - `Filter param.Field[map[string, any]]`

    Metadata filter expression for deletion

  - `IDs param.Field[[]string]`

    Array of document IDs to delete

### Returns

- `type VectorStoreDeleteResponse struct{…}`

  Response for delete operation.

  - `DeletedCount int64`

    Number of documents deleted

### Example

```go
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"),
  )
  vectorStore, err := client.VectorStores.Delete(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreDeleteParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStore.DeletedCount)
}
```

#### Response

```json
{
  "deleted_count": 0
}
```

## Count Vectors

`client.VectorStores.Count(ctx, vectorStoreName, body) (*VectorStoreCountResponse, error)`

**post** `/v5/vector-stores/{vector_store_name}/count`

Count documents in a vector store, optionally filtered by metadata.

**Use Cases:**

- Monitor vector store size and growth over time
- Preview the number of documents matching a filter before deletion
- Validate data ingestion by comparing expected versus actual document counts
- Analyze document distribution across metadata categories

**Filtering:** Apply the same metadata filter syntax as delete and list operations. Only indexed fields
can be used for filtering. An empty filter counts all documents in the store.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `body VectorStoreCountParams`

  - `Filter param.Field[map[string, any]]`

    Metadata filter expression

### Returns

- `type VectorStoreCountResponse struct{…}`

  Response for count operation.

  - `Count int64`

    Number of documents matching the criteria

### Example

```go
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"),
  )
  response, err := client.VectorStores.Count(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreCountParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Count)
}
```

#### Response

```json
{
  "count": 0
}
```

## Query Vectors

`client.VectorStores.Query(ctx, vectorStoreName, body) (*VectorStoreQueryResponse, error)`

**post** `/v5/vector-stores/{vector_store_name}/query`

Query documents using similarity search with optional reranking.

Primary endpoint for semantic search, question-answering, and RAG (Retrieval-Augmented Generation)
applications. Returns documents ranked by relevance to the query text with similarity scores.

**Query Types:**

- `semantic` (default): Approximate nearest-neighbor search using HNSW over cosine similarity of document embeddings. Optimal for question-answering, conceptual search,
  and finding semantically related content without requiring exact keyword matches.
- `lexical`: Keyword-based text search (BM25 algorithm). Optimal for exact phrase matching, proper nouns,
  and scenarios where keyword presence is more important than semantic similarity.
- `hybrid`: Combines semantic and lexical approaches with weighted scoring. Provides maximum recall by
  identifying documents matching either semantically or lexically.

**Metadata Filtering:** Narrow the search scope by applying metadata filters (e.g., search only documents
where `category: "technical"`). Only indexed fields can be used for filtering.
Filters are applied before similarity search for optimal efficiency.

**Reranking (Advanced):** Optionally enhance result quality using a cross-encoder reranking model.
The reranker rescores the initial results using a more sophisticated model that evaluates the complete
query-document pair (not solely embeddings). This adds 100-500ms latency but significantly improves
precision for high-stakes applications.

**Reranking Strategy:** Set `top_k` higher than the desired final count (e.g., 50) to retrieve more
candidates from the initial search. Then configure `rerank_top_n` to the desired final count (e.g., 10)
to return only the most relevant documents after reranking. This two-stage approach maximizes both recall
and precision.

**Performance Metrics:** The response includes detailed timing breakdowns (embedding generation time,
index query time, reranking time) to facilitate search pipeline optimization and latency analysis.

**Similarity Scores:** Each result includes a `score` field indicating relevance. Higher scores indicate
greater relevance. Score ranges and semantics vary by query type (semantic scores use cosine similarity,
lexical scores use BM25, hybrid scores combine both approaches).

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `body VectorStoreQueryParams`

  - `Content param.Field[TextContent]`

    Text content for documents.

  - `Filter param.Field[map[string, any]]`

    Metadata filter expression

  - `IncludeVectors param.Field[bool]`

    Include embedding vectors in response

  - `QueryType param.Field[VectorStoreQueryParamsQueryType]`

    Query type: semantic, lexical, or hybrid

    - `const VectorStoreQueryParamsQueryTypeSemantic VectorStoreQueryParamsQueryType = "semantic"`

    - `const VectorStoreQueryParamsQueryTypeLexical VectorStoreQueryParamsQueryType = "lexical"`

    - `const VectorStoreQueryParamsQueryTypeHybrid VectorStoreQueryParamsQueryType = "hybrid"`

  - `Rerank param.Field[bool]`

    [Deprecated: use rerank_config] Enable reranking of search results

  - `RerankConfig param.Field[VectorStoreQueryParamsRerankConfig]`

    Reranking configuration. Presence enables reranking; omit to disable. Pass an empty object ({}) to enable reranking with system defaults.

    - `Instruction string`

      Custom instruction for the reranking model (e.g., 'Given a medical question, retrieve relevant clinical passages'). Only applies to instruction-following rerankers like Qwen3.

    - `Model string`

      Reranking model to use (uses system default if not specified). Supported values depend on the selected provider: Launch cross-encoder names (e.g. 'cross-encoder/ms-marco-MiniLM-L-12-v2'), Vertex semantic-ranker names (e.g. 'semantic-ranker-default-004') when provider='vertex', or any model id the inference proxy serves when provider='proxy'.

    - `Provider string`

      Reranking provider to use. When omitted, the deployment default is used ('launch', or 'proxy' on ray-serve deployments configured for the OpenAI-compatible inference proxy). Set explicitly (e.g. 'vertex') to route to a specific provider on a deployment that has more than one configured. Requesting a provider that is not configured on the deployment returns a 400.

      - `const VectorStoreQueryParamsRerankConfigProviderLaunch VectorStoreQueryParamsRerankConfigProvider = "launch"`

      - `const VectorStoreQueryParamsRerankConfigProviderVertex VectorStoreQueryParamsRerankConfigProvider = "vertex"`

      - `const VectorStoreQueryParamsRerankConfigProviderProxy VectorStoreQueryParamsRerankConfigProvider = "proxy"`

    - `TopN int64`

      Number of results to keep after reranking (defaults to top_k)

    - `Type string`

      Reranking configuration type. Currently only 'base' is supported.

      - `const VectorStoreQueryParamsRerankConfigTypeBase VectorStoreQueryParamsRerankConfigType = "base"`

  - `RerankInstruction param.Field[string]`

    [Deprecated: use rerank_config.instruction] Custom instruction for reranker

  - `RerankModel param.Field[string]`

    [Deprecated: use rerank_config.model] Reranking model to use

  - `RerankTopN param.Field[int64]`

    [Deprecated: use rerank_config.top_n] Number of results after reranking

  - `TopK param.Field[int64]`

    Number of search results to return

### Returns

- `type VectorStoreQueryResponse struct{…}`

  Response for query operation.

  - `Metadata VectorStoreQueryResponseMetadata`

    Query execution metadata

    - `SearchType string`

      Type of search performed (semantic, lexical, hybrid)

    - `TotalQueryTimeMs int64`

      Total end-to-end query execution time in milliseconds

    - `EmbeddingConfig EmbeddingConfigUnion`

      Embedding configuration used for query vectorization. None for lexical queries on model-less stores.

      - `type EmbeddingConfigModelsAPI struct{…}`

        - `ModelDeploymentID string`

          The ID of the deployment of the created model in the Models API V3.

        - `Type ModelsAPI`

          The type of the embedding configuration.

          - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

      - `type EmbeddingConfigBase struct{…}`

        - `EmbeddingModel EmbeddingModelName`

          The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

          - `type EmbeddingModelName string`

            - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

            - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

            - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

            - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

            - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

            - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

            - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

            - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

            - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

            - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

            - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

          - `string`

        - `Type EmbeddingConfigBaseType`

          The type of the embedding configuration.

          - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

    - `EmbeddingTimeMs int64`

      Time spent generating embeddings in milliseconds (None for lexical queries)

    - `IndexQueryTimeMs int64`

      Time spent querying the vector index (OpenSearch) in milliseconds

    - `RerankingModel string`

      Reranking model used (None if reranking not enabled)

    - `RerankingTimeMs int64`

      Time spent reranking results in milliseconds (None if reranking not enabled)

  - `Vectors []VectorStoreQueryResponseVector`

    Array of matching documents

    - `ID string`

      Document ID

    - `Score float64`

      Similarity score indicating relevance

    - `Content TextContent`

      Text content for documents.

      - `Text string`

        Text content to be embedded

      - `Type TextContentType`

        Content type identifier

        - `const TextContentTypeText TextContentType = "text"`

    - `Metadata map[string, any]`

      Key-value metadata

    - `Vector []float64`

      Embedding vector (if requested)

### Example

```go
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"),
  )
  response, err := client.VectorStores.Query(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreQueryParams{
      Content: sgpdev.TextContentParam{
        Text: "text",
      },
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Metadata)
}
```

#### Response

```json
{
  "metadata": {
    "search_type": "search_type",
    "total_query_time_ms": 0,
    "embedding_config": {
      "model_deployment_id": "model_deployment_id",
      "type": "models_api"
    },
    "embedding_time_ms": 0,
    "index_query_time_ms": 0,
    "reranking_model": "reranking_model",
    "reranking_time_ms": 0
  },
  "vectors": [
    {
      "id": "id",
      "score": 0,
      "content": {
        "text": "text",
        "type": "text"
      },
      "metadata": {
        "foo": "bar"
      },
      "vector": [
        0
      ]
    }
  ]
}
```

## Domain Types

### Embedding Config

- `type EmbeddingConfigUnion interface{…}`

  - `type EmbeddingConfigModelsAPI struct{…}`

    - `ModelDeploymentID string`

      The ID of the deployment of the created model in the Models API V3.

    - `Type ModelsAPI`

      The type of the embedding configuration.

      - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

  - `type EmbeddingConfigBase struct{…}`

    - `EmbeddingModel EmbeddingModelName`

      The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

      - `type EmbeddingModelName string`

        - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

        - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

        - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

        - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

        - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

        - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

        - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

        - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

        - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

        - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

        - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

      - `string`

    - `Type EmbeddingConfigBaseType`

      The type of the embedding configuration.

      - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

### Embedding Config Base

- `type EmbeddingConfigBase struct{…}`

  - `EmbeddingModel EmbeddingModelName`

    The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

    - `type EmbeddingModelName string`

      - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

      - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

      - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

      - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

      - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

      - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

      - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

      - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

      - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

      - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

      - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

    - `string`

  - `Type EmbeddingConfigBaseType`

    The type of the embedding configuration.

    - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

### Embedding Config Models API

- `type EmbeddingConfigModelsAPI struct{…}`

  - `ModelDeploymentID string`

    The ID of the deployment of the created model in the Models API V3.

  - `Type ModelsAPI`

    The type of the embedding configuration.

    - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

### Embedding Model Name

- `type EmbeddingModelName string`

  - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

  - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

  - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

  - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

  - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

  - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

  - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

  - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

  - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

  - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

  - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

### Text Content

- `type TextContent struct{…}`

  Text content for documents.

  - `Text string`

    Text content to be embedded

  - `Type TextContentType`

    Content type identifier

    - `const TextContentTypeText TextContentType = "text"`

### Vector Store

- `type VectorStore struct{…}`

  Response model for vector store operations.

  - `ID string`

    The unique identifier of the vector store

  - `CreatedAt Time`

    Timestamp of creation

  - `EmbeddingDimensions int64`

    Dimensionality of the embedding vectors

  - `Name string`

    The name of the vector store

  - `UpdatedAt Time`

    Timestamp of last update

  - `EmbeddingConfig EmbeddingConfigUnion`

    Embedding configuration identifying the model and its type. None for raw-embedding-only stores.

    - `type EmbeddingConfigModelsAPI struct{…}`

      - `ModelDeploymentID string`

        The ID of the deployment of the created model in the Models API V3.

      - `Type ModelsAPI`

        The type of the embedding configuration.

        - `const ModelsAPIModelsAPI ModelsAPI = "models_api"`

    - `type EmbeddingConfigBase struct{…}`

      - `EmbeddingModel EmbeddingModelName`

        The name of the base embedding model to use. Either a known base model (EmbeddingModelName) or, in ray-serve deployments with NATIVE_OPENAI_EMBEDDING_GATEWAY enabled, any model id served by the OpenAI-compatible inference proxy (e.g. 'nomic-embed-text-v1.5'). For fully custom deployments, use type 'models_api' with a model_deployment_id.

        - `type EmbeddingModelName string`

          - `const EmbeddingModelNameSentenceTransformersAllMiniLmL12V2 EmbeddingModelName = "sentence-transformers/all-MiniLM-L12-v2"`

          - `const EmbeddingModelNameSentenceTransformersMultiQaDistilbertCosV1 EmbeddingModelName = "sentence-transformers/multi-qa-distilbert-cos-v1"`

          - `const EmbeddingModelNameOpenAITextEmbeddingAda002 EmbeddingModelName = "openai/text-embedding-ada-002"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Small EmbeddingModelName = "openai/text-embedding-3-small"`

          - `const EmbeddingModelNameOpenAITextEmbedding3Large EmbeddingModelName = "openai/text-embedding-3-large"`

          - `const EmbeddingModelNameEmbedEnglishV3_0 EmbeddingModelName = "embed-english-v3.0"`

          - `const EmbeddingModelNameEmbedEnglishLightV3_0 EmbeddingModelName = "embed-english-light-v3.0"`

          - `const EmbeddingModelNameEmbedMultilingualV3_0 EmbeddingModelName = "embed-multilingual-v3.0"`

          - `const EmbeddingModelNameGeminiTextEmbedding005 EmbeddingModelName = "gemini/text-embedding-005"`

          - `const EmbeddingModelNameGeminiTextMultilingualEmbedding002 EmbeddingModelName = "gemini/text-multilingual-embedding-002"`

          - `const EmbeddingModelNameGeminiGeminiEmbedding001 EmbeddingModelName = "gemini/gemini-embedding-001"`

        - `string`

      - `Type EmbeddingConfigBaseType`

        The type of the embedding configuration.

        - `const EmbeddingConfigBaseTypeBase EmbeddingConfigBaseType = "base"`

  - `IndexedMetadataFields map[string, string]`

    Dictionary mapping metadata field names to their types

    - `const VectorStoreIndexedMetadataFieldString VectorStoreIndexedMetadataField = "string"`

    - `const VectorStoreIndexedMetadataFieldNumber VectorStoreIndexedMetadataField = "number"`

    - `const VectorStoreIndexedMetadataFieldBoolean VectorStoreIndexedMetadataField = "boolean"`

# Vectors

## List Vectors

`client.VectorStores.Vectors.List(ctx, vectorStoreName, query) (*CursorPageVectors[VectorDocument], error)`

**get** `/v5/vector-stores/{vector_store_name}/vectors`

List documents in a vector store with cursor-based pagination.

**Use Cases:** Browse documents, export content, audit stored data, or retrieve documents by metadata
without semantic search.

**Ordering:** Documents are returned in storage order (insertion order), not ranked by similarity.
For similarity-based retrieval, use the query endpoint.

**Filtering:** Apply metadata filters to narrow results to specific subsets (e.g., all documents
where `category: "research"`). Only indexed fields can be used for filtering.

**Pagination:** Uses cursor-based pagination for efficient traversal of large datasets. Pass the
`next_cursor` from each response as `starting_after` to retrieve the next page, or `prev_cursor`
as `ending_before` to retrieve the previous page. A null cursor indicates no further pages exist.

**Embedding Vectors:** Setting `include_vectors=true` includes the full embedding vector arrays in
the response. This significantly increases payload size and reduces the maximum page size from 1000 to
100 documents. Enable only when raw vectors are required for external processing.

### Parameters

- `vectorStoreName string`

  The name of the vector store

- `query VectorStoreVectorListParams`

  - `Cursor param.Field[string]`

    Alias for starting_after. Use starting_after instead.

  - `EndingBefore param.Field[string]`

  - `Filter param.Field[string]`

    Metadata filter expression (JSON)

  - `IncludeVectors param.Field[bool]`

    Include embedding vectors

  - `Limit param.Field[int64]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

### Returns

- `type VectorDocument struct{…}`

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

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)

### Example

```go
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"),
  )
  page, err := client.VectorStores.Vectors.List(
    context.TODO(),
    "vector_store_name",
    sgpdev.VectorStoreVectorListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "content": {
        "text": "text",
        "type": "text"
      },
      "metadata": {
        "foo": "bar"
      },
      "vector": [
        0
      ]
    }
  ],
  "total": 0,
  "vectors": [
    {
      "id": "id",
      "content": {
        "text": "text",
        "type": "text"
      },
      "metadata": {
        "foo": "bar"
      },
      "vector": [
        0
      ]
    }
  ],
  "limit": 0,
  "next_cursor": "next_cursor",
  "object": "list",
  "prev_cursor": "prev_cursor"
}
```

## 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.

### Parameters

- `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]`

    Query param: Include embedding vectors

### Returns

- `type VectorDocument struct{…}`

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

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)

### Example

```go
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)
}
```

#### Response

```json
{
  "id": "id",
  "content": {
    "text": "text",
    "type": "text"
  },
  "metadata": {
    "foo": "bar"
  },
  "vector": [
    0
  ]
}
```

## Domain Types

### Vector Document

- `type VectorDocument struct{…}`

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

  - `ID string`

    Document ID

  - `Content TextContent`

    Text content for documents.

    - `Text string`

      Text content to be embedded

    - `Type TextContentType`

      Content type identifier

      - `const TextContentTypeText TextContentType = "text"`

  - `Metadata map[string, any]`

    Key-value metadata

  - `Vector []float64`

    Embedding vector (if requested)
