Skip to content

Llm.Models ​

Overview ​

Available Operations ​

list ​

Lists the currently available models. Provides basic information about each model including its ID and owner.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.list({});

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsList } from "@meetkai/mka1/funcs/llmModelsList.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsList(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsList failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsList,
  useLlmModelsListSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsList,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsList,
  invalidateAllLlmModelsList,
} from "@meetkai/mka1/react-query/llmModelsList.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListModelsRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<operations.ListModelsResponseBody>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

get ​

Retrieves a model instance, providing basic information about the model such as the owner and supported capabilities.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.get({
    modelId: "meetkai:functionary-urdu-mini-pak",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsGet } from "@meetkai/mka1/funcs/llmModelsGet.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsGet(sdk, {
    modelId: "meetkai:functionary-urdu-mini-pak",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsGet failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsGet,
  useLlmModelsGetSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsGet,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsGet,
  invalidateAllLlmModelsGet,
} from "@meetkai/mka1/react-query/llmModelsGet.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.GetModelRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<operations.GetModelResponseBody>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listCatalog ​

Lists all BYO, serving, and cluster-access definitions with activation state, blocker, health, and price preview.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listCatalog();

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListCatalog } from "@meetkai/mka1/funcs/llmModelsListCatalog.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListCatalog(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListCatalog failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListCatalog,
  useLlmModelsListCatalogSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListCatalog,
  
  // Utility to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAllLlmModelsListCatalog,
} from "@meetkai/mka1/react-query/llmModelsListCatalog.js";

Parameters ​

ParameterTypeRequiredDescription
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.CatalogListResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

addCatalogEntry ​

Creates an API-owned BYO definition without activating its name.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.addCatalogEntry({
    id: "meetkai:custom-chat-v1",
    provider: "openai-compatible",
    modelId: "custom-chat-v1",
    displayName: "Custom Chat v1",
    baseUrl: "https://models.example.com/v1",
    apiFormat: "responses",
    apiProviderType: "openai",
    created: 1704067200,
    auth: {
      type: "api-key",
      value: "sk-provider-key",
    },
    capabilities: {
      modalities: {
        input: [
          "text",
        ],
        output: [
          "text",
        ],
      },
      reasoning: true,
    },
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsAddCatalogEntry } from "@meetkai/mka1/funcs/llmModelsAddCatalogEntry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsAddCatalogEntry(sdk, {
    id: "meetkai:custom-chat-v1",
    provider: "openai-compatible",
    modelId: "custom-chat-v1",
    displayName: "Custom Chat v1",
    baseUrl: "https://models.example.com/v1",
    apiFormat: "responses",
    apiProviderType: "openai",
    created: 1704067200,
    auth: {
      type: "api-key",
      value: "sk-provider-key",
    },
    capabilities: {
      modalities: {
        input: [
          "text",
        ],
        output: [
          "text",
        ],
      },
      reasoning: true,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsAddCatalogEntry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsAddCatalogEntryMutation
} from "@meetkai/mka1/react-query/llmModelsAddCatalogEntry.js";

Parameters ​

ParameterTypeRequiredDescription
requestcomponents.AddCatalogModelRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.CatalogEntry>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

updateCatalogEntry ​

Updates an API-owned BYO definition; yaml-origin entries are file-managed and immutable through this API.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.updateCatalogEntry({
    displayName: "Custom Chat v2",
    rpm: 240,
    id: "meetkai:custom-chat-v1",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsUpdateCatalogEntry } from "@meetkai/mka1/funcs/llmModelsUpdateCatalogEntry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsUpdateCatalogEntry(sdk, {
    displayName: "Custom Chat v2",
    rpm: 240,
    id: "meetkai:custom-chat-v1",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsUpdateCatalogEntry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsUpdateCatalogEntryMutation
} from "@meetkai/mka1/react-query/llmModelsUpdateCatalogEntry.js";

Parameters ​

ParameterTypeRequiredDescription
requestcomponents.UpdateCatalogModelRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.CatalogEntry>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

deleteCatalogEntry ​

Withdraws a BYO definition and deactivates it only when the active name is sourced from that BYO lineage.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.deleteCatalogEntry({
    id: "meetkai:custom-chat-v1",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsDeleteCatalogEntry } from "@meetkai/mka1/funcs/llmModelsDeleteCatalogEntry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsDeleteCatalogEntry(sdk, {
    id: "meetkai:custom-chat-v1",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsDeleteCatalogEntry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsDeleteCatalogEntryMutation
} from "@meetkai/mka1/react-query/llmModelsDeleteCatalogEntry.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.DeleteModelCatalogEntryRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.DeleteCatalogModelResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

checkCatalogHealth ​

Probes an available BYO definition whether or not it is active.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.checkCatalogHealth({
    id: "meetkai:custom-chat-v1",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsCheckCatalogHealth } from "@meetkai/mka1/funcs/llmModelsCheckCatalogHealth.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsCheckCatalogHealth(sdk, {
    id: "meetkai:custom-chat-v1",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsCheckCatalogHealth failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsCheckCatalogHealthMutation
} from "@meetkai/mka1/react-query/llmModelsCheckCatalogHealth.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.CheckModelCatalogHealthRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.CatalogHealthResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listCatalogOrgAccess ​

Cluster operator view of an org's available cluster catalog entries and their activation state.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listCatalogOrgAccess({
    orgId: "org-acme",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListCatalogOrgAccess } from "@meetkai/mka1/funcs/llmModelsListCatalogOrgAccess.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListCatalogOrgAccess(sdk, {
    orgId: "org-acme",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListCatalogOrgAccess failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListCatalogOrgAccess,
  useLlmModelsListCatalogOrgAccessSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListCatalogOrgAccess,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsListCatalogOrgAccess,
  invalidateAllLlmModelsListCatalogOrgAccess,
} from "@meetkai/mka1/react-query/llmModelsListCatalogOrgAccess.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListModelCatalogOrgAccessRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.AccessListResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

