GoodMemGoodMem
ReferenceClient SDKs.NET

Embedders

.NET SDK reference for embedder configurations: creation, lookup, listing, updates, and deletion.

Embedder management — provider configuration + lifecycle.

Namespace: Goodmem.Client.Api · Class: EmbeddersApi

Reach this surface as client.Embedders on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.

Methods

MethodSummary
CreateAsyncCreate a new embedder.
GetAsyncGet an embedder by ID.
ListAsyncList embedders.
UpdateAsyncUpdate an embedder.
DeleteAsyncDelete an embedder.

CreateAsync

Creates an embedder configuration for use with memory spaces. If ownerId is omitted, the authenticated principal becomes the owner; CREATE_EMBEDDER is evaluated against that proposed embedder and owner. Returns 409 when an equivalent embedder configuration already exists for the owner. See the embedder provider guide for provider-specific configuration.

Declaration

public Task<EmbedderResponse> CreateAsync(EmbedderCreationRequest request, string? apiKey = null, CancellationToken ct = default)

HTTPPOST /v1/embedders

Parameters

TypeNameDescription
EmbedderCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
stringapiKeyBare provider API key. The convenience layer auto-fills provider / endpoint / dimensionality from the bundled model registry and converts the key to structured credentials. Pass null to keep any credentials already set on request. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var embedder = await client.Embedders.CreateAsync(
    new EmbedderCreationRequest
    {
        DisplayName = "Doc Embedder",
        ModelIdentifier = "text-embedding-3-small",
        Labels = new Dictionary<string, string> { ["env"] = "docs" },
    },
    "sk-..."
);
Console.WriteLine(embedder.EmbedderId);


GetAsync

Retrieves the details of a specific embedder configuration by its unique identifier. Requires READ_EMBEDDER on the requested embedder. The service distinguishes a missing embedder from an existing embedder the caller cannot read. This is a read-only operation with no side effects.

Declaration

public Task<EmbedderResponse> GetAsync(string id, EmbeddersGetOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to retrieve
EmbeddersGetOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var embedder = await client.Embedders.GetAsync("your-embedder-id");
Console.WriteLine(embedder.DisplayName);


ListAsync

Retrieves a list of embedder configurations accessible to the caller, with optional filtering.

LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).

AUTHORIZATION: Requires LIST_EMBEDDER on the GoodMem instance. Each returned embedder must also be visible through READ_EMBEDDER; unauthorized embedders are filtered in PostgreSQL. The ownerId parameter filters that already-authorized result set and does not grant additional visibility. This is a read-only operation with no side effects.

Declaration

public Task<ListEmbeddersResponse> ListAsync(EmbeddersListOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/embedders

Parameters

TypeNameDescription
EmbeddersListOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<ListEmbeddersResponse> — an awaitable that resolves to ListEmbeddersResponse.

Exceptions

TypeCondition
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var resp = await client.Embedders.ListAsync();
foreach (var embedder in resp.Embedders)
    Console.WriteLine($"{embedder.EmbedderId} {embedder.DisplayName}");


UpdateAsync

Updates explicitly supplied embedder fields; at least one mutable field is required. Field omission and reset semantics are defined by the request schema, and providerType cannot be changed. Returns 409 if the resulting configuration duplicates another embedder for the owner, and 412 when model-defining fields are changed while the embedder is in use. Requires UPDATE_EMBEDDER on the requested embedder. See the embedder provider guide for provider-specific configuration.

Declaration

public Task<EmbedderResponse> UpdateAsync(string id, UpdateEmbedderRequest request, CancellationToken ct = default)

HTTPPUT /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to update
UpdateEmbedderRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var updated = await client.Embedders.UpdateAsync(
    "your-embedder-id",
    new UpdateEmbedderRequest
    {
        DisplayName = "Doc Embedder (updated)",
        MergeLabels = new Dictionary<string, string> { ["version"] = "2" },
    }
);
Console.WriteLine(updated.EmbedderId);


DeleteAsync

Permanently deletes an embedder configuration. This operation cannot be undone and removes the embedder record and securely deletes stored credentials.

IMPORTANT: This does NOT invalidate or delete embeddings previously created with this embedder - existing embeddings remain accessible.

CONFLICT: Returns HTTP 409 Conflict if the embedder is still referenced by a space. Requires DELETE_EMBEDDER on the requested embedder.

Declaration

public Task DeleteAsync(string id, CancellationToken ct = default)

HTTPDELETE /v1/embedders/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe unique identifier of the embedder to delete
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task — completes when the operation finishes; there is no response body.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

await client.Embedders.DeleteAsync("your-embedder-id");


Data Models

Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.

EmbedderCreationRequest

Request body for creating a new Embedder. An Embedder represents a configuration for vectorizing content.

PropertyTypeJSON (wire)Description
DisplayNamestringdisplayNameUser-facing name of the embedder
DescriptionstringdescriptionDescription of the embedder (optional)
ProviderTypeProviderTypeproviderTypeType of embedding provider
EndpointUrlstringendpointUrlBase HTTP(S) endpoint for provider requests. Gemini endpoint URLs must not contain query parameters.
ApiPathstringapiPathProvider-relative request path. Omit or send blank to use the provider default. For Gemini, this is an API version: /v1beta for Developer and /v1 for Google Cloud. (optional)
ModelIdentifierstringmodelIdentifierModel identifier
DimensionalityintdimensionalityOutput vector dimensions
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
SupportedModalitiesIReadOnlyList<Modality>supportedModalitiesSupported content modalities (defaults to TEXT if not provided) (optional)
CredentialsEndpointAuthenticationcredentialsStructured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. (optional)
LabelsIReadOnlyDictionary<string, string>labelsUser-defined labels for categorization (optional)
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)
OwnerIdstringownerIdOptional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_EMBEDDER is evaluated against the proposed embedder and owner. (optional)
EmbedderIdstringembedderIdOptional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. (optional)
DashscopeApiDialectDashScopeApiDialectdashscopeApiDialectDashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to infer the dialect from apiPath, the model catalog, or the native text default. (optional)
GeminiEndpointConfigGeminiEndpointConfiggeminiEndpointConfigGemini backend routing. Valid only for the GEMINI provider. Omit to use the Developer API; when present, backend is required and the gRPC service validates the backend-specific projectId and location contract. (optional)

