MeetKai.MKA1 0.4.53

dotnet add package MeetKai.MKA1 --version 0.4.53
                    
NuGet\Install-Package MeetKai.MKA1 -Version 0.4.53
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MeetKai.MKA1" Version="0.4.53" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MeetKai.MKA1" Version="0.4.53" />
                    
Directory.Packages.props
<PackageReference Include="MeetKai.MKA1" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MeetKai.MKA1 --version 0.4.53
                    
#r "nuget: MeetKai.MKA1, 0.4.53"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MeetKai.MKA1@0.4.53
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MeetKai.MKA1&version=0.4.53
                    
Install as a Cake Addin
#tool nuget:?package=MeetKai.MKA1&version=0.4.53
                    
Install as a Cake Tool

MKA1

Developer-friendly & type-safe Csharp SDK specifically catered to leverage MKA1 API.

Built by Speakeasy License: MIT

<br /><br />

This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your workspace. Delete this section before > publishing to a package manager.

Summary

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

SDK Installation

To add a reference to a local instance of the SDK in a .NET project:

dotnet add reference src/MeetKai/MKA1/MeetKai.MKA1.csproj

SDK Example Usage

Example

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Permissions.Llm.GrantAsync(body: new GrantPermissionRequest() {
    ResourceType = LlmResourceType.Completion,
    ResourceId = "my-completion-123",
    UserId = "user-abc456",
    Role = ResourceRole.Writer,
});

// handle response

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:

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Permissions.Llm.GrantAsync(body: new GrantPermissionRequest() {
    ResourceType = LlmResourceType.Completion,
    ResourceId = "my-completion-123",
    UserId = "user-abc456",
    Role = ResourceRole.Writer,
});

// handle response

Available Resources and Operations

<details open> <summary>Available methods</summary>

AgentRuns

AgentSchedules

AgentVersions

Agents

Auth.ApiKey

Auth.ApiKeys

Auth.Cluster

Auth.Orgs

Auth.ServiceAccounts

Auth.Teams

Budgets

Guardrails

Llm.Batches

Llm.Chat

  • CreateChat - [Deprecated] Chat completions for OpenAI SDK/client usage ⚠️ Deprecated
  • Stream - [Deprecated] Streaming chat completions for generated SDK usage ⚠️ Deprecated

Llm.Classify

  • Classify - Classify text into predefined categories

Llm.Conversations

Llm.Embeddings

  • ListModels - List available embedding models
  • Embed - Create text embeddings

Llm.Evals

Llm.Extract

Llm.Feedback

Llm.Files

Llm.FineTuning

Llm.Images

  • Create - Generate images from text descriptions

Llm.McpVault

Llm.MemoryStores

Llm.Models

Llm.Prompts

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

Llm.Speech

Llm.Usage

Llm.VectorStores

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

Sandbox

Search.Graphrag

Search.Tables

Search.TextStore

Serving.Accelerators

  • List - List available accelerator types

Serving.Deployments

Serving.FinetuneJobs

Serving.Images

  • Build - Build a container image
  • List - List images
  • Get - Get an image
  • Delete - Delete an image

Serving.Models

Serving.Secrets

  • Create - Create a secret
  • List - List secrets (names only)
  • Delete - Delete a secret

Serving.Volumes

Usage

  • Sandbox - Get Sandbox Usage
  • Costs - Aggregate cost by dimension

</details>

Server-sent event streaming

Server-sent events (SSE) are used to stream content from certain operations. SSE is a web standard that allows a server to push data to a client over a single HTTP connection in real-time.

These operations return an instance of EventStream, which implements IDisposable. It should be consumed using the RAII (Resource Acquisition Is Initialization) pattern. The recommended approach is to use a using statement, which ensures that the stream is properly disposed of when you're done with it, even if an exception occurs. Alternatively, you can manually call Dispose() on the EventStream object when finished.

The EventStream instance can be consumed by repeatedly calling Next() until it returns null, indicating the end of the stream.

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using MeetKai.MKA1.Types.Requests;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Llm.Responses.CreateAsync(body: new ResponsesCreateRequest() {
    Model = "meetkai:functionary-urdu-mini-pak",
    Input = ResponsesCreateRequestInput.CreateStr(
        "What is the capital of France?"
    ),
});