addCatalogOrgAccess ​

Idempotently adds availability without revoking any model names. Set activate to true to also activate every requested model from the cluster source in the target organization. Grants and activations are atomic per request; a name active from another source returns 409 without changing access or activation. Existing activation audit details are preserved on retries.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.addCatalogOrgAccess({
    orgId: "org-acme",
    addAccessMutationRequest: {
      modelIds: [
        "functionary",
      ],
      activate: false,
    },
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsAddCatalogOrgAccess } from "@meetkai/mka1/funcs/llmModelsAddCatalogOrgAccess.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsAddCatalogOrgAccess(sdk, {
    orgId: "org-acme",
    addAccessMutationRequest: {
      modelIds: [
        "functionary",
      ],
      activate: false,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsAddCatalogOrgAccess failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsAddCatalogOrgAccessMutation
} from "@meetkai/mka1/react-query/llmModelsAddCatalogOrgAccess.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.AddModelCatalogOrgAccessRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.AccessMutationResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

replaceCatalogOrgAccess ​

Serializable full replacement; revoked active cluster names are deactivated and their org price rows are closed.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.replaceCatalogOrgAccess({
    orgId: "org-acme",
    accessMutationRequest: {
      modelIds: [
        "functionary",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsReplaceCatalogOrgAccess } from "@meetkai/mka1/funcs/llmModelsReplaceCatalogOrgAccess.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsReplaceCatalogOrgAccess(sdk, {
    orgId: "org-acme",
    accessMutationRequest: {
      modelIds: [
        "functionary",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsReplaceCatalogOrgAccess failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsReplaceCatalogOrgAccessMutation
} from "@meetkai/mka1/react-query/llmModelsReplaceCatalogOrgAccess.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ReplaceModelCatalogOrgAccessRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.AccessMutationResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listCatalogModelAccess ​

Cluster operator reverse lookup showing availability and activation for one cluster catalog id.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listCatalogModelAccess({
    modelId: "functionary",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListCatalogModelAccess } from "@meetkai/mka1/funcs/llmModelsListCatalogModelAccess.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListCatalogModelAccess(sdk, {
    modelId: "functionary",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListCatalogModelAccess failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListCatalogModelAccess,
  useLlmModelsListCatalogModelAccessSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListCatalogModelAccess,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsListCatalogModelAccess,
  invalidateAllLlmModelsListCatalogModelAccess,
} from "@meetkai/mka1/react-query/llmModelsListCatalogModelAccess.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListModelCatalogAccessRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ReverseAccessListResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listRegistry ​

Single management view of every active name with source-qualified definition, health, price, and activation audit details.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listRegistry();

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListRegistry } from "@meetkai/mka1/funcs/llmModelsListRegistry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListRegistry(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListRegistry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListRegistry,
  useLlmModelsListRegistrySuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListRegistry,
  
  // Utility to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAllLlmModelsListRegistry,
} from "@meetkai/mka1/react-query/llmModelsListRegistry.js";

Parameters ​

ParameterTypeRequiredDescription
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.RegistryManagementListResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

activateRegistryEntry ​

Claims a model name from one catalog source. Re-activation from the same source is idempotent; a different holder returns 409.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.activateRegistryEntry({
    source: "cluster",
    modelId: "functionary",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsActivateRegistryEntry } from "@meetkai/mka1/funcs/llmModelsActivateRegistryEntry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsActivateRegistryEntry(sdk, {
    source: "cluster",
    modelId: "functionary",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsActivateRegistryEntry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsActivateRegistryEntryMutation
} from "@meetkai/mka1/react-query/llmModelsActivateRegistryEntry.js";

Parameters ​

ParameterTypeRequiredDescription
requestcomponents.ActivateRegistryEntryRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.RegistryEntryResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

deactivateRegistryEntry ​

Idempotently removes the active name and closes its org-scope price rows without touching the catalog definition.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.deactivateRegistryEntry({
    id: "functionary",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsDeactivateRegistryEntry } from "@meetkai/mka1/funcs/llmModelsDeactivateRegistryEntry.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsDeactivateRegistryEntry(sdk, {
    id: "functionary",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsDeactivateRegistryEntry failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsDeactivateRegistryEntryMutation
} from "@meetkai/mka1/react-query/llmModelsDeactivateRegistryEntry.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.DeactivateModelRegistryEntryRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.DeactivateRegistryEntryResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listOrgAutoModels ​

Returns every endpoint for which this org has set its own "auto" target. Endpoints not listed fall through to the operator's YAML defaults.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listOrgAutoModels();

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListOrgAutoModels } from "@meetkai/mka1/funcs/llmModelsListOrgAutoModels.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListOrgAutoModels(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListOrgAutoModels failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListOrgAutoModels,
  useLlmModelsListOrgAutoModelsSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListOrgAutoModels,
  
  // Utility to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAllLlmModelsListOrgAutoModels,
} from "@meetkai/mka1/react-query/llmModelsListOrgAutoModels.js";

Parameters ​

ParameterTypeRequiredDescription
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ListOrgAutoModelsResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

putOrgAutoModel ​

Stores either the existing direct { endpoint → model_id } alias or a judge policy with candidate models. Judge routing is supported for responses, completions, transcriptions, and TTS. All configured models must be active when written; revoked candidates are filtered at request time, while an unavailable judge is an explicit error.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.putOrgAutoModel({
    endpoint: "responses",
    putOrgAutoModelRequest: {
      policy: "price",
      judgeModelId: "meetkai:functionary",
      candidateModelIds: [
        "meetkai:functionary-pt",
        "meetkai:functionary-es",
      ],
    },
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsPutOrgAutoModel } from "@meetkai/mka1/funcs/llmModelsPutOrgAutoModel.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsPutOrgAutoModel(sdk, {
    endpoint: "responses",
    putOrgAutoModelRequest: {
      policy: "price",
      judgeModelId: "meetkai:functionary",
      candidateModelIds: [
        "meetkai:functionary-pt",
        "meetkai:functionary-es",
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsPutOrgAutoModel failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsPutOrgAutoModelMutation
} from "@meetkai/mka1/react-query/llmModelsPutOrgAutoModel.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.PutOrgAutoModelRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<operations.PutOrgAutoModelResponseBody>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

deleteOrgAutoModel ​

Removes the per-org override for the endpoint. Subsequent model: "auto" requests fall through to the operator's YAML default again.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.deleteOrgAutoModel({
    endpoint: "responses",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsDeleteOrgAutoModel } from "@meetkai/mka1/funcs/llmModelsDeleteOrgAutoModel.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsDeleteOrgAutoModel(sdk, {
    endpoint: "responses",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsDeleteOrgAutoModel failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsDeleteOrgAutoModelMutation
} from "@meetkai/mka1/react-query/llmModelsDeleteOrgAutoModel.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.DeleteOrgAutoModelRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.DeleteOrgAutoModelResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

getClusterCurrency ​

Returns the single cluster-wide ISO-4217 currency code (null if not set).

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.getClusterCurrency();

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsGetClusterCurrency } from "@meetkai/mka1/funcs/llmModelsGetClusterCurrency.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsGetClusterCurrency(sdk);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsGetClusterCurrency failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsGetClusterCurrency,
  useLlmModelsGetClusterCurrencySuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsGetClusterCurrency,
  
  // Utility to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAllLlmModelsGetClusterCurrency,
} from "@meetkai/mka1/react-query/llmModelsGetClusterCurrency.js";

