/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmModelsActivateRegistryEntry } from "../funcs/llmModelsActivateRegistryEntry.js"; import { llmModelsAddCatalogEntry } from "../funcs/llmModelsAddCatalogEntry.js"; import { llmModelsAddCatalogOrgAccess } from "../funcs/llmModelsAddCatalogOrgAccess.js"; import { llmModelsCheckCatalogHealth } from "../funcs/llmModelsCheckCatalogHealth.js"; import { llmModelsClearClusterPrice } from "../funcs/llmModelsClearClusterPrice.js"; import { llmModelsClearOrgPrice } from "../funcs/llmModelsClearOrgPrice.js"; import { llmModelsDeactivateRegistryEntry } from "../funcs/llmModelsDeactivateRegistryEntry.js"; import { llmModelsDeleteCatalogEntry } from "../funcs/llmModelsDeleteCatalogEntry.js"; import { llmModelsDeleteOrgAutoModel } from "../funcs/llmModelsDeleteOrgAutoModel.js"; import { llmModelsGet } from "../funcs/llmModelsGet.js"; import { llmModelsGetClusterCurrency } from "../funcs/llmModelsGetClusterCurrency.js"; import { llmModelsList } from "../funcs/llmModelsList.js"; import { llmModelsListCatalog } from "../funcs/llmModelsListCatalog.js"; import { llmModelsListCatalogModelAccess } from "../funcs/llmModelsListCatalogModelAccess.js"; import { llmModelsListCatalogOrgAccess } from "../funcs/llmModelsListCatalogOrgAccess.js"; import { llmModelsListClusterPrices } from "../funcs/llmModelsListClusterPrices.js"; import { llmModelsListEffectivePrices } from "../funcs/llmModelsListEffectivePrices.js"; import { llmModelsListOrgAutoModels } from "../funcs/llmModelsListOrgAutoModels.js"; import { llmModelsListOrgPrices } from "../funcs/llmModelsListOrgPrices.js"; import { llmModelsListRegistry } from "../funcs/llmModelsListRegistry.js"; import { llmModelsPutOrgAutoModel } from "../funcs/llmModelsPutOrgAutoModel.js"; import { llmModelsReplaceCatalogOrgAccess } from "../funcs/llmModelsReplaceCatalogOrgAccess.js"; import { llmModelsSetClusterCurrency } from "../funcs/llmModelsSetClusterCurrency.js"; import { llmModelsSetClusterPrice } from "../funcs/llmModelsSetClusterPrice.js"; import { llmModelsSetOrgPrice } from "../funcs/llmModelsSetOrgPrice.js"; import { llmModelsUpdateCatalogEntry } from "../funcs/llmModelsUpdateCatalogEntry.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Models extends ClientSDK { /** * List available models * * @remarks * Lists the currently available models. Provides basic information about each model including its ID and owner. */ async list( request: operations.ListModelsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsList( this, request, options, )); } /** * Retrieve a model * * @remarks * Retrieves a model instance, providing basic information about the model such as the owner and supported capabilities. */ async get( request: operations.GetModelRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsGet( this, request, options, )); } /** * List the organization's model catalog * * @remarks * Lists all BYO, serving, and cluster-access definitions with activation state, blocker, health, and price preview. */ async listCatalog( options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListCatalog( this, options, )); } /** * Define a BYO catalog model * * @remarks * Creates an API-owned BYO definition without activating its name. */ async addCatalogEntry( request: components.AddCatalogModelRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsAddCatalogEntry( this, request, options, )); } /** * Update a BYO catalog model * * @remarks * Updates an API-owned BYO definition; yaml-origin entries are file-managed and immutable through this API. */ async updateCatalogEntry( request: components.UpdateCatalogModelRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsUpdateCatalogEntry( this, request, options, )); } /** * Remove a BYO catalog model * * @remarks * Withdraws a BYO definition and deactivates it only when the active name is sourced from that BYO lineage. */ async deleteCatalogEntry( request: operations.DeleteModelCatalogEntryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsDeleteCatalogEntry( this, request, options, )); } /** * Check a BYO catalog model's health * * @remarks * Probes an available BYO definition whether or not it is active. */ async checkCatalogHealth( request: operations.CheckModelCatalogHealthRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsCheckCatalogHealth( this, request, options, )); } /** * List an organization's cluster model access * * @remarks * Cluster operator view of an org's available cluster catalog entries and their activation state. */ async listCatalogOrgAccess( request: operations.ListModelCatalogOrgAccessRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListCatalogOrgAccess( this, request, options, )); } /** * Add cluster model access for an organization * * @remarks * Idempotently adds availability without activating or revoking any model names. */ async addCatalogOrgAccess( request: operations.AddModelCatalogOrgAccessRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsAddCatalogOrgAccess( this, request, options, )); } /** * Replace an organization's cluster model access * * @remarks * Serializable full replacement; revoked active cluster names are deactivated and their org price rows are closed. */ async replaceCatalogOrgAccess( request: operations.ReplaceModelCatalogOrgAccessRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsReplaceCatalogOrgAccess( this, request, options, )); } /** * List organizations with access to a cluster model * * @remarks * Cluster operator reverse lookup showing availability and activation for one cluster catalog id. */ async listCatalogModelAccess( request: operations.ListModelCatalogAccessRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListCatalogModelAccess( this, request, options, )); } /** * List the organization's active model registry * * @remarks * Single management view of every active name with source-qualified definition, health, price, and activation audit details. */ async listRegistry( options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListRegistry( this, options, )); } /** * Activate a catalog entry * * @remarks * Claims a model name from one catalog source. Re-activation from the same source is idempotent; a different holder returns 409. */ async activateRegistryEntry( request: components.ActivateRegistryEntryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsActivateRegistryEntry( this, request, options, )); } /** * Deactivate a model registry name * * @remarks * Idempotently removes the active name and closes its org-scope price rows without touching the catalog definition. */ async deactivateRegistryEntry( request: operations.DeactivateModelRegistryEntryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsDeactivateRegistryEntry( this, request, options, )); } /** * List this org's auto-model overrides * * @remarks * Returns every endpoint for which this org has set its own `"auto"` target. Endpoints not listed fall through to the operator's YAML defaults. */ async listOrgAutoModels( options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListOrgAutoModels( this, options, )); } /** * Set this org's auto-model override for an endpoint * * @remarks * Stores `{ endpoint → modelId }` so subsequent requests with `model: "auto"` for the endpoint resolve to `modelId` instead of the operator's YAML default. The target must (a) not be the literal string `"auto"`, (b) be active in this org's model registry, and (c) have the same `apiFormat` as the endpoint. */ async putOrgAutoModel( request: operations.PutOrgAutoModelRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsPutOrgAutoModel( this, request, options, )); } /** * Clear this org's auto-model override for an endpoint * * @remarks * Removes the per-org override for the endpoint. Subsequent `model: "auto"` requests fall through to the operator's YAML default again. */ async deleteOrgAutoModel( request: operations.DeleteOrgAutoModelRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsDeleteOrgAutoModel( this, request, options, )); } /** * Get the cluster currency * * @remarks * Returns the single cluster-wide ISO-4217 currency code (null if not set). */ async getClusterCurrency( options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsGetClusterCurrency( this, options, )); } /** * Set the cluster currency * * @remarks * Sets the cluster-wide currency. Changing it does not auto-convert existing prices. */ async setClusterCurrency( request: components.PutClusterCurrencyBody, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsSetClusterCurrency( this, request, options, )); } /** * List cluster-default model prices * * @remarks * Without `model`, lists every model's current cluster-default price. With `model`, returns that model's full dated history. */ async listClusterPrices( request: operations.ListClusterPricesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListClusterPrices( this, request, options, )); } /** * Set a cluster-default model price * * @remarks * Upserts the cluster-default price for a model as a new dated version. `rates` is a flexible metric→rate map; omitted metrics are not charged. */ async setClusterPrice( request: components.PutModelPriceBody, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsSetClusterPrice( this, request, options, )); } /** * Clear a cluster-default model price * * @remarks * Closes the cluster-default price. Active cluster lineage then uses an org override or becomes unpriced ($0). */ async clearClusterPrice( request: operations.ClearClusterPriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsClearClusterPrice( this, request, options, )); } /** * List an org's price overrides * * @remarks * Without `model`, lists the org's current overrides. With `model`, returns that override's dated history. */ async listOrgPrices( request: operations.ListOrgPricesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListOrgPrices( this, request, options, )); } /** * Set an org price override * * @remarks * Upserts a dated per-org price. Cluster lineage falls back to the cluster default; BYO and serving lineage become unpriced when no org row exists. */ async setOrgPrice( request: operations.SetOrgPriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsSetOrgPrice( this, request, options, )); } /** * Clear an org price override * * @remarks * Closes a per-org price. Only active cluster lineage can then fall back to the cluster default. */ async clearOrgPrice( request: operations.ClearOrgPriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsClearOrgPrice( this, request, options, )); } /** * List effective prices for the caller's models * * @remarks * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). */ async listEffectivePrices( request: operations.ListEffectivePricesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmModelsListEffectivePrices( this, request, options, )); } }