// Handle event stream response
if (res.Object != null)
{
    using (var eventStream = res.Object)
    {
        CreateResponseResponseBody? eventData;
        while ((eventData = await eventStream.Next()) != null)
        {
            // handle eventData
        }
    }
}
// Handle JSON response
else if (res.ResponseObject != null)
{
    // handle JSON response
    var jsonResponse = res.ResponseObject;
}

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 pass a RetryConfig to the call:

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Permissions.Llm.GrantAsync(
    retryConfig: new RetryConfig(
        strategy: RetryConfig.RetryStrategy.BACKOFF,
        backoff: new BackoffStrategy(
            initialIntervalMs: 1L,
            maxIntervalMs: 50L,
            maxElapsedTimeMs: 100L,
            exponent: 1.1
        ),
        retryConnectionErrors: false
    ),
    body: new GrantPermissionRequest() {
        ResourceType = LlmResourceType.Completion,
        ResourceId = "my-completion-123",
        UserId = "user-abc456",
        Role = ResourceRole.Writer,
    }
);

// handle response

If you'd like to override the default retry strategy for all operations that support retries, you can use the RetryConfig optional parameter when intitializing the SDK:

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(
    retryConfig: new RetryConfig(
        strategy: RetryConfig.RetryStrategy.BACKOFF,
        backoff: new BackoffStrategy(
            initialIntervalMs: 1L,
            maxIntervalMs: 50L,
            maxElapsedTimeMs: 100L,
            exponent: 1.1
        ),
        retryConnectionErrors: false
    ),
    bearerAuth: "<YOUR_BEARER_TOKEN_HERE>"
);

var res = await sdk.Permissions.Llm.GrantAsync(body: new GrantPermissionRequest() {
    ResourceType = LlmResourceType.Completion,
    ResourceId = "my-completion-123",
    UserId = "user-abc456",
    Role = ResourceRole.Writer,
});

// handle response

Error Handling

SDKException is the base exception class for all HTTP error responses. It has the following properties:

Property Type Description
Message string Error message
Request HttpRequestMessage HTTP request object
Response HttpResponseMessage HTTP response object

Some exceptions in this SDK include an additional Payload field, which will contain deserialized custom error data when present. Possible exceptions are listed in the Error Classes section.

Example

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using MeetKai.MKA1.Types.Errors;
using MeetKai.MKA1.Types.Requests;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

try
{
    var res = await sdk.Llm.Files.ContentAsync(fileId: "file-abc123");

    // handle response
}
catch (SDKException ex) // all SDK exceptions inherit from SDKException
{
    // ex.ToString() provides a detailed error message
    System.Console.WriteLine(ex);

    // Base exception fields
    HttpRequestMessage request = ex.Request;
    HttpResponseMessage response = ex.Response;
    var statusCode = (int)response.StatusCode;
    var responseBody = ex.Body;

    if (ex is GetFileContentBadRequestException) // different exceptions may be thrown depending on the method
    {
        // Check error data fields
        GetFileContentBadRequestExceptionPayload payload = ex.Payload;
        BadRequestError Error = payload.Error;
        HTTPMetadata HttpMeta = payload.HttpMeta;
    }

    // An underlying cause may be provided
    if (ex.InnerException != null)
    {
        Exception cause = ex.InnerException;
    }
}
catch (OperationCanceledException ex)
{
    // CancellationToken was cancelled
}
catch (System.Net.Http.HttpRequestException ex)
{
    // Check ex.InnerException for Network connectivity errors
}

Error Classes

Primary exception:

<details><summary>Less common exceptions (234)</summary>

* Refer to the relevant documentation to determine whether an exception applies to a specific operation.

Server Selection

Select Server by Index

You can override the default server globally by passing a server index to the serverIndex: int 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
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(
    serverIndex: 0,
    bearerAuth: "<YOUR_BEARER_TOKEN_HERE>"
);

var res = await sdk.Permissions.Llm.GrantAsync(body: new GrantPermissionRequest() {
    ResourceType = LlmResourceType.Completion,
    ResourceId = "my-completion-123",
    UserId = "user-abc456",
    Role = ResourceRole.Writer,
});

// handle response

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:

using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;

var sdk = new SDK(
    serverUrl: "https://apigw.mka1.com",
    bearerAuth: "<YOUR_BEARER_TOKEN_HERE>"
);

var res = await sdk.Permissions.Llm.GrantAsync(body: new GrantPermissionRequest() {
    ResourceType = LlmResourceType.Completion,
    ResourceId = "my-completion-123",
    UserId = "user-abc456",
    Role = ResourceRole.Writer,
});