Parameters ​

ParameterTypeRequiredDescription
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ClusterCurrencyResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

setClusterCurrency ​

Sets the cluster-wide currency. Changing it does not auto-convert existing prices.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.setClusterCurrency({
    currency: "Nakfa",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsSetClusterCurrency } from "@meetkai/mka1/funcs/llmModelsSetClusterCurrency.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsSetClusterCurrency(sdk, {
    currency: "Nakfa",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsSetClusterCurrency failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsSetClusterCurrencyMutation
} from "@meetkai/mka1/react-query/llmModelsSetClusterCurrency.js";

Parameters ​

ParameterTypeRequiredDescription
requestcomponents.PutClusterCurrencyBody✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ClusterCurrencyResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listClusterPrices ​

Without model, lists every model's current cluster-default price. With model, returns that model's full dated history.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listClusterPrices({});

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListClusterPrices } from "@meetkai/mka1/funcs/llmModelsListClusterPrices.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListClusterPrices(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListClusterPrices failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListClusterPrices,
  useLlmModelsListClusterPricesSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListClusterPrices,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsListClusterPrices,
  invalidateAllLlmModelsListClusterPrices,
} from "@meetkai/mka1/react-query/llmModelsListClusterPrices.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListClusterPricesRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ListModelPricesResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

