MKA1 TypeScript SDK
Official TypeScript SDK for the MKA1 API.
Use @meetkai/mka1 to call MKA1 from Node.js, browsers, React apps, and agent tooling. The SDK includes typed clients for responses, agents, files, vector stores, evals, usage, model registry operations, guardrails, sandbox APIs, and more.
Full product and API documentation lives at docs.mka1.com.
Install
npm add @meetkai/mka1pnpm add @meetkai/mka1bun add @meetkai/mka1yarn add @meetkai/mka1The package ships both ESM and CommonJS builds. For supported runtimes, see RUNTIMES.md.
Quick Start
import { SDK } from "@meetkai/mka1";
const mka1 = new SDK({
bearerAuth: process.env.MKA1_API_KEY,
});
const models = await mka1.llm.models.list({});
console.log(models.data.map((model) => model.id));Most write APIs use the same client:
import { SDK } from "@meetkai/mka1";
const mka1 = new SDK({
bearerAuth: process.env.MKA1_API_KEY,
});
const response = await mka1.llm.responses.create({
responsesCreateRequest: {
model: "<MODEL_ID>",
input: "Summarize the latest MKA1 eval run.",
},
});
console.log(response);Authentication
Pass an MKA1 API key or bearer token when constructing the client:
const mka1 = new SDK({
bearerAuth: process.env.MKA1_API_KEY,
});You can also provide an async token resolver:
const mka1 = new SDK({
bearerAuth: async () => refreshMka1Token(),
});For account setup, API keys, and endpoint-specific examples, see docs.mka1.com.
Common Entry Points
mka1.llm.responses
mka1.llm.conversations
mka1.llm.files
mka1.llm.vectorStores
mka1.llm.evals
mka1.llm.models
mka1.llm.usage
mka1.agents
mka1.agentRuns
mka1.sandbox
mka1.permissionsThe generated method reference below lists every resource and operation included in this SDK.
React Query
React hooks are available from @meetkai/mka1/react-query. Install the optional peer dependencies only if you plan to use those hooks:
npm add @tanstack/react-query react react-domSee REACT_QUERY.md for provider setup, suspense hooks, invalidation helpers, and mutation examples.
MCP Server
This package also exposes the MKA1 API as an installable Model Context Protocol server.
Node.js v20 or newer is required for the MCP server.
{
"mcpServers": {
"mka1": {
"command": "npx",
"args": [
"-y",
"--package",
"@meetkai/mka1",
"--",
"mcp",
"start",
"--bearer-auth",
"..."
]
}
}
}For available server flags:
npx -y --package @meetkai/mka1 -- mcp start --helpSummary
MKA1 API: The MKA1 API is a RESTful API that provides access to the MKA1 platform. Learn how to get started with the API and the TypeScript SDK here.
Table of Contents
- MKA1 TypeScript SDK
- Install
- Quick Start
- Authentication
- Common Entry Points
- React Query
- MCP Server
- SDK Installation
- Requirements
- SDK Example Usage
- Authentication
- Available Resources and Operations
- Standalone functions
- React hooks with TanStack Query
- Server-sent event streaming
- File uploads
- Retries
- Error Handling
- Server Selection
- Custom HTTP Client
- Debugging
- Versioning
- Generated Code
SDK Installation
TIP
The SDK can be installed with either npm, pnpm, bun or yarn package managers.
NPM
npm add git+https://github.com/MeetKai/mk1-sdks.git?subdir=typescript
# Install optional peer dependencies if you plan to use React hooks
npm add @tanstack/react-query react react-domPNPM
pnpm add https://github.com/MeetKai/mk1-sdks#path:typescript
# Install optional peer dependencies if you plan to use React hooks
pnpm add @tanstack/react-query react react-domBun
bun add https://github.com/MeetKai/mk1-sdks
# Install optional peer dependencies if you plan to use React hooks
bun add @tanstack/react-query react react-domYarn
yarn add https://github.com/MeetKai/mk1-sdks
# Install optional peer dependencies if you plan to use React hooks
yarn add @tanstack/react-query react react-domNOTE
This package is published with CommonJS and ES Modules (ESM) support.
Model Context Protocol (MCP) Server
This SDK is also an installable MCP server where the various SDK methods are exposed as tools that can be invoked by AI applications.
Node.js v20 or greater is required to run the MCP server from npm.
Claude installation steps
Add the following server definition to your claude_desktop_config.json file:
{
"mcpServers": {
"SDK": {
"command": "npx",
"args": [
"-y", "--package", "@meetkai/mka1",
"--",
"mcp", "start",
"--bearer-auth", "..."
]
}
}
}Cursor installation steps
Create a .cursor/mcp.json file in your project root with the following content:
{
"mcpServers": {
"SDK": {
"command": "npx",
"args": [
"-y", "--package", "@meetkai/mka1",
"--",
"mcp", "start",
"--bearer-auth", "..."
]
}
}
}You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
curl -L -o mcp-server \
https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
chmod +x mcp-serverIf the repo is a private repo you must add your Github PAT to download a release -H "Authorization: Bearer {GITHUB_PAT}".
{
"mcpServers": {
"Todos": {
"command": "./DOWNLOAD/PATH/mcp-server",
"args": [
"start"
]
}
}
}For a full list of server arguments, run:
npx -y --package @meetkai/mka1 -- mcp start --helpRequirements
For supported JavaScript runtimes, please consult RUNTIMES.md.
SDK Example Usage
Example
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
});
}
run();Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
bearerAuth | http | HTTP Bearer |
To authenticate with the API the bearerAuth parameter must be set when initializing the SDK client instance. For example:
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
});
}
run();Available Resources and Operations
Available methods
AgentConnectors
- listAgentConnectors - List connectors for an agent
- createAgentConnector - Create a connector
- setupWhatsAppAppWebhook - Set up a WhatsApp app webhook (Beta)
- getAgentConnector - Retrieve a connector
- deleteAgentConnector - Delete a connector
- activateAgentConnector - Activate a connector
AgentRuns
- listAgentRuns - List runs for an agent
- createAgentRun - Start a saved agent run
- streamAgentRunEvents - Stream agent run events
- wakeAgentRun - Wake a sleeping agent run
- decideAgentRunMcpApproval - Approve or deny a pending MCP tool call
- getAgentRun - Retrieve an agent run
AgentSchedules
- listAgentSchedules - List schedules for an agent
- createAgentSchedule - Create an agent schedule
- getAgentSchedule - Retrieve an agent schedule
- updateAgentSchedule - Update an agent schedule
- deleteAgentSchedule - Delete an agent schedule
- pauseAgentSchedule - Pause an agent schedule
- resumeAgentSchedule - Resume an agent schedule
AgentVersions
- listAgentVersions - List agent versions
- getAgentVersion - Retrieve an agent version
- rollbackAgentVersion - Roll back an agent to a version
Agents
- listAgents - List agents
- createAgent - Create an agent
- getAgent - Retrieve an agent
- updateAgent - Update an agent
- deleteAgent - Delete an agent
Auth.ApiKey
getJwtFromKey- Exchange API key for a JWT token ⚠️ Deprecated Use exchangeToken instead.
Auth.ApiKeys
- create - Mint a scoped API key
- list - List scoped API keys
- update - Update a scoped API key
- regenerate - Rotate a scoped API key's secret
- exchangeToken - Exchange API key for a JWT token
Auth.Cluster
- createInvite - Create a cluster invitation
- listInvites - List cluster invitations
- revokeInvite - Revoke a cluster invitation
- listOrgs - List all organizations
- getOrg - Get an organization
- deleteOrg - Soft-delete an organization
- suspendOrg - Suspend an organization
- unsuspendOrg - Unsuspend an organization
- reissueOwnerKey - Re-issue an org owner key (recovery)
- inviteInfo - Read cluster-invite info (public)
- acceptInvite - Accept a cluster invitation (public)
Auth.Orgs
- getQuota - Get an org's usage quota
- updateQuota - Set an org's usage quota (cluster-admin)
- getRateLimit - Get an org's rate limit
- updateRateLimit - Set an org's rate limit (cluster-admin)
Auth.ServiceAccounts
- create - Create a service account
- list - List service accounts
- get - Get a service account
- delete - Delete a service account
- listApiKeys - List a service account's API keys
- updateApiKey - Update a service-account API key
- deleteApiKey - Delete a service-account API key
- regenerateApiKey - Rotate a service-account API key's secret
Auth.Teams
- create - Create a team
- list - List teams in an org
- get - Get a team
- update - Rename a team
- delete - Delete a team
- addMember - Add a team member
- listMembers - List team members
- removeMember - Remove a team member
Budgets
- list - List budgets
- getOrg - List org budgets
- setOrg - Set an org budget
- deleteOrg - Delete an org budget
- orgEvents - List org budget events
- getApiKey - List apikey budgets
- setApiKey - Set an apikey budget
- deleteApiKey - Delete an apikey budget
- apiKeyEvents - List apikey budget events
- getCurrency - Get display currency
- setCurrency - Set display currency
ComputeCatalog
- listAccelerators - List accelerators
- getAccelerator - Get an accelerator
- listComputeOffers - List provider offers
- listComputeProviders - List provider health
- createComputeQuote - Create a quote
ComputeJobs
- listJobs - List jobs
- createJob - Create a job
- getJob - Get a job
- listJobEvents - List job events
- listJobInstances - List observed job instances
- listJobLogs - List job logs
- terminateJob - Terminate a job
ComputeSecrets
- listComputeSecrets - List secrets
- createComputeSecret - Create a secret
- deleteComputeSecret - Delete a secret
- getComputeSecret - Get a secret
ComputeServices
- listServices - List services
- createService - Create a service
- getService - Get a service
- listServiceEvents - List service events
- listServiceInstances - List observed service instances
- listServiceLogs - List service logs
- terminateService - Terminate a service
ComputeTenants
- listComputeTenants - List tenants
- getComputeTenant - Get a tenant
- putComputeTenant - Update a tenant
ComputeUsage
- getComputeUsage - Get usage
Guardrails
- getGuardrails - Get effective guardrails
- updateGuardrails - Update guardrails policy
- deleteGuardrails - Delete guardrails policy
- listGuardrailsPolicies - List guardrails policies
- testGuardrails - Test content against guardrails
Llm.Batches
Llm.Chat
createChat- [Deprecated] Chat completions for OpenAI SDK/client usage ⚠️ Deprecatedstream- [Deprecated] Streaming chat completions for generated SDK usage ⚠️ Deprecated
Llm.Classify
- classify - Classify text into predefined categories
Llm.Conversations
- create - Create a conversation
- list - List conversations
- get - Retrieve a conversation
- update - Update a conversation
- delete - Delete a conversation
- listItems - List conversation items
- createItems - Create conversation items
- deleteItems - Delete multiple conversation items
- getItem - Retrieve a conversation item
- deleteItem - Delete a conversation item
Llm.Embeddings
- listModels - List available embedding models
- embed - Create text embeddings
Llm.Evals
- createSuite - Create an eval suite
- listSuites - List eval suites
- getSuite - Get an eval suite
- deleteSuite - Delete an eval suite
- createSuiteVersion - Create an eval suite version
- listSuiteVersions - List eval suite versions
- getSuiteVersion - Get an eval suite version
- listSuiteLeaderboardRuns - List leaderboard runs for an eval suite
- createRun - Create an eval run
- listRuns - List eval runs
- getRun - Get an eval run
- deleteRun - Delete an eval run
- cancelRun - Cancel an eval run
- rerunFailedSamples - Rerun failed eval samples
- retryFailedRun - Retry an eval run
- listSamples - List eval samples
- getSampleAudio - Get eval sample audio
- getArtifacts - Get eval run artifacts
- importHistoricalResults - Import historical eval results from Hugging Face
- createSchedule - Create an eval schedule
- listSchedules - List eval schedules
- getSchedule - Get an eval schedule
- updateSchedule - Update an eval schedule
- deleteSchedule - Delete an eval schedule
- triggerSchedule - Trigger an eval schedule now
- listScheduleRuns - List runs created by an eval schedule
Llm.Extract
- extract - Extract structured data with inline JSON Schema
- createSchema - Create reusable extraction schema template
- getSchema - Get extraction schema by ID
- updateSchema - Update extraction schema by ID
- deleteSchema - Delete extraction schema by ID
- extractWithSchema - Extract data using saved schema template
Llm.Feedback
- createCompletionFeedback - Submit feedback for chat completion
- listCompletionFeedback - List chat completion feedback
- getCompletionFeedback - Retrieve feedback by completion ID
- updateCompletionFeedback - Update existing completion feedback
- batchGetCompletionFeedback - Batch retrieve feedback for multiple completions
- createResponseFeedback - Submit feedback for response
- listResponseFeedback - List response feedback
- getResponseFeedback - Retrieve feedback by response ID
- updateResponseFeedback - Update existing response feedback
- batchGetResponseFeedback - Batch retrieve feedback for multiple responses
- exportCompletionFeedback - Export completion feedback as CSV
- exportResponseFeedback - Export response feedback as CSV
- startExport - Start feedback export
- getExportStatus - Get feedback export status
Llm.Files
- upload - Upload file
- list - List files
- get - Retrieve file
- delete - Delete file
- content - Retrieve file content
Llm.FineTuning
- create - Create a fine-tuning job
- list - List fine-tuning jobs
- retrieve - Retrieve a fine-tuning job
- cancel - Cancel a fine-tuning job
- pause - Pause a fine-tuning job
- resume - Resume a fine-tuning job
- listEvents - List fine-tuning events
- listCheckpoints - List fine-tuning checkpoints
Llm.Images
- create - Generate images from text descriptions
Llm.McpVault
- createServer - Create MCP server
- listServers - List MCP servers
- getServer - Retrieve MCP server
- updateServer - Update MCP server
- deleteServer - Delete MCP server
- createCredential - Create MCP credential
- listCredentials - List MCP credentials
- deleteCredential - Delete MCP credential
- testServer - Test MCP server
Llm.MemoryStores
- create - Create memory store
- list - List memory stores
- get - Retrieve memory store
- update - Update memory store
- delete - Delete memory store
- createEntry - Create memory entry
- listEntries - List memory entries
- getEntry - Retrieve memory entry
- updateEntry - Update memory entry
- deleteEntry - Delete memory entry
Llm.Models
- list - List available models
- get - Retrieve a model
- listCatalog - List the organization's model catalog
- addCatalogEntry - Define a BYO catalog model
- updateCatalogEntry - Update a BYO catalog model
- deleteCatalogEntry - Remove a BYO catalog model
- checkCatalogHealth - Check a BYO catalog model's health
- listCatalogOrgAccess - List an organization's cluster model access
- addCatalogOrgAccess - Add cluster model access for an organization
- replaceCatalogOrgAccess - Replace an organization's cluster model access
- listCatalogModelAccess - List organizations with access to a cluster model
- listRegistry - List the organization's active model registry
- activateRegistryEntry - Activate a catalog entry
- deactivateRegistryEntry - Deactivate a model registry name
- listOrgAutoModels - List this org's auto-model overrides
- putOrgAutoModel - Set this org's auto-model override for an endpoint
- deleteOrgAutoModel - Clear this org's auto-model override for an endpoint
- getClusterCurrency - Get the cluster currency
- setClusterCurrency - Set the cluster currency
- listClusterPrices - List cluster-default model prices
- setClusterPrice - Set a cluster-default model price
- clearClusterPrice - Clear a cluster-default model price
- listOrgPrices - List an org's price overrides
- setOrgPrice - Set an org price override
- clearOrgPrice - Clear an org price override
- listEffectivePrices - List effective prices for the caller's models
Llm.Prompts
- create - Create a prompt
- list - List prompts
- get - Get a prompt
- update - Update a prompt
- delete - Delete a prompt
- createVersion - Create a new version
- listVersions - List versions
- getVersion - Get a specific version
- rollback - Rollback to a version
Llm.Responses
- create - Create an agent-powered response with tool support
- list - List all responses with pagination
- get - Retrieve response by ID with status and results
- update - Update a response
- delete - Permanently delete a response and its data
- cancel - Cancel an in-progress background response
- wake - Wake a sleeping background response
- listInputItems - List paginated input items for a response
- compact - Compact a conversation
Llm.Skills
- create - Create skill
- list - List skills
- get - Retrieve skill
- update - Update skill
- delete - Delete skill
- content - Download skill content
- createVersion - Create skill version
- listVersions - List skill versions
- getVersion - Retrieve skill version
- deleteVersion - Delete skill version
- versionContent - Download skill version content
- listPreconfigured - List preconfigured skills
Llm.Speech
- transcribe - Speech to text transcription
- speak - Text to speech
- speakStreaming - Streaming text to speech
- livekitToken - Generate LiveKit room token
- listTtsHistory - List text-to-speech history
- getTtsHistory - Retrieve text-to-speech history item
- deleteTtsHistory - Delete text-to-speech history item
- getTtsHistoryContent - Retrieve text-to-speech audio
- listTranscriptionHistory - List speech-to-text history
- getTranscriptionHistory - Retrieve speech-to-text history item
- deleteTranscriptionHistory - Delete speech-to-text history item
- getTranscriptionHistoryContent - Retrieve speech-to-text audio
Llm.Usage
- completions - Get completions usage
- responses - Get responses usage
- conversations - Get conversations usage
- embeddings - Get embeddings usage
- extract - Get extract usage
- classify - Get classify usage
- vectorStores - Get vector stores usage
- files - Get files usage
- costs - Get cost by model
Llm.VectorStores
- create - Create a vector store
- list - List vector stores
- get - Retrieve a vector store
- update - Modify a vector store
- delete - Delete a vector store
- search - Search a vector store
- createFile - Add a file to a vector store
- listFiles - List files in a vector store
- getFile - Retrieve a vector store file
- updateFile - Update file attributes
- deleteFile - Remove file from vector store
- getFileContent - Retrieve parsed file content
- createFileBatch - Batch add multiple files to vector store
- getFileBatch - Retrieve file batch status
- cancelFileBatch - Cancel batch file processing
- listFilesInBatch - List files in a batch
Permissions.Llm
- grant - Grant permission to a user or make public
- revoke - Revoke permission from a user or remove public access
- check - Check user permission
Repos
- list - List the caller's org's repositories
- create - Create a repository
- delete - Delete a repository
- get - Get a repository
- update - Update a repository's labels
Sandbox
- create - Create Session
- list - List Sessions
- get - Get Session
- getPricing - Get Sandbox Pricing
- setPricing - Set Sandbox Pricing
- getBrowserUrl - Get Browser Session URL
getUrl- Get Browser Session URL (Deprecated) ⚠️ Deprecated Use getBrowserUrl instead.- proxyBrowserPortRequest - Proxy Browser Port Request
- runCommand - Run Command
- runCode - Run Code
- terminate - Terminate Session
- getWorkspace - Get Workspace Manifest
- downloadFile - Download Workspace File
- uploadFile - Upload Workspace File
- downloadArchive - Download Workspace Archive
- uploadArchive - Upload Workspace Archive
Schema3Other
Usage
Standalone functions
All the methods listed above are available as standalone functions. These functions are ideal for use in applications running in the browser, serverless runtimes or other environments where application bundle size is a primary concern. When using a bundler to build your application, all unused functionality will be either excluded from the final bundle or tree-shaken away.
To read more about standalone functions, check FUNCTIONS.md.
Available standalone functions
agentConnectorsActivateAgentConnector- Activate a connectoragentConnectorsCreateAgentConnector- Create a connectoragentConnectorsDeleteAgentConnector- Delete a connectoragentConnectorsGetAgentConnector- Retrieve a connectoragentConnectorsListAgentConnectors- List connectors for an agentagentConnectorsSetupWhatsAppAppWebhook- Set up a WhatsApp app webhook (Beta)agentRunsCreateAgentRun- Start a saved agent runagentRunsDecideAgentRunMcpApproval- Approve or deny a pending MCP tool callagentRunsGetAgentRun- Retrieve an agent runagentRunsListAgentRuns- List runs for an agentagentRunsStreamAgentRunEvents- Stream agent run eventsagentRunsWakeAgentRun- Wake a sleeping agent runagentSchedulesCreateAgentSchedule- Create an agent scheduleagentSchedulesDeleteAgentSchedule- Delete an agent scheduleagentSchedulesGetAgentSchedule- Retrieve an agent scheduleagentSchedulesListAgentSchedules- List schedules for an agentagentSchedulesPauseAgentSchedule- Pause an agent scheduleagentSchedulesResumeAgentSchedule- Resume an agent scheduleagentSchedulesUpdateAgentSchedule- Update an agent scheduleagentsCreateAgent- Create an agentagentsDeleteAgent- Delete an agentagentsGetAgent- Retrieve an agentagentsListAgents- List agentsagentsUpdateAgent- Update an agentagentVersionsGetAgentVersion- Retrieve an agent versionagentVersionsListAgentVersions- List agent versionsagentVersionsRollbackAgentVersion- Roll back an agent to a versionauthApiKeysCreate- Mint a scoped API keyauthApiKeysExchangeToken- Exchange API key for a JWT tokenauthApiKeysList- List scoped API keysauthApiKeysRegenerate- Rotate a scoped API key's secretauthApiKeysUpdate- Update a scoped API keyauthClusterAcceptInvite- Accept a cluster invitation (public)authClusterCreateInvite- Create a cluster invitationauthClusterDeleteOrg- Soft-delete an organizationauthClusterGetOrg- Get an organizationauthClusterInviteInfo- Read cluster-invite info (public)authClusterListInvites- List cluster invitationsauthClusterListOrgs- List all organizationsauthClusterReissueOwnerKey- Re-issue an org owner key (recovery)authClusterRevokeInvite- Revoke a cluster invitationauthClusterSuspendOrg- Suspend an organizationauthClusterUnsuspendOrg- Unsuspend an organizationauthOrgsGetQuota- Get an org's usage quotaauthOrgsGetRateLimit- Get an org's rate limitauthOrgsUpdateQuota- Set an org's usage quota (cluster-admin)authOrgsUpdateRateLimit- Set an org's rate limit (cluster-admin)authServiceAccountsCreate- Create a service accountauthServiceAccountsDelete- Delete a service accountauthServiceAccountsDeleteApiKey- Delete a service-account API keyauthServiceAccountsGet- Get a service accountauthServiceAccountsList- List service accountsauthServiceAccountsListApiKeys- List a service account's API keysauthServiceAccountsRegenerateApiKey- Rotate a service-account API key's secretauthServiceAccountsUpdateApiKey- Update a service-account API keyauthTeamsAddMember- Add a team memberauthTeamsCreate- Create a teamauthTeamsDelete- Delete a teamauthTeamsGet- Get a teamauthTeamsList- List teams in an orgauthTeamsListMembers- List team membersauthTeamsRemoveMember- Remove a team memberauthTeamsUpdate- Rename a teambudgetsApiKeyEvents- List apikey budget eventsbudgetsDeleteApiKey- Delete an apikey budgetbudgetsDeleteOrg- Delete an org budgetbudgetsGetApiKey- List apikey budgetsbudgetsGetCurrency- Get display currencybudgetsGetOrg- List org budgetsbudgetsList- List budgetsbudgetsOrgEvents- List org budget eventsbudgetsSetApiKey- Set an apikey budgetbudgetsSetCurrency- Set display currencybudgetsSetOrg- Set an org budgetcomputeCatalogCreateComputeQuote- Create a quotecomputeCatalogGetAccelerator- Get an acceleratorcomputeCatalogListAccelerators- List acceleratorscomputeCatalogListComputeOffers- List provider offerscomputeCatalogListComputeProviders- List provider healthcomputeJobsCreateJob- Create a jobcomputeJobsGetJob- Get a jobcomputeJobsListJobEvents- List job eventscomputeJobsListJobInstances- List observed job instancescomputeJobsListJobLogs- List job logscomputeJobsListJobs- List jobscomputeJobsTerminateJob- Terminate a jobcomputeSecretsCreateComputeSecret- Create a secretcomputeSecretsDeleteComputeSecret- Delete a secretcomputeSecretsGetComputeSecret- Get a secretcomputeSecretsListComputeSecrets- List secretscomputeServicesCreateService- Create a servicecomputeServicesGetService- Get a servicecomputeServicesListServiceEvents- List service eventscomputeServicesListServiceInstances- List observed service instancescomputeServicesListServiceLogs- List service logscomputeServicesListServices- List servicescomputeServicesTerminateService- Terminate a servicecomputeTenantsGetComputeTenant- Get a tenantcomputeTenantsListComputeTenants- List tenantscomputeTenantsPutComputeTenant- Update a tenantcomputeUsageGetComputeUsage- Get usageguardrailsDeleteGuardrails- Delete guardrails policyguardrailsGetGuardrails- Get effective guardrailsguardrailsListGuardrailsPolicies- List guardrails policiesguardrailsTestGuardrails- Test content against guardrailsguardrailsUpdateGuardrails- Update guardrails policyllmBatchesCancel- Cancel a batchllmBatchesCreate- Create a batchllmBatchesGet- Get a batchllmBatchesList- List batchesllmClassifyClassify- Classify text into predefined categoriesllmConversationsCreate- Create a conversationllmConversationsCreateItems- Create conversation itemsllmConversationsDelete- Delete a conversationllmConversationsDeleteItem- Delete a conversation itemllmConversationsDeleteItems- Delete multiple conversation itemsllmConversationsGet- Retrieve a conversationllmConversationsGetItem- Retrieve a conversation itemllmConversationsList- List conversationsllmConversationsListItems- List conversation itemsllmConversationsUpdate- Update a conversationllmEmbeddingsEmbed- Create text embeddingsllmEmbeddingsListModels- List available embedding modelsllmEvalsCancelRun- Cancel an eval runllmEvalsCreateRun- Create an eval runllmEvalsCreateSchedule- Create an eval schedulellmEvalsCreateSuite- Create an eval suitellmEvalsCreateSuiteVersion- Create an eval suite versionllmEvalsDeleteRun- Delete an eval runllmEvalsDeleteSchedule- Delete an eval schedulellmEvalsDeleteSuite- Delete an eval suitellmEvalsGetArtifacts- Get eval run artifactsllmEvalsGetRun- Get an eval runllmEvalsGetSampleAudio- Get eval sample audiollmEvalsGetSchedule- Get an eval schedulellmEvalsGetSuite- Get an eval suitellmEvalsGetSuiteVersion- Get an eval suite versionllmEvalsImportHistoricalResults- Import historical eval results from Hugging FacellmEvalsListRuns- List eval runsllmEvalsListSamples- List eval samplesllmEvalsListScheduleRuns- List runs created by an eval schedulellmEvalsListSchedules- List eval schedulesllmEvalsListSuiteLeaderboardRuns- List leaderboard runs for an eval suitellmEvalsListSuites- List eval suitesllmEvalsListSuiteVersions- List eval suite versionsllmEvalsRerunFailedSamples- Rerun failed eval samplesllmEvalsRetryFailedRun- Retry an eval runllmEvalsTriggerSchedule- Trigger an eval schedule nowllmEvalsUpdateSchedule- Update an eval schedulellmExtractCreateSchema- Create reusable extraction schema templatellmExtractDeleteSchema- Delete extraction schema by IDllmExtractExtract- Extract structured data with inline JSON SchemallmExtractExtractWithSchema- Extract data using saved schema templatellmExtractGetSchema- Get extraction schema by IDllmExtractUpdateSchema- Update extraction schema by IDllmFeedbackBatchGetCompletionFeedback- Batch retrieve feedback for multiple completionsllmFeedbackBatchGetResponseFeedback- Batch retrieve feedback for multiple responsesllmFeedbackCreateCompletionFeedback- Submit feedback for chat completionllmFeedbackCreateResponseFeedback- Submit feedback for responsellmFeedbackExportCompletionFeedback- Export completion feedback as CSVllmFeedbackExportResponseFeedback- Export response feedback as CSVllmFeedbackGetCompletionFeedback- Retrieve feedback by completion IDllmFeedbackGetExportStatus- Get feedback export statusllmFeedbackGetResponseFeedback- Retrieve feedback by response IDllmFeedbackListCompletionFeedback- List chat completion feedbackllmFeedbackListResponseFeedback- List response feedbackllmFeedbackStartExport- Start feedback exportllmFeedbackUpdateCompletionFeedback- Update existing completion feedbackllmFeedbackUpdateResponseFeedback- Update existing response feedbackllmFilesContent- Retrieve file contentllmFilesDelete- Delete filellmFilesGet- Retrieve filellmFilesList- List filesllmFilesUpload- Upload filellmFineTuningCancel- Cancel a fine-tuning jobllmFineTuningCreate- Create a fine-tuning jobllmFineTuningList- List fine-tuning jobsllmFineTuningListCheckpoints- List fine-tuning checkpointsllmFineTuningListEvents- List fine-tuning eventsllmFineTuningPause- Pause a fine-tuning jobllmFineTuningResume- Resume a fine-tuning jobllmFineTuningRetrieve- Retrieve a fine-tuning jobllmImagesCreate- Generate images from text descriptionsllmMcpVaultCreateCredential- Create MCP credentialllmMcpVaultCreateServer- Create MCP serverllmMcpVaultDeleteCredential- Delete MCP credentialllmMcpVaultDeleteServer- Delete MCP serverllmMcpVaultGetServer- Retrieve MCP serverllmMcpVaultListCredentials- List MCP credentialsllmMcpVaultListServers- List MCP serversllmMcpVaultTestServer- Test MCP serverllmMcpVaultUpdateServer- Update MCP serverllmMemoryStoresCreate- Create memory storellmMemoryStoresCreateEntry- Create memory entryllmMemoryStoresDelete- Delete memory storellmMemoryStoresDeleteEntry- Delete memory entryllmMemoryStoresGet- Retrieve memory storellmMemoryStoresGetEntry- Retrieve memory entryllmMemoryStoresList- List memory storesllmMemoryStoresListEntries- List memory entriesllmMemoryStoresUpdate- Update memory storellmMemoryStoresUpdateEntry- Update memory entryllmModelsActivateRegistryEntry- Activate a catalog entryllmModelsAddCatalogEntry- Define a BYO catalog modelllmModelsAddCatalogOrgAccess- Add cluster model access for an organizationllmModelsCheckCatalogHealth- Check a BYO catalog model's healthllmModelsClearClusterPrice- Clear a cluster-default model pricellmModelsClearOrgPrice- Clear an org price overridellmModelsDeactivateRegistryEntry- Deactivate a model registry namellmModelsDeleteCatalogEntry- Remove a BYO catalog modelllmModelsDeleteOrgAutoModel- Clear this org's auto-model override for an endpointllmModelsGet- Retrieve a modelllmModelsGetClusterCurrency- Get the cluster currencyllmModelsList- List available modelsllmModelsListCatalog- List the organization's model catalogllmModelsListCatalogModelAccess- List organizations with access to a cluster modelllmModelsListCatalogOrgAccess- List an organization's cluster model accessllmModelsListClusterPrices- List cluster-default model pricesllmModelsListEffectivePrices- List effective prices for the caller's modelsllmModelsListOrgAutoModels- List this org's auto-model overridesllmModelsListOrgPrices- List an org's price overridesllmModelsListRegistry- List the organization's active model registryllmModelsPutOrgAutoModel- Set this org's auto-model override for an endpointllmModelsReplaceCatalogOrgAccess- Replace an organization's cluster model accessllmModelsSetClusterCurrency- Set the cluster currencyllmModelsSetClusterPrice- Set a cluster-default model pricellmModelsSetOrgPrice- Set an org price overridellmModelsUpdateCatalogEntry- Update a BYO catalog modelllmPromptsCreate- Create a promptllmPromptsCreateVersion- Create a new versionllmPromptsDelete- Delete a promptllmPromptsGet- Get a promptllmPromptsGetVersion- Get a specific versionllmPromptsList- List promptsllmPromptsListVersions- List versionsllmPromptsRollback- Rollback to a versionllmPromptsUpdate- Update a promptllmResponsesCancel- Cancel an in-progress background responsellmResponsesCompact- Compact a conversationllmResponsesCreate- Create an agent-powered response with tool supportllmResponsesDelete- Permanently delete a response and its datallmResponsesGet- Retrieve response by ID with status and resultsllmResponsesList- List all responses with paginationllmResponsesListInputItems- List paginated input items for a responsellmResponsesUpdate- Update a responsellmResponsesWake- Wake a sleeping background responsellmSkillsContent- Download skill contentllmSkillsCreate- Create skillllmSkillsCreateVersion- Create skill versionllmSkillsDelete- Delete skillllmSkillsDeleteVersion- Delete skill versionllmSkillsGet- Retrieve skillllmSkillsGetVersion- Retrieve skill versionllmSkillsList- List skillsllmSkillsListPreconfigured- List preconfigured skillsllmSkillsListVersions- List skill versionsllmSkillsUpdate- Update skillllmSkillsVersionContent- Download skill version contentllmSpeechDeleteTranscriptionHistory- Delete speech-to-text history itemllmSpeechDeleteTtsHistory- Delete text-to-speech history itemllmSpeechGetTranscriptionHistory- Retrieve speech-to-text history itemllmSpeechGetTranscriptionHistoryContent- Retrieve speech-to-text audiollmSpeechGetTtsHistory- Retrieve text-to-speech history itemllmSpeechGetTtsHistoryContent- Retrieve text-to-speech audiollmSpeechListTranscriptionHistory- List speech-to-text historyllmSpeechListTtsHistory- List text-to-speech historyllmSpeechLivekitToken- Generate LiveKit room tokenllmSpeechSpeak- Text to speechllmSpeechSpeakStreaming- Streaming text to speechllmSpeechTranscribe- Speech to text transcriptionllmUsageClassify- Get classify usagellmUsageCompletions- Get completions usagellmUsageConversations- Get conversations usagellmUsageCosts- Get cost by modelllmUsageEmbeddings- Get embeddings usagellmUsageExtract- Get extract usagellmUsageFiles- Get files usagellmUsageResponses- Get responses usagellmUsageVectorStores- Get vector stores usagellmVectorStoresCancelFileBatch- Cancel batch file processingllmVectorStoresCreate- Create a vector storellmVectorStoresCreateFile- Add a file to a vector storellmVectorStoresCreateFileBatch- Batch add multiple files to vector storellmVectorStoresDelete- Delete a vector storellmVectorStoresDeleteFile- Remove file from vector storellmVectorStoresGet- Retrieve a vector storellmVectorStoresGetFile- Retrieve a vector store filellmVectorStoresGetFileBatch- Retrieve file batch statusllmVectorStoresGetFileContent- Retrieve parsed file contentllmVectorStoresList- List vector storesllmVectorStoresListFiles- List files in a vector storellmVectorStoresListFilesInBatch- List files in a batchllmVectorStoresSearch- Search a vector storellmVectorStoresUpdate- Modify a vector storellmVectorStoresUpdateFile- Update file attributespermissionsLlmCheck- Check user permissionpermissionsLlmGrant- Grant permission to a user or make publicpermissionsLlmRevoke- Revoke permission from a user or remove public accessreposCreate- Create a repositoryreposDelete- Delete a repositoryreposGet- Get a repositoryreposList- List the caller's org's repositoriesreposUpdate- Update a repository's labelssandboxCreate- Create SessionsandboxDownloadArchive- Download Workspace ArchivesandboxDownloadFile- Download Workspace FilesandboxGet- Get SessionsandboxGetBrowserUrl- Get Browser Session URLsandboxGetPricing- Get Sandbox PricingsandboxGetWorkspace- Get Workspace ManifestsandboxList- List SessionssandboxProxyBrowserPortRequest- Proxy Browser Port RequestsandboxRunCode- Run CodesandboxRunCommand- Run CommandsandboxSetPricing- Set Sandbox PricingsandboxTerminate- Terminate SessionsandboxUploadArchive- Upload Workspace ArchivesandboxUploadFile- Upload Workspace Fileschema3OtherReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePost- Read CloneusageCosts- Aggregate cost by dimensionusageSandbox- Get Sandbox Usage- Exchange API key for a JWT token ⚠️ Deprecated UseauthApiKeyGetJwtFromKeyauthApiKeysExchangeTokeninstead.- [Deprecated] Chat completions for OpenAI SDK/client usage ⚠️ DeprecatedllmChatCreateChat- [Deprecated] Streaming chat completions for generated SDK usage ⚠️ DeprecatedllmChatStream- Get Browser Session URL (Deprecated) ⚠️ Deprecated UsesandboxGetUrlsandboxGetBrowserUrlinstead.
React hooks with TanStack Query
React hooks built on TanStack Query are included in this SDK. These hooks and the utility functions provided alongside them can be used to build rich applications that pull data from the API using one of the most popular asynchronous state management library.
To learn about this feature and how to get started, check REACT_QUERY.md.
WARNING
This feature is currently in preview and is subject to breaking changes within the current major version of the SDK as we gather user feedback on it.
Available React hooks
useAgentConnectorsActivateAgentConnectorMutation- Activate a connectoruseAgentConnectorsCreateAgentConnectorMutation- Create a connectoruseAgentConnectorsDeleteAgentConnectorMutation- Delete a connectoruseAgentConnectorsGetAgentConnector- Retrieve a connectoruseAgentConnectorsListAgentConnectors- List connectors for an agentuseAgentConnectorsSetupWhatsAppAppWebhookMutation- Set up a WhatsApp app webhook (Beta)useAgentRunsCreateAgentRunMutation- Start a saved agent runuseAgentRunsDecideAgentRunMcpApprovalMutation- Approve or deny a pending MCP tool calluseAgentRunsGetAgentRun- Retrieve an agent runuseAgentRunsListAgentRuns- List runs for an agentuseAgentRunsStreamAgentRunEvents- Stream agent run eventsuseAgentRunsWakeAgentRunMutation- Wake a sleeping agent runuseAgentSchedulesCreateAgentScheduleMutation- Create an agent scheduleuseAgentSchedulesDeleteAgentScheduleMutation- Delete an agent scheduleuseAgentSchedulesGetAgentSchedule- Retrieve an agent scheduleuseAgentSchedulesListAgentSchedules- List schedules for an agentuseAgentSchedulesPauseAgentScheduleMutation- Pause an agent scheduleuseAgentSchedulesResumeAgentScheduleMutation- Resume an agent scheduleuseAgentSchedulesUpdateAgentScheduleMutation- Update an agent scheduleuseAgentsCreateAgentMutation- Create an agentuseAgentsDeleteAgentMutation- Delete an agentuseAgentsGetAgent- Retrieve an agentuseAgentsListAgents- List agentsuseAgentsUpdateAgentMutation- Update an agentuseAgentVersionsGetAgentVersion- Retrieve an agent versionuseAgentVersionsListAgentVersions- List agent versionsuseAgentVersionsRollbackAgentVersionMutation- Roll back an agent to a versionuseAuthApiKeysCreateMutation- Mint a scoped API keyuseAuthApiKeysExchangeTokenMutation- Exchange API key for a JWT tokenuseAuthApiKeysList- List scoped API keysuseAuthApiKeysRegenerateMutation- Rotate a scoped API key's secretuseAuthApiKeysUpdateMutation- Update a scoped API keyuseAuthClusterAcceptInviteMutation- Accept a cluster invitation (public)useAuthClusterCreateInviteMutation- Create a cluster invitationuseAuthClusterDeleteOrgMutation- Soft-delete an organizationuseAuthClusterGetOrg- Get an organizationuseAuthClusterInviteInfo- Read cluster-invite info (public)useAuthClusterListInvites- List cluster invitationsuseAuthClusterListOrgs- List all organizationsuseAuthClusterReissueOwnerKeyMutation- Re-issue an org owner key (recovery)useAuthClusterRevokeInviteMutation- Revoke a cluster invitationuseAuthClusterSuspendOrgMutation- Suspend an organizationuseAuthClusterUnsuspendOrgMutation- Unsuspend an organizationuseAuthOrgsGetQuota- Get an org's usage quotauseAuthOrgsGetRateLimit- Get an org's rate limituseAuthOrgsUpdateQuotaMutation- Set an org's usage quota (cluster-admin)useAuthOrgsUpdateRateLimitMutation- Set an org's rate limit (cluster-admin)useAuthServiceAccountsCreateMutation- Create a service accountuseAuthServiceAccountsDeleteApiKeyMutation- Delete a service-account API keyuseAuthServiceAccountsDeleteMutation- Delete a service accountuseAuthServiceAccountsGet- Get a service accountuseAuthServiceAccountsList- List service accountsuseAuthServiceAccountsListApiKeys- List a service account's API keysuseAuthServiceAccountsRegenerateApiKeyMutation- Rotate a service-account API key's secretuseAuthServiceAccountsUpdateApiKeyMutation- Update a service-account API keyuseAuthTeamsAddMemberMutation- Add a team memberuseAuthTeamsCreateMutation- Create a teamuseAuthTeamsDeleteMutation- Delete a teamuseAuthTeamsGet- Get a teamuseAuthTeamsList- List teams in an orguseAuthTeamsListMembers- List team membersuseAuthTeamsRemoveMemberMutation- Remove a team memberuseAuthTeamsUpdateMutation- Rename a teamuseBudgetsApiKeyEvents- List apikey budget eventsuseBudgetsDeleteApiKeyMutation- Delete an apikey budgetuseBudgetsDeleteOrgMutation- Delete an org budgetuseBudgetsGetApiKey- List apikey budgetsuseBudgetsGetCurrency- Get display currencyuseBudgetsGetOrg- List org budgetsuseBudgetsList- List budgetsuseBudgetsOrgEvents- List org budget eventsuseBudgetsSetApiKeyMutation- Set an apikey budgetuseBudgetsSetCurrencyMutation- Set display currencyuseBudgetsSetOrgMutation- Set an org budgetuseComputeCatalogCreateComputeQuoteMutation- Create a quoteuseComputeCatalogGetAccelerator- Get an acceleratoruseComputeCatalogListAccelerators- List acceleratorsuseComputeCatalogListComputeOffers- List provider offersuseComputeCatalogListComputeProviders- List provider healthuseComputeJobsCreateJobMutation- Create a jobuseComputeJobsGetJob- Get a jobuseComputeJobsListJobEvents- List job eventsuseComputeJobsListJobInstances- List observed job instancesuseComputeJobsListJobLogs- List job logsuseComputeJobsListJobs- List jobsuseComputeJobsTerminateJobMutation- Terminate a jobuseComputeSecretsCreateComputeSecretMutation- Create a secretuseComputeSecretsDeleteComputeSecretMutation- Delete a secretuseComputeSecretsGetComputeSecret- Get a secretuseComputeSecretsListComputeSecrets- List secretsuseComputeServicesCreateServiceMutation- Create a serviceuseComputeServicesGetService- Get a serviceuseComputeServicesListServiceEvents- List service eventsuseComputeServicesListServiceInstances- List observed service instancesuseComputeServicesListServiceLogs- List service logsuseComputeServicesListServices- List servicesuseComputeServicesTerminateServiceMutation- Terminate a serviceuseComputeTenantsGetComputeTenant- Get a tenantuseComputeTenantsListComputeTenants- List tenantsuseComputeTenantsPutComputeTenantMutation- Update a tenantuseComputeUsageGetComputeUsage- Get usageuseGuardrailsDeleteGuardrailsMutation- Delete guardrails policyuseGuardrailsGetGuardrails- Get effective guardrailsuseGuardrailsListGuardrailsPolicies- List guardrails policiesuseGuardrailsTestGuardrailsMutation- Test content against guardrailsuseGuardrailsUpdateGuardrailsMutation- Update guardrails policyuseLlmBatchesCancelMutation- Cancel a batchuseLlmBatchesCreateMutation- Create a batchuseLlmBatchesGet- Get a batchuseLlmBatchesList- List batchesuseLlmClassifyClassifyMutation- Classify text into predefined categoriesuseLlmConversationsCreateItemsMutation- Create conversation itemsuseLlmConversationsCreateMutation- Create a conversationuseLlmConversationsDeleteItemMutation- Delete a conversation itemuseLlmConversationsDeleteItemsMutation- Delete multiple conversation itemsuseLlmConversationsDeleteMutation- Delete a conversationuseLlmConversationsGet- Retrieve a conversationuseLlmConversationsGetItem- Retrieve a conversation itemuseLlmConversationsList- List conversationsuseLlmConversationsListItems- List conversation itemsuseLlmConversationsUpdateMutation- Update a conversationuseLlmEmbeddingsEmbedMutation- Create text embeddingsuseLlmEmbeddingsListModels- List available embedding modelsuseLlmEvalsCancelRunMutation- Cancel an eval runuseLlmEvalsCreateRunMutation- Create an eval runuseLlmEvalsCreateScheduleMutation- Create an eval scheduleuseLlmEvalsCreateSuiteMutation- Create an eval suiteuseLlmEvalsCreateSuiteVersionMutation- Create an eval suite versionuseLlmEvalsDeleteRunMutation- Delete an eval runuseLlmEvalsDeleteScheduleMutation- Delete an eval scheduleuseLlmEvalsDeleteSuiteMutation- Delete an eval suiteuseLlmEvalsGetArtifacts- Get eval run artifactsuseLlmEvalsGetRun- Get an eval runuseLlmEvalsGetSampleAudio- Get eval sample audiouseLlmEvalsGetSchedule- Get an eval scheduleuseLlmEvalsGetSuite- Get an eval suiteuseLlmEvalsGetSuiteVersion- Get an eval suite versionuseLlmEvalsImportHistoricalResultsMutation- Import historical eval results from Hugging FaceuseLlmEvalsListRuns- List eval runsuseLlmEvalsListSamples- List eval samplesuseLlmEvalsListScheduleRuns- List runs created by an eval scheduleuseLlmEvalsListSchedules- List eval schedulesuseLlmEvalsListSuiteLeaderboardRuns- List leaderboard runs for an eval suiteuseLlmEvalsListSuites- List eval suitesuseLlmEvalsListSuiteVersions- List eval suite versionsuseLlmEvalsRerunFailedSamplesMutation- Rerun failed eval samplesuseLlmEvalsRetryFailedRunMutation- Retry an eval runuseLlmEvalsTriggerScheduleMutation- Trigger an eval schedule nowuseLlmEvalsUpdateScheduleMutation- Update an eval scheduleuseLlmExtractCreateSchemaMutation- Create reusable extraction schema templateuseLlmExtractDeleteSchemaMutation- Delete extraction schema by IDuseLlmExtractExtractMutation- Extract structured data with inline JSON SchemauseLlmExtractExtractWithSchemaMutation- Extract data using saved schema templateuseLlmExtractGetSchema- Get extraction schema by IDuseLlmExtractUpdateSchemaMutation- Update extraction schema by IDuseLlmFeedbackBatchGetCompletionFeedbackMutation- Batch retrieve feedback for multiple completionsuseLlmFeedbackBatchGetResponseFeedbackMutation- Batch retrieve feedback for multiple responsesuseLlmFeedbackCreateCompletionFeedbackMutation- Submit feedback for chat completionuseLlmFeedbackCreateResponseFeedbackMutation- Submit feedback for responseuseLlmFeedbackExportCompletionFeedback- Export completion feedback as CSVuseLlmFeedbackExportResponseFeedback- Export response feedback as CSVuseLlmFeedbackGetCompletionFeedback- Retrieve feedback by completion IDuseLlmFeedbackGetExportStatus- Get feedback export statususeLlmFeedbackGetResponseFeedback- Retrieve feedback by response IDuseLlmFeedbackListCompletionFeedback- List chat completion feedbackuseLlmFeedbackListResponseFeedback- List response feedbackuseLlmFeedbackStartExportMutation- Start feedback exportuseLlmFeedbackUpdateCompletionFeedbackMutation- Update existing completion feedbackuseLlmFeedbackUpdateResponseFeedbackMutation- Update existing response feedbackuseLlmFilesContent- Retrieve file contentuseLlmFilesDeleteMutation- Delete fileuseLlmFilesGet- Retrieve fileuseLlmFilesList- List filesuseLlmFilesUploadMutation- Upload fileuseLlmFineTuningCancelMutation- Cancel a fine-tuning jobuseLlmFineTuningCreateMutation- Create a fine-tuning jobuseLlmFineTuningList- List fine-tuning jobsuseLlmFineTuningListCheckpoints- List fine-tuning checkpointsuseLlmFineTuningListEvents- List fine-tuning eventsuseLlmFineTuningPauseMutation- Pause a fine-tuning jobuseLlmFineTuningResumeMutation- Resume a fine-tuning jobuseLlmFineTuningRetrieve- Retrieve a fine-tuning jobuseLlmImagesCreateMutation- Generate images from text descriptionsuseLlmMcpVaultCreateCredentialMutation- Create MCP credentialuseLlmMcpVaultCreateServerMutation- Create MCP serveruseLlmMcpVaultDeleteCredentialMutation- Delete MCP credentialuseLlmMcpVaultDeleteServerMutation- Delete MCP serveruseLlmMcpVaultGetServer- Retrieve MCP serveruseLlmMcpVaultListCredentials- List MCP credentialsuseLlmMcpVaultListServers- List MCP serversuseLlmMcpVaultTestServerMutation- Test MCP serveruseLlmMcpVaultUpdateServerMutation- Update MCP serveruseLlmMemoryStoresCreateEntryMutation- Create memory entryuseLlmMemoryStoresCreateMutation- Create memory storeuseLlmMemoryStoresDeleteEntryMutation- Delete memory entryuseLlmMemoryStoresDeleteMutation- Delete memory storeuseLlmMemoryStoresGet- Retrieve memory storeuseLlmMemoryStoresGetEntry- Retrieve memory entryuseLlmMemoryStoresList- List memory storesuseLlmMemoryStoresListEntries- List memory entriesuseLlmMemoryStoresUpdateEntryMutation- Update memory entryuseLlmMemoryStoresUpdateMutation- Update memory storeuseLlmModelsActivateRegistryEntryMutation- Activate a catalog entryuseLlmModelsAddCatalogEntryMutation- Define a BYO catalog modeluseLlmModelsAddCatalogOrgAccessMutation- Add cluster model access for an organizationuseLlmModelsCheckCatalogHealthMutation- Check a BYO catalog model's healthuseLlmModelsClearClusterPriceMutation- Clear a cluster-default model priceuseLlmModelsClearOrgPriceMutation- Clear an org price overrideuseLlmModelsDeactivateRegistryEntryMutation- Deactivate a model registry nameuseLlmModelsDeleteCatalogEntryMutation- Remove a BYO catalog modeluseLlmModelsDeleteOrgAutoModelMutation- Clear this org's auto-model override for an endpointuseLlmModelsGet- Retrieve a modeluseLlmModelsGetClusterCurrency- Get the cluster currencyuseLlmModelsList- List available modelsuseLlmModelsListCatalog- List the organization's model cataloguseLlmModelsListCatalogModelAccess- List organizations with access to a cluster modeluseLlmModelsListCatalogOrgAccess- List an organization's cluster model accessuseLlmModelsListClusterPrices- List cluster-default model pricesuseLlmModelsListEffectivePrices- List effective prices for the caller's modelsuseLlmModelsListOrgAutoModels- List this org's auto-model overridesuseLlmModelsListOrgPrices- List an org's price overridesuseLlmModelsListRegistry- List the organization's active model registryuseLlmModelsPutOrgAutoModelMutation- Set this org's auto-model override for an endpointuseLlmModelsReplaceCatalogOrgAccessMutation- Replace an organization's cluster model accessuseLlmModelsSetClusterCurrencyMutation- Set the cluster currencyuseLlmModelsSetClusterPriceMutation- Set a cluster-default model priceuseLlmModelsSetOrgPriceMutation- Set an org price overrideuseLlmModelsUpdateCatalogEntryMutation- Update a BYO catalog modeluseLlmPromptsCreateMutation- Create a promptuseLlmPromptsCreateVersionMutation- Create a new versionuseLlmPromptsDeleteMutation- Delete a promptuseLlmPromptsGet- Get a promptuseLlmPromptsGetVersion- Get a specific versionuseLlmPromptsList- List promptsuseLlmPromptsListVersions- List versionsuseLlmPromptsRollbackMutation- Rollback to a versionuseLlmPromptsUpdateMutation- Update a promptuseLlmResponsesCancelMutation- Cancel an in-progress background responseuseLlmResponsesCompactMutation- Compact a conversationuseLlmResponsesCreateMutation- Create an agent-powered response with tool supportuseLlmResponsesDeleteMutation- Permanently delete a response and its datauseLlmResponsesGet- Retrieve response by ID with status and resultsuseLlmResponsesList- List all responses with paginationuseLlmResponsesListInputItems- List paginated input items for a responseuseLlmResponsesUpdateMutation- Update a responseuseLlmResponsesWakeMutation- Wake a sleeping background responseuseLlmSkillsContent- Download skill contentuseLlmSkillsCreateMutation- Create skilluseLlmSkillsCreateVersionMutation- Create skill versionuseLlmSkillsDeleteMutation- Delete skilluseLlmSkillsDeleteVersionMutation- Delete skill versionuseLlmSkillsGet- Retrieve skilluseLlmSkillsGetVersion- Retrieve skill versionuseLlmSkillsList- List skillsuseLlmSkillsListPreconfigured- List preconfigured skillsuseLlmSkillsListVersions- List skill versionsuseLlmSkillsUpdateMutation- Update skilluseLlmSkillsVersionContent- Download skill version contentuseLlmSpeechDeleteTranscriptionHistoryMutation- Delete speech-to-text history itemuseLlmSpeechDeleteTtsHistoryMutation- Delete text-to-speech history itemuseLlmSpeechGetTranscriptionHistory- Retrieve speech-to-text history itemuseLlmSpeechGetTranscriptionHistoryContent- Retrieve speech-to-text audiouseLlmSpeechGetTtsHistory- Retrieve text-to-speech history itemuseLlmSpeechGetTtsHistoryContent- Retrieve text-to-speech audiouseLlmSpeechListTranscriptionHistory- List speech-to-text historyuseLlmSpeechListTtsHistory- List text-to-speech historyuseLlmSpeechLivekitTokenMutation- Generate LiveKit room tokenuseLlmSpeechSpeakMutation- Text to speechuseLlmSpeechSpeakStreamingMutation- Streaming text to speechuseLlmSpeechTranscribeMutation- Speech to text transcriptionuseLlmUsageClassify- Get classify usageuseLlmUsageCompletions- Get completions usageuseLlmUsageConversations- Get conversations usageuseLlmUsageCosts- Get cost by modeluseLlmUsageEmbeddings- Get embeddings usageuseLlmUsageExtract- Get extract usageuseLlmUsageFiles- Get files usageuseLlmUsageResponses- Get responses usageuseLlmUsageVectorStores- Get vector stores usageuseLlmVectorStoresCancelFileBatchMutation- Cancel batch file processinguseLlmVectorStoresCreateFileBatchMutation- Batch add multiple files to vector storeuseLlmVectorStoresCreateFileMutation- Add a file to a vector storeuseLlmVectorStoresCreateMutation- Create a vector storeuseLlmVectorStoresDeleteFileMutation- Remove file from vector storeuseLlmVectorStoresDeleteMutation- Delete a vector storeuseLlmVectorStoresGet- Retrieve a vector storeuseLlmVectorStoresGetFile- Retrieve a vector store fileuseLlmVectorStoresGetFileBatch- Retrieve file batch statususeLlmVectorStoresGetFileContent- Retrieve parsed file contentuseLlmVectorStoresList- List vector storesuseLlmVectorStoresListFiles- List files in a vector storeuseLlmVectorStoresListFilesInBatch- List files in a batchuseLlmVectorStoresSearchMutation- Search a vector storeuseLlmVectorStoresUpdateFileMutation- Update file attributesuseLlmVectorStoresUpdateMutation- Modify a vector storeusePermissionsLlmCheck- Check user permissionusePermissionsLlmGrantMutation- Grant permission to a user or make publicusePermissionsLlmRevokeMutation- Revoke permission from a user or remove public accessuseReposCreateMutation- Create a repositoryuseReposDeleteMutation- Delete a repositoryuseReposGet- Get a repositoryuseReposList- List the caller's org's repositoriesuseReposUpdateMutation- Update a repository's labelsuseSandboxCreateMutation- Create SessionuseSandboxDownloadArchiveMutation- Download Workspace ArchiveuseSandboxDownloadFile- Download Workspace FileuseSandboxGet- Get SessionuseSandboxGetBrowserUrl- Get Browser Session URLuseSandboxGetPricing- Get Sandbox PricinguseSandboxGetWorkspace- Get Workspace ManifestuseSandboxList- List SessionsuseSandboxProxyBrowserPortRequest- Proxy Browser Port RequestuseSandboxRunCodeMutation- Run CodeuseSandboxRunCommandMutation- Run CommanduseSandboxSetPricingMutation- Set Sandbox PricinguseSandboxTerminateMutation- Terminate SessionuseSandboxUploadArchiveMutation- Upload Workspace ArchiveuseSandboxUploadFileMutation- Upload Workspace FileuseSchema3OtherReadCloneApiV1SandboxSessionsSessionIdGithubReadClonePostMutation- Read CloneuseUsageCosts- Aggregate cost by dimensionuseUsageSandbox- Get Sandbox Usage- Exchange API key for a JWT token ⚠️ Deprecated UseuseAuthApiKeyGetJwtFromKeyMutationuseAuthApiKeysExchangeTokenMutationinstead.- [Deprecated] Chat completions for OpenAI SDK/client usage ⚠️ DeprecateduseLlmChatCreateChatMutation- [Deprecated] Streaming chat completions for generated SDK usage ⚠️ DeprecateduseLlmChatStreamMutation- Get Browser Session URL (Deprecated) ⚠️ Deprecated UseuseSandboxGetUrluseSandboxGetBrowserUrlinstead.
Server-sent event streaming
Server-sent events are used to stream content from certain operations. These operations will expose the stream as an async iterable that can be consumed using a for await...of loop. The loop will terminate when the server no longer has any events to send and closes the underlying connection.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.responses.create({
responsesCreateRequest: {
model: "meetkai:functionary-urdu-mini-pak",
input: "What is the capital of France?",
},
});
console.log(result);
}
run();File uploads
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
TIP
Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
- Node.js v20+: Since v20, Node.js comes with a native
openAsBlobfunction innode:fs. - Bun: The native
Bun.filefunction produces a file handle that can be used for streaming file uploads. - Browsers: All supported browsers return an instance to a
Filewhen reading the value from an<input type="file">element. - Node.js v18: A file stream can be created using the
fileFromhelper fromfetch-blob/from.js.
import { SDK } from "@meetkai/mka1";
import { openAsBlob } from "node:fs";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.files.upload({
requestBody: {
file: await openAsBlob("example.file"),
purpose: "assistants",
},
});
console.log(result);
}
run();Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
}, {
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});
}
run();If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
});
}
run();Error Handling
SDKError is the base class for all HTTP error responses. It has the following properties:
| Property | Type | Description |
|---|---|---|
error.message | string | Error message |
error.statusCode | number | HTTP response status code eg 404 |
error.headers | Headers | HTTP response headers |
error.body | string | HTTP body. Can be empty string if no body is returned. |
error.rawResponse | Response | Raw HTTP response |
error.data$ | Optional. Some errors may contain structured data. See Error Classes. |
Example
import { SDK } from "@meetkai/mka1";
import * as errors from "@meetkai/mka1/models/errors";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
try {
const result = await sdk.llm.files.content({
fileId: "file-abc123",
});
console.log(result);
} catch (error) {
// The base class for HTTP error responses
if (error instanceof errors.SDKError) {
console.log(error.message);
console.log(error.statusCode);
console.log(error.body);
console.log(error.headers);
// Depending on the method different errors may be thrown
if (error instanceof errors.GetFileContentResponseBody) {
console.log(error.data$.error); // errors.GetFileContentLlmFilesResponse400Error
}
}
}
}
run();Error Classes
Primary error:
SDKError: The base class for HTTP error responses.
Less common errors (232)
Network errors:
ConnectionError: HTTP client was unable to make a request to a server.RequestTimeoutError: HTTP request timed out due to an AbortSignal signal.RequestAbortedError: HTTP request was aborted by the client.InvalidRequestError: Any input used to create a request is invalid.UnexpectedClientError: Unrecognised or unexpected error.
Inherit from SDKError:
ErrorEnvelope: Error response. Applicable to 27 of 325 methods.*HTTPValidationError: Validation Error. Status code422. Applicable to 17 of 325 methods.*RepoError: The uniform error envelope.erroris a stable machine-readable code (never an internal reason);correlation_idechoes the request'sX-Correlation-IDfor log correlation. Applicable to 5 of 325 methods.*GetFileContentResponseBody: Invalid request - File ID is required. Status code400. Applicable to 1 of 325 methods.*CreateScopedApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListScopedApiKeysResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UpdateScopedApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*CreateTeamResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListTeamsResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetTeamResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UpdateTeamResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*DeleteTeamResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*AddTeamMemberResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListTeamMembersResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*RemoveTeamMemberResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*CreateServiceAccountResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListServiceAccountsResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetServiceAccountResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*DeleteServiceAccountResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetOrgQuotaResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UpdateOrgQuotaResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetOrgRateLimitResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UpdateOrgRateLimitResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*CreateClusterInviteResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListClusterInvitesResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*RevokeClusterInviteResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ListClusterOrgsResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetClusterOrgResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*DeleteClusterOrgResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*SuspendClusterOrgResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*UnsuspendClusterOrgResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*ReissueOwnerKeyResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*GetClusterInviteInfoResponseBody: Bad request. Status code400. Applicable to 1 of 325 methods.*AcceptClusterInviteResponseBody: Bad request.code: "reserved_org_slug"distinguishes a slug that nobody may hold from the 409 returned when another org already holds it. Status code400. Applicable to 1 of 325 methods.*GetJwtFromKeyResponseBody: Invalid request body. Status code400. Applicable to 1 of 325 methods.*GetFileContentLlmFilesResponseBody: Unauthorized - Invalid or missing authentication. Status code401. Applicable to 1 of 325 methods.*CreateScopedApiKeyAuthApiKeysResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListScopedApiKeysAuthApiKeysResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UpdateScopedApiKeyAuthApiKeysResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyAuthApiKeysResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenAuthApiKeysResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*CreateTeamAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListTeamsAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetTeamAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UpdateTeamAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*DeleteTeamAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*AddTeamMemberAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListTeamMembersAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*RemoveTeamMemberAuthTeamsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*CreateServiceAccountAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListServiceAccountsAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetServiceAccountAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*DeleteServiceAccountAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyAuthServiceAccountsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetOrgQuotaAuthOrgsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UpdateOrgQuotaAuthOrgsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetOrgRateLimitAuthOrgsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UpdateOrgRateLimitAuthOrgsResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*CreateClusterInviteAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListClusterInvitesAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*RevokeClusterInviteAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ListClusterOrgsAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetClusterOrgAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*DeleteClusterOrgAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*SuspendClusterOrgAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*UnsuspendClusterOrgAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*ReissueOwnerKeyAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetClusterInviteInfoAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*AcceptClusterInviteAuthClusterResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*GetJwtFromKeyAuthApiKeyResponseBody: Unauthorized. Status code401. Applicable to 1 of 325 methods.*CreateScopedApiKeyAuthApiKeysResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListScopedApiKeysAuthApiKeysResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UpdateScopedApiKeyAuthApiKeysResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyAuthApiKeysResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenAuthApiKeysResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*CreateTeamAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListTeamsAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetTeamAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UpdateTeamAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*DeleteTeamAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*AddTeamMemberAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListTeamMembersAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*RemoveTeamMemberAuthTeamsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*CreateServiceAccountAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListServiceAccountsAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetServiceAccountAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*DeleteServiceAccountAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyAuthServiceAccountsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetOrgQuotaAuthOrgsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UpdateOrgQuotaAuthOrgsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetOrgRateLimitAuthOrgsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UpdateOrgRateLimitAuthOrgsResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*CreateClusterInviteAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListClusterInvitesAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*RevokeClusterInviteAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ListClusterOrgsAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetClusterOrgAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*DeleteClusterOrgAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*SuspendClusterOrgAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*UnsuspendClusterOrgAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*ReissueOwnerKeyAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetClusterInviteInfoAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*AcceptClusterInviteAuthClusterResponseResponseBody: Forbidden. Status code403. Applicable to 1 of 325 methods.*GetFileContentLlmFilesResponseResponseBody: File not found. Status code404. Applicable to 1 of 325 methods.*CreateScopedApiKeyAuthApiKeysResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListScopedApiKeysAuthApiKeysResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UpdateScopedApiKeyAuthApiKeysResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyAuthApiKeysResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenAuthApiKeysResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*CreateTeamAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListTeamsAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetTeamAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UpdateTeamAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*DeleteTeamAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*AddTeamMemberAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListTeamMembersAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*RemoveTeamMemberAuthTeamsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*CreateServiceAccountAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListServiceAccountsAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetServiceAccountAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*DeleteServiceAccountAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyAuthServiceAccountsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetOrgQuotaAuthOrgsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UpdateOrgQuotaAuthOrgsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetOrgRateLimitAuthOrgsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UpdateOrgRateLimitAuthOrgsResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*CreateClusterInviteAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListClusterInvitesAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*RevokeClusterInviteAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ListClusterOrgsAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetClusterOrgAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*DeleteClusterOrgAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*SuspendClusterOrgAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*UnsuspendClusterOrgAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*ReissueOwnerKeyAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*GetClusterInviteInfoAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*AcceptClusterInviteAuthClusterResponse404ResponseBody: Not found. Status code404. Applicable to 1 of 325 methods.*CreateScopedApiKeyAuthApiKeysResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListScopedApiKeysAuthApiKeysResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UpdateScopedApiKeyAuthApiKeysResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyAuthApiKeysResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenAuthApiKeysResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*CreateTeamAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListTeamsAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetTeamAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UpdateTeamAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*DeleteTeamAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*AddTeamMemberAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListTeamMembersAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*RemoveTeamMemberAuthTeamsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*CreateServiceAccountAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListServiceAccountsAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetServiceAccountAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*DeleteServiceAccountAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyAuthServiceAccountsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetOrgQuotaAuthOrgsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UpdateOrgQuotaAuthOrgsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetOrgRateLimitAuthOrgsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UpdateOrgRateLimitAuthOrgsResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*CreateClusterInviteAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListClusterInvitesAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*RevokeClusterInviteAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ListClusterOrgsAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetClusterOrgAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*DeleteClusterOrgAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*SuspendClusterOrgAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*UnsuspendClusterOrgAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*ReissueOwnerKeyAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*GetClusterInviteInfoAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*AcceptClusterInviteAuthClusterResponse409ResponseBody: Conflict. Status code409. Applicable to 1 of 325 methods.*CreateScopedApiKeyAuthApiKeysResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListScopedApiKeysAuthApiKeysResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UpdateScopedApiKeyAuthApiKeysResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*RegenerateScopedApiKeyAuthApiKeysResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ExchangeApiKeyTokenAuthApiKeysResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*CreateTeamAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListTeamsAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetTeamAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UpdateTeamAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*DeleteTeamAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*AddTeamMemberAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListTeamMembersAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*RemoveTeamMemberAuthTeamsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*CreateServiceAccountAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListServiceAccountsAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetServiceAccountAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*DeleteServiceAccountAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListServiceAccountApiKeysAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UpdateServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*DeleteServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*RegenerateServiceAccountApiKeyAuthServiceAccountsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetOrgQuotaAuthOrgsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UpdateOrgQuotaAuthOrgsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetOrgRateLimitAuthOrgsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UpdateOrgRateLimitAuthOrgsResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*CreateClusterInviteAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListClusterInvitesAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*RevokeClusterInviteAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ListClusterOrgsAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetClusterOrgAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*DeleteClusterOrgAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*SuspendClusterOrgAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*UnsuspendClusterOrgAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*ReissueOwnerKeyAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetClusterInviteInfoAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*AcceptClusterInviteAuthClusterResponse429ResponseBody: Rate limited. Status code429. Applicable to 1 of 325 methods.*GetFileContentLlmFilesResponse500ResponseBody: Internal server error. Status code500. Applicable to 1 of 325 methods.*GetJwtFromKeyAuthApiKeyResponseResponseBody: Internal server error. Status code500. Applicable to 1 of 325 methods.*ResponseValidationError: Type mismatch between the data returned from the server and the structure expected by the SDK. Seeerror.rawValuefor the raw value anderror.pretty()for a nicely formatted multi-line string.
* Check the method documentation to see if the error is applicable.
Server Selection
Select Server by Index
You can override the default server globally by passing a server index to the serverIdx: number optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
| # | Server | Description |
|---|---|---|
| 0 | https://apigw.mka1.com | MKA1 API Gateway |
| 1 | / | Relative server URL (configurable via SDK constructor) |
Example
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverIdx: 0,
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
});
}
run();Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the serverURL: string optional parameter when initializing the SDK client instance. For example:
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://apigw.mka1.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
await sdk.permissions.llm.grant({
grantPermissionRequest: {
resourceType: "completion",
resourceId: "my-completion-123",
userId: "user-abc456",
role: "writer",
},
});
}
run();Custom HTTP Client
The TypeScript SDK makes API calls using an HTTPClient that wraps the native Fetch API. This client is a thin wrapper around fetch and provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle errors and response.
The HTTPClient constructor takes an optional fetcher argument that can be used to integrate a third-party HTTP client or when writing tests to mock out the HTTP client and feed in fixtures.
The following example shows how to:
- route requests through a proxy server using undici's ProxyAgent
- use the
"beforeRequest"hook to add a custom header and a timeout to requests - use the
"requestError"hook to log errors
import { SDK } from "@meetkai/mka1";
import { ProxyAgent } from "undici";
import { HTTPClient } from "@meetkai/mka1/lib/http";
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
const httpClient = new HTTPClient({
// 'fetcher' takes a function that has the same signature as native 'fetch'.
fetcher: (input, init) =>
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
fetch(input, { ...init, dispatcher } as RequestInit),
});
httpClient.addHook("beforeRequest", (request) => {
const nextRequest = new Request(request, {
signal: request.signal || AbortSignal.timeout(5000)
});
nextRequest.headers.set("x-custom-header", "custom value");
return nextRequest;
});
httpClient.addHook("requestError", (error, request) => {
console.group("Request Error");
console.log("Reason:", `${error}`);
console.log("Endpoint:", `${request.method} ${request.url}`);
console.groupEnd();
});
const sdk = new SDK({ httpClient: httpClient });Debugging
You can setup your SDK to emit debug logs for SDK requests and responses.
You can pass a logger that matches console's interface as an SDK option.
WARNING
Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({ debugLogger: console });Versioning
The SDK is generated from the MKA1 OpenAPI schema and may gain new endpoints frequently. Pin an exact package version when deploying production applications, then upgrade intentionally after reviewing the generated type changes.
Generated Code
Most files under src/, docs/, and the generated reference sections in this README are produced from the API schema. Changes to generated implementation files are likely to be overwritten by the next SDK generation. For API behavior questions, integration support, or documentation issues, use the support channels listed at docs.mka1.com.
Generated with Speakeasy.