// handle response

Custom HTTP Client

The C# SDK makes API calls using an ISpeakeasyHttpClient that wraps the native HttpClient. This client provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle errors and response.

The ISpeakeasyHttpClient interface allows you to either use the default SpeakeasyHttpClient that comes with the SDK, or provide your own custom implementation with customized configuration such as custom message handlers, timeouts, connection pooling, and other HTTP client settings.

The following example shows how to create a custom HTTP client with request modification and error handling:

using MeetKai.MKA1;
using MeetKai.MKA1.Utils;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

// Create a custom HTTP client
public class CustomHttpClient : ISpeakeasyHttpClient
{
    private readonly ISpeakeasyHttpClient _defaultClient;

    public CustomHttpClient()
    {
        _defaultClient = new SpeakeasyHttpClient();
    }

    public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
    {
        // Add custom header and timeout
        request.Headers.Add("x-custom-header", "custom value");
        request.Headers.Add("x-request-timeout", "30");
        
        try
        {
            var response = await _defaultClient.SendAsync(request, cancellationToken);
            // Log successful response
            Console.WriteLine($"Request successful: {response.StatusCode}");
            return response;
        }
        catch (Exception error)
        {
            // Log error
            Console.WriteLine($"Request failed: {error.Message}");
            throw;
        }
    }

    public void Dispose()
    {
        _httpClient?.Dispose();
        _defaultClient?.Dispose();
    }
}

// Use the custom HTTP client with the SDK
var customHttpClient = new CustomHttpClient();
var sdk = new SDK(client: customHttpClient);

<details> <summary>You can also provide a completely custom HTTP client with your own configuration:</summary>

using MeetKai.MKA1.Utils;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

// Custom HTTP client with custom configuration
public class AdvancedHttpClient : ISpeakeasyHttpClient
{
    private readonly HttpClient _httpClient;

    public AdvancedHttpClient()
    {
        var handler = new HttpClientHandler()
        {
            MaxConnectionsPerServer = 10,
            // ServerCertificateCustomValidationCallback = customCertValidation, // Custom SSL validation if needed
        };

        _httpClient = new HttpClient(handler)
        {
            Timeout = TimeSpan.FromSeconds(30)
        };
    }

    public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
    {
        return await _httpClient.SendAsync(request, cancellationToken ?? CancellationToken.None);
    }

    public void Dispose()
    {
        _httpClient?.Dispose();
    }
}

var sdk = SDK.Builder()
    .WithClient(new AdvancedHttpClient())
    .Build();

</details>

<details> <summary>For simple debugging, you can enable request/response logging by implementing a custom client:</summary>

public class LoggingHttpClient : ISpeakeasyHttpClient
{
    private readonly ISpeakeasyHttpClient _innerClient;

    public LoggingHttpClient(ISpeakeasyHttpClient innerClient = null)
    {
        _innerClient = innerClient ?? new SpeakeasyHttpClient();
    }

    public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken? cancellationToken = null)
    {
        // Log request
        Console.WriteLine($"Sending {request.Method} request to {request.RequestUri}");
        
        var response = await _innerClient.SendAsync(request, cancellationToken);
        
        // Log response
        Console.WriteLine($"Received {response.StatusCode} response");
        
        return response;
    }

    public void Dispose() => _innerClient?.Dispose();
}

var sdk = new SDK(client: new LoggingHttpClient());

</details>

The SDK also provides built-in hook support through the SDKConfiguration.Hooks system, which automatically handles BeforeRequestAsync, AfterSuccessAsync, and AfterErrorAsync hooks for advanced request lifecycle management.

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

SDK Created by Speakeasy

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.53 0 7/9/2026
0.4.52 0 7/8/2026
0.4.51 0 7/8/2026
0.4.50 0 7/8/2026
0.4.49 0 7/8/2026
0.4.48 34 7/8/2026
0.4.47 48 7/8/2026
0.4.46 38 7/8/2026
0.4.45 40 7/8/2026
0.4.44 40 7/8/2026
0.4.43 38 7/8/2026
0.4.42 45 7/7/2026
0.4.41 37 7/7/2026
0.4.40 55 7/7/2026
0.4.39 95 7/2/2026
0.4.38 90 7/1/2026
0.4.37 90 7/1/2026
0.4.36 107 6/30/2026
0.4.35 79 6/30/2026
0.4.34 97 6/29/2026
Loading failed