setClusterPrice ​

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.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.setClusterPrice({
    model: "Cruze",
    rates: {},
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsSetClusterPrice } from "@meetkai/mka1/funcs/llmModelsSetClusterPrice.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsSetClusterPrice(sdk, {
    model: "Cruze",
    rates: {},
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsSetClusterPrice failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsSetClusterPriceMutation
} from "@meetkai/mka1/react-query/llmModelsSetClusterPrice.js";

Parameters ​

ParameterTypeRequiredDescription
requestcomponents.PutModelPriceBody✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ModelPriceRow>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

clearClusterPrice ​

Closes the cluster-default price. Active cluster lineage then uses an org override or becomes unpriced ($0).

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.clearClusterPrice({
    model: "Alpine",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsClearClusterPrice } from "@meetkai/mka1/funcs/llmModelsClearClusterPrice.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsClearClusterPrice(sdk, {
    model: "Alpine",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsClearClusterPrice failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsClearClusterPriceMutation
} from "@meetkai/mka1/react-query/llmModelsClearClusterPrice.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ClearClusterPriceRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.DeleteModelPriceResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listOrgPrices ​

Without model, lists the org's current overrides. With model, returns that override's dated history.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listOrgPrices({
    orgId: "<id>",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListOrgPrices } from "@meetkai/mka1/funcs/llmModelsListOrgPrices.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListOrgPrices(sdk, {
    orgId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListOrgPrices failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListOrgPrices,
  useLlmModelsListOrgPricesSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListOrgPrices,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsListOrgPrices,
  invalidateAllLlmModelsListOrgPrices,
} from "@meetkai/mka1/react-query/llmModelsListOrgPrices.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListOrgPricesRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ListModelPricesResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

setOrgPrice ​

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.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.setOrgPrice({
    orgId: "<id>",
    putModelPriceBody: {
      model: "Roadster",
      rates: {},
    },
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsSetOrgPrice } from "@meetkai/mka1/funcs/llmModelsSetOrgPrice.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsSetOrgPrice(sdk, {
    orgId: "<id>",
    putModelPriceBody: {
      model: "Roadster",
      rates: {},
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsSetOrgPrice failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsSetOrgPriceMutation
} from "@meetkai/mka1/react-query/llmModelsSetOrgPrice.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.SetOrgPriceRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.ModelPriceRow>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

clearOrgPrice ​

Closes a per-org price. Only active cluster lineage can then fall back to the cluster default.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.clearOrgPrice({
    orgId: "<id>",
    model: "XTS",
  });

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsClearOrgPrice } from "@meetkai/mka1/funcs/llmModelsClearOrgPrice.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsClearOrgPrice(sdk, {
    orgId: "<id>",
    model: "XTS",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsClearOrgPrice failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useLlmModelsClearOrgPriceMutation
} from "@meetkai/mka1/react-query/llmModelsClearOrgPrice.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ClearOrgPriceRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.DeleteModelPriceResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*

listEffectivePrices ​

For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the auto routing alias, priced at the per-metric maximum across every model it can be billed as (resolves_to): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.

Example Usage ​

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.models.listEffectivePrices({});

  console.log(result);
}

run();

Standalone function ​

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmModelsListEffectivePrices } from "@meetkai/mka1/funcs/llmModelsListEffectivePrices.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await llmModelsListEffectivePrices(sdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("llmModelsListEffectivePrices failed:", res.error);
  }
}

run();

React hooks and utilities ​

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useLlmModelsListEffectivePrices,
  useLlmModelsListEffectivePricesSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchLlmModelsListEffectivePrices,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateLlmModelsListEffectivePrices,
  invalidateAllLlmModelsListEffectivePrices,
} from "@meetkai/mka1/react-query/llmModelsListEffectivePrices.js";

Parameters ​

ParameterTypeRequiredDescription
requestoperations.ListEffectivePricesRequest✔️The request object to use for the request.
optionsRequestOptions➖Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit➖Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig➖Enables retrying HTTP requests under certain failure conditions.

Response ​

Promise<components.EffectivePricesResponse>

Errors ​

Error TypeStatus CodeContent Type
errors.APIError4XX, 5XX*/*