DistributionType

Type of embedding distribution produced by the embedder

String enum: "DENSE" · "SPARSE"

GeminiEndpointConfig

Gemini backend routing. DEVELOPER does not use projectId or location; GOOGLE_CLOUD requires projectId and defaults an omitted location to global.

PropertyTypeJSON (wire)Description
BackendGeminiApiBackendbackendGoogle API surface. UNSPECIFIED is invalid when this configuration is supplied on a write.
ProjectIdstringprojectIdGoogle Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project. (optional)
LocationstringlocationGoogle Cloud location. Valid only for GOOGLE_CLOUD; omission defaults to global. (optional)

GeminiApiBackend

Google API surface used by a Gemini embedder

String enum: "UNSPECIFIED" · "DEVELOPER" · "GOOGLE_CLOUD"

EmbedderResponse

Embedder configuration information

PropertyTypeJSON (wire)Description
EmbedderIdstringembedderIdUnique identifier of the embedder
DisplayNamestringdisplayNameUser-facing name of the embedder
DescriptionstringdescriptionDescription of the embedder (optional)
ProviderTypeProviderTypeproviderTypeType of embedding provider
EndpointUrlstringendpointUrlCanonical base HTTP(S) endpoint used for provider requests.
ApiPathstringapiPathConfigured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud. (optional)
ModelIdentifierstringmodelIdentifierModel identifier
DimensionalityintdimensionalityOutput vector dimensions
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
SupportedModalitiesIReadOnlyList<Modality>supportedModalitiesSupported content modalities
CredentialsEndpointAuthenticationcredentialsStored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses. (optional)
LabelsIReadOnlyDictionary<string, string>labelsUser-defined labels for categorization
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)
OwnerIdstringownerIdOwner ID of the embedder
CreatedAtDateTimeOffsetcreatedAtCreation timestamp (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtLast update timestamp (milliseconds since epoch)
CreatedByIdstringcreatedByIdID of the user who created the embedder
UpdatedByIdstringupdatedByIdID of the user who last updated the embedder
DashscopeApiDialectDashScopeApiDialectdashscopeApiDialectConfigured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect. (optional)
GeminiEndpointConfigGeminiEndpointConfiggeminiEndpointConfigPersisted Gemini backend routing; present only for Gemini embedder resources. (optional)

ListEmbeddersResponse

Response containing a list of embedders

PropertyTypeJSON (wire)Description
EmbeddersIReadOnlyList<EmbedderResponse>embeddersList of embedder configurations

UpdateEmbedderRequest

Request body for updating an existing Embedder. Only fields that should be updated need to be included. supportedModalities is creation-time only and cannot be changed here.

PropertyTypeJSON (wire)Description
DisplayNamestringdisplayNameUser-facing name of the embedder (optional)
DescriptionstringdescriptionDescription of the embedder (optional)
EndpointUrlstringendpointUrlReplacement base HTTP(S) endpoint. Omit to preserve the stored value. Gemini endpoint URLs must not contain query parameters. (optional)
ApiPathstringapiPathReplacement provider-relative request path. Omit to preserve the stored value, except that changing the Gemini backend without apiPath selects that backend's default; send blank to restore the provider default. For Gemini, this is an API version: /v1beta for Developer and /v1 for Google Cloud. (optional)
ModelIdentifierstringmodelIdentifierModel identifier (optional)
DimensionalityintdimensionalityOutput vector dimensions (optional)
DistributionTypeDistributionTypedistributionTypeType of embedding distribution (DENSE or SPARSE) (optional)
MaxSequenceLengthintmaxSequenceLengthMaximum input sequence length (optional)
CredentialsEndpointAuthenticationcredentialsReplace stored credentials. Omit this field to preserve the current credentials; a present empty payload is invalid and never clears them. (optional)
ReplaceLabelsIReadOnlyDictionary<string, string>replaceLabelsReplace all existing labels with these (mutually exclusive with mergeLabels) (optional)
MergeLabelsIReadOnlyDictionary<string, string>mergeLabelsMerge these labels with existing ones (mutually exclusive with replaceLabels) (optional)
VersionstringversionVersion information (optional)
MonitoringEndpointstringmonitoringEndpointMonitoring endpoint URL (optional)
DashscopeApiDialectDashScopeApiDialectdashscopeApiDialectUpdate the DashScope request and response API dialect. Valid only for the DASHSCOPE provider. Omit to preserve the stored dialect. Changing apiPath to a recognized canonical DashScope dialect infers its matching dialect; a custom path preserves an existing dialect, while a legacy null dialect is inferred. (optional)
GeminiEndpointConfigGeminiEndpointConfiggeminiEndpointConfigWhen present, atomically replaces the complete Gemini backend routing configuration. Valid only for a GEMINI embedder. Omit to preserve the stored configuration; the gRPC service validates the backend-specific projectId and location contract. (optional)