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
| Method | Summary |
|---|---|
CreateAsync | Create a new embedder. |
GetAsync | Get an embedder by ID. |
ListAsync | List embedders. |
UpdateAsync | Update an embedder. |
DeleteAsync | Delete 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)
HTTP — POST /v1/embedders
Parameters
| Type | Name | Description |
|---|---|---|
EmbedderCreationRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
string | apiKey | Bare 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) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/embedders/{id}
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The unique identifier of the embedder to retrieve |
EmbeddersGetOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/embedders
Parameters
| Type | Name | Description |
|---|---|---|
EmbeddersListOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<ListEmbeddersResponse> — an awaitable that resolves to ListEmbeddersResponse.
Exceptions
| Type | Condition |
|---|---|
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — PUT /v1/embedders/{id}
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The unique identifier of the embedder to update |
UpdateEmbedderRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<EmbedderResponse> — an awaitable that resolves to EmbedderResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — DELETE /v1/embedders/{id}
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The unique identifier of the embedder to delete |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task — completes when the operation finishes; there is no response body.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
DisplayName | string | displayName | User-facing name of the embedder |
Description | string | description | Description of the embedder (optional) |
ProviderType | ProviderType | providerType | Type of embedding provider |
EndpointUrl | string | endpointUrl | Base HTTP(S) endpoint for provider requests. Gemini endpoint URLs must not contain query parameters. |
ApiPath | string | apiPath | Provider-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) |
ModelIdentifier | string | modelIdentifier | Model identifier |
Dimensionality | int | dimensionality | Output vector dimensions |
DistributionType | DistributionType | distributionType | Type of embedding distribution (DENSE or SPARSE) |
MaxSequenceLength | int | maxSequenceLength | Maximum input sequence length (optional) |
SupportedModalities | IReadOnlyList<Modality> | supportedModalities | Supported content modalities (defaults to TEXT if not provided) (optional) |
Credentials | EndpointAuthentication | credentials | Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. (optional) |
Labels | IReadOnlyDictionary<string, string> | labels | User-defined labels for categorization (optional) |
Version | string | version | Version information (optional) |
MonitoringEndpoint | string | monitoringEndpoint | Monitoring endpoint URL (optional) |
OwnerId | string | ownerId | Optional owner principal UUID. If omitted, defaults to the authenticated principal. CREATE_EMBEDDER is evaluated against the proposed embedder and owner. (optional) |
EmbedderId | string | embedderId | Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. (optional) |
DashscopeApiDialect | DashScopeApiDialect | dashscopeApiDialect | DashScope 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) |
GeminiEndpointConfig | GeminiEndpointConfig | geminiEndpointConfig | Gemini 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Backend | GeminiApiBackend | backend | Google API surface. UNSPECIFIED is invalid when this configuration is supplied on a write. |
ProjectId | string | projectId | Google Cloud resource project. Required for GOOGLE_CLOUD and unused for DEVELOPER; this is distinct from the ADC quota project. (optional) |
Location | string | location | Google 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
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
EmbedderId | string | embedderId | Unique identifier of the embedder |
DisplayName | string | displayName | User-facing name of the embedder |
Description | string | description | Description of the embedder (optional) |
ProviderType | ProviderType | providerType | Type of embedding provider |
EndpointUrl | string | endpointUrl | Canonical base HTTP(S) endpoint used for provider requests. |
ApiPath | string | apiPath | Configured provider-relative request path. For Gemini, this is the selected API version: /v1beta for Developer or /v1 for Google Cloud. (optional) |
ModelIdentifier | string | modelIdentifier | Model identifier |
Dimensionality | int | dimensionality | Output vector dimensions |
DistributionType | DistributionType | distributionType | Type of embedding distribution (DENSE or SPARSE) |
MaxSequenceLength | int | maxSequenceLength | Maximum input sequence length (optional) |
SupportedModalities | IReadOnlyList<Modality> | supportedModalities | Supported content modalities |
Credentials | EndpointAuthentication | credentials | Stored credentials; present only when GetEmbedder explicitly requests them and the caller has READ_EMBEDDER_CREDENTIALS. Always omitted from create, update, and list responses. (optional) |
Labels | IReadOnlyDictionary<string, string> | labels | User-defined labels for categorization |
Version | string | version | Version information (optional) |
MonitoringEndpoint | string | monitoringEndpoint | Monitoring endpoint URL (optional) |
OwnerId | string | ownerId | Owner ID of the embedder |
CreatedAt | DateTimeOffset | createdAt | Creation timestamp (milliseconds since epoch) |
UpdatedAt | DateTimeOffset | updatedAt | Last update timestamp (milliseconds since epoch) |
CreatedById | string | createdById | ID of the user who created the embedder |
UpdatedById | string | updatedById | ID of the user who last updated the embedder |
DashscopeApiDialect | DashScopeApiDialect | dashscopeApiDialect | Configured DashScope request and response API dialect; present only for DashScope configurations with a persisted dialect. (optional) |
GeminiEndpointConfig | GeminiEndpointConfig | geminiEndpointConfig | Persisted Gemini backend routing; present only for Gemini embedder resources. (optional) |
ListEmbeddersResponse
Response containing a list of embedders
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Embedders | IReadOnlyList<EmbedderResponse> | embedders | List 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
DisplayName | string | displayName | User-facing name of the embedder (optional) |
Description | string | description | Description of the embedder (optional) |
EndpointUrl | string | endpointUrl | Replacement base HTTP(S) endpoint. Omit to preserve the stored value. Gemini endpoint URLs must not contain query parameters. (optional) |
ApiPath | string | apiPath | Replacement 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) |
ModelIdentifier | string | modelIdentifier | Model identifier (optional) |
Dimensionality | int | dimensionality | Output vector dimensions (optional) |
DistributionType | DistributionType | distributionType | Type of embedding distribution (DENSE or SPARSE) (optional) |
MaxSequenceLength | int | maxSequenceLength | Maximum input sequence length (optional) |
Credentials | EndpointAuthentication | credentials | Replace stored credentials. Omit this field to preserve the current credentials; a present empty payload is invalid and never clears them. (optional) |
ReplaceLabels | IReadOnlyDictionary<string, string> | replaceLabels | Replace all existing labels with these (mutually exclusive with mergeLabels) (optional) |
MergeLabels | IReadOnlyDictionary<string, string> | mergeLabels | Merge these labels with existing ones (mutually exclusive with replaceLabels) (optional) |
Version | string | version | Version information (optional) |
MonitoringEndpoint | string | monitoringEndpoint | Monitoring endpoint URL (optional) |
DashscopeApiDialect | DashScopeApiDialect | dashscopeApiDialect | Update 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) |
GeminiEndpointConfig | GeminiEndpointConfig | geminiEndpointConfig | When 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) |