Metadata-Version: 2.4
Name: meetkai-mka1
Version: 0.6.4
Summary: Python Client SDK Generated by Speakeasy.
Author: Speakeasy
License: Apache-2.0
Project-URL: repository, https://github.com/MeetKai/mk1-sdks.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpcore>=1.0.9
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic<2.13,>=2.11.2

# openapi

Developer-friendly & type-safe Python SDK specifically catered to leverage *openapi* API.

[![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=openapi&utm_campaign=python)
[![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)


<br /><br />
> [!IMPORTANT]
> This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/meetkai/mk1). Delete this section before > publishing to a package manager.

<!-- Start Summary [summary] -->
## 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](https://mka1.apidocumentation.com/guides/getting-started).
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [openapi](https://github.com/MeetKai/mk1-sdks/blob/master/python/#openapi)
  * [SDK Installation](https://github.com/MeetKai/mk1-sdks/blob/master/python/#sdk-installation)
  * [IDE Support](https://github.com/MeetKai/mk1-sdks/blob/master/python/#ide-support)
  * [SDK Example Usage](https://github.com/MeetKai/mk1-sdks/blob/master/python/#sdk-example-usage)
  * [Authentication](https://github.com/MeetKai/mk1-sdks/blob/master/python/#authentication)
  * [Available Resources and Operations](https://github.com/MeetKai/mk1-sdks/blob/master/python/#available-resources-and-operations)
  * [Server-sent event streaming](https://github.com/MeetKai/mk1-sdks/blob/master/python/#server-sent-event-streaming)
  * [File uploads](https://github.com/MeetKai/mk1-sdks/blob/master/python/#file-uploads)
  * [Retries](https://github.com/MeetKai/mk1-sdks/blob/master/python/#retries)
  * [Error Handling](https://github.com/MeetKai/mk1-sdks/blob/master/python/#error-handling)
  * [Server Selection](https://github.com/MeetKai/mk1-sdks/blob/master/python/#server-selection)
  * [Custom HTTP Client](https://github.com/MeetKai/mk1-sdks/blob/master/python/#custom-http-client)
  * [Resource Management](https://github.com/MeetKai/mk1-sdks/blob/master/python/#resource-management)
  * [Debugging](https://github.com/MeetKai/mk1-sdks/blob/master/python/#debugging)
* [Development](https://github.com/MeetKai/mk1-sdks/blob/master/python/#development)
  * [Maturity](https://github.com/MeetKai/mk1-sdks/blob/master/python/#maturity)
  * [Contributions](https://github.com/MeetKai/mk1-sdks/blob/master/python/#contributions)

<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

> [!TIP]
> To finish publishing your SDK to PyPI you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).


> [!NOTE]
> **Python version upgrade policy**
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with *uv*, *pip*, or *poetry* package managers.

### uv

*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

```bash
uv add git+https://github.com/MeetKai/mk1-sdks.git#subdirectory=python
```

### PIP

*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

```bash
pip install git+https://github.com/MeetKai/mk1-sdks.git#subdirectory=python
```

### Poetry

*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.

```bash
poetry add git+https://github.com/MeetKai/mk1-sdks.git#subdirectory=python
```

### Shell and script usage with `uv`

You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:

```shell
uvx --from meetkai-mka1 python
```

It's also possible to write a standalone Python script without needing to set up a whole project like so:

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "meetkai-mka1",
# ]
# ///

from meetkai_mka1 import SDK

sdk = SDK(
  # SDK arguments
)

# Rest of script here...
```

Once that is saved to a file, you can run it with `uv run script.py` where
`script.py` can be replaced with the actual file name.
<!-- End SDK Installation [installation] -->

<!-- Start IDE Support [idesupport] -->
## IDE Support

### PyCharm

Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.

- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
<!-- End IDE Support [idesupport] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
# Synchronous Example
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

    # Use the SDK ...
```

</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
from meetkai_mka1 import SDK

async def main():

    async with SDK(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    ) as sdk:

        await sdk.permissions.llm.grant_async(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

        # Use the SDK ...

asyncio.run(main())
```
<!-- End SDK Example Usage [usage] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name          | Type | Scheme      |
| ------------- | ---- | ----------- |
| `bearer_auth` | http | HTTP Bearer |

To authenticate with the API the `bearer_auth` parameter must be set when initializing the SDK client instance. For example:
```python
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

    # Use the SDK ...

```
<!-- End Authentication [security] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

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

### [AgentRuns](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md)

* [list_agent_runs](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md#list_agent_runs) - List runs for an agent
* [create_agent_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md#create_agent_run) - Start a saved agent run
* [stream_agent_run_events](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md#stream_agent_run_events) - Stream agent run events
* [wake_agent_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md#wake_agent_run) - Wake a sleeping agent run
* [get_agent_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentruns/README.md#get_agent_run) - Retrieve an agent run

### [AgentSchedules](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md)

* [list_agent_schedules](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#list_agent_schedules) - List schedules for an agent
* [create_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#create_agent_schedule) - Create an agent schedule
* [get_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#get_agent_schedule) - Retrieve an agent schedule
* [update_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#update_agent_schedule) - Update an agent schedule
* [delete_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#delete_agent_schedule) - Delete an agent schedule
* [pause_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#pause_agent_schedule) - Pause an agent schedule
* [resume_agent_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentschedules/README.md#resume_agent_schedule) - Resume an agent schedule

### [AgentVersions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentversions/README.md)

* [list_agent_versions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentversions/README.md#list_agent_versions) - List agent versions
* [get_agent_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentversions/README.md#get_agent_version) - Retrieve an agent version
* [rollback_agent_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agentversions/README.md#rollback_agent_version) - Roll back an agent to a version

### [Agents](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md)

* [list_agents](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md#list_agents) - List agents
* [create_agent](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md#create_agent) - Create an agent
* [get_agent](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md#get_agent) - Retrieve an agent
* [update_agent](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md#update_agent) - Update an agent
* [delete_agent](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/agents/README.md#delete_agent) - Delete an agent

### [Auth.ApiKey](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/apikey/README.md)

* [get_jwt_from_key](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/apikey/README.md#get_jwt_from_key) - Exchange API key for a JWT token

### [Guardrails](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/guardrails/README.md)

* [get_guardrails](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/guardrails/README.md#get_guardrails) - Get guardrails settings
* [update_guardrails](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/guardrails/README.md#update_guardrails) - Update guardrails settings
* [test_guardrails](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/guardrails/README.md#test_guardrails) - Test content against guardrails

### [Llm.Batches](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/batches/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/batches/README.md#create) - Create a batch
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/batches/README.md#list) - List batches
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/batches/README.md#get) - Get a batch
* [cancel](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/batches/README.md#cancel) - Cancel a batch

### [~~Llm.Chat~~](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/chat/README.md)

* [~~create_chat~~](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/chat/README.md#create_chat) - [Deprecated] Chat completions for OpenAI SDK/client usage :warning: **Deprecated**
* [~~stream~~](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/chat/README.md#stream) - [Deprecated] Streaming chat completions for generated SDK usage :warning: **Deprecated**

### [Llm.Classify](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/classify/README.md)

* [classify](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/classify/README.md#classify) - Classify text into predefined categories

### [Llm.Conversations](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#create) - Create a conversation
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#list) - List conversations
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#get) - Retrieve a conversation
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#update) - Update a conversation
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#delete) - Delete a conversation
* [list_items](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#list_items) - List conversation items
* [create_items](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#create_items) - Create conversation items
* [delete_items](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#delete_items) - Delete multiple conversation items
* [get_item](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#get_item) - Retrieve a conversation item
* [delete_item](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/conversations/README.md#delete_item) - Delete a conversation item

### [Llm.Embeddings](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/embeddings/README.md)

* [list_models](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/embeddings/README.md#list_models) - List available embedding models
* [embed](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/embeddings/README.md#embed) - Create text embeddings

### [Llm.Evals](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md)

* [create_suite](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#create_suite) - Create an eval suite
* [list_suites](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_suites) - List eval suites
* [get_suite](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#get_suite) - Get an eval suite
* [delete_suite](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#delete_suite) - Delete an eval suite
* [create_suite_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#create_suite_version) - Create an eval suite version
* [list_suite_versions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_suite_versions) - List eval suite versions
* [get_suite_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#get_suite_version) - Get an eval suite version
* [create_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#create_run) - Create an eval run
* [list_runs](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_runs) - List eval runs
* [get_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#get_run) - Get an eval run
* [delete_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#delete_run) - Delete an eval run
* [cancel_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#cancel_run) - Cancel an eval run
* [rerun_failed_samples](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#rerun_failed_samples) - Rerun failed eval samples
* [retry_failed_run](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#retry_failed_run) - Retry an eval run
* [list_samples](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_samples) - List eval samples
* [get_artifacts](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#get_artifacts) - Get eval run artifacts
* [import_historical_results](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#import_historical_results) - Import historical eval results from Hugging Face
* [create_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#create_schedule) - Create an eval schedule
* [list_schedules](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_schedules) - List eval schedules
* [get_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#get_schedule) - Get an eval schedule
* [update_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#update_schedule) - Update an eval schedule
* [delete_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#delete_schedule) - Delete an eval schedule
* [trigger_schedule](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#trigger_schedule) - Trigger an eval schedule now
* [list_schedule_runs](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/evals/README.md#list_schedule_runs) - List runs created by an eval schedule

### [Llm.Extract](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md)

* [extract](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#extract) - Extract structured data with inline JSON Schema
* [create_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#create_schema) - Create reusable extraction schema template
* [get_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#get_schema) - Get extraction schema by ID
* [update_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#update_schema) - Update extraction schema by ID
* [delete_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#delete_schema) - Delete extraction schema by ID
* [extract_with_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/extract/README.md#extract_with_schema) - Extract data using saved schema template

### [Llm.Feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md)

* [create_completion_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#create_completion_feedback) - Submit feedback for chat completion
* [get_completion_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#get_completion_feedback) - Retrieve feedback by completion ID
* [update_completion_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#update_completion_feedback) - Update existing completion feedback
* [batch_get_completion_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#batch_get_completion_feedback) - Batch retrieve feedback for multiple completions
* [create_response_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#create_response_feedback) - Submit feedback for response
* [get_response_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#get_response_feedback) - Retrieve feedback by response ID
* [update_response_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#update_response_feedback) - Update existing response feedback
* [batch_get_response_feedback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#batch_get_response_feedback) - Batch retrieve feedback for multiple responses
* [start_export](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#start_export) - Start feedback export
* [get_export_status](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/feedback/README.md#get_export_status) - Get feedback export status

### [Llm.Files](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md)

* [upload](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md#upload) - Upload file
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md#list) - List files
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md#get) - Retrieve file
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md#delete) - Delete file
* [content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/files/README.md#content) - Retrieve file content

### [Llm.FineTuning](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#create) - Create a fine-tuning job
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#list) - List fine-tuning jobs
* [retrieve](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#retrieve) - Retrieve a fine-tuning job
* [cancel](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#cancel) - Cancel a fine-tuning job
* [pause](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#pause) - Pause a fine-tuning job
* [resume](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#resume) - Resume a fine-tuning job
* [list_events](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#list_events) - List fine-tuning events
* [list_checkpoints](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/finetuning/README.md#list_checkpoints) - List fine-tuning checkpoints

### [Llm.Images](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/images/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/images/README.md#create) - Generate images from text descriptions

### [Llm.McpVault](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md)

* [create_server](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#create_server) - Create MCP server
* [list_servers](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#list_servers) - List MCP servers
* [get_server](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#get_server) - Retrieve MCP server
* [update_server](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#update_server) - Update MCP server
* [delete_server](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#delete_server) - Delete MCP server
* [create_credential](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#create_credential) - Create MCP credential
* [list_credentials](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#list_credentials) - List MCP credentials
* [delete_credential](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#delete_credential) - Delete MCP credential
* [test_server](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/mcpvault/README.md#test_server) - Test MCP server

### [Llm.MemoryStores](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#create) - Create memory store
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#list) - List memory stores
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#get) - Retrieve memory store
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#update) - Update memory store
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#delete) - Delete memory store
* [create_entry](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#create_entry) - Create memory entry
* [list_entries](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#list_entries) - List memory entries
* [get_entry](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#get_entry) - Retrieve memory entry
* [update_entry](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#update_entry) - Update memory entry
* [delete_entry](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/memorystores/README.md#delete_entry) - Delete memory entry

### [Llm.Models](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md)

* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#list) - List available models
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#get) - Retrieve a model
* [add_registry_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#add_registry_model) - Add a model to the registry
* [list_registry_models](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#list_registry_models) - List all registry models
* [update_registry_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#update_registry_model) - Update a database model in the registry
* [remove_registry_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#remove_registry_model) - Remove a database model from the registry
* [get_registry_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#get_registry_model) - Get a specific registry model
* [check_registry_model_health](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#check_registry_model_health) - Check health of a specific model
* [list_cluster_registry](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#list_cluster_registry) - List the cluster registry catalog
* [list_cluster_registry_org_grants](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#list_cluster_registry_org_grants) - List an org's cluster registry grants
* [put_cluster_registry_org_grants](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#put_cluster_registry_org_grants) - Replace an org's cluster registry grants
* [list_org_auto_models](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#list_org_auto_models) - List this org's auto-model overrides
* [put_org_auto_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#put_org_auto_model) - Set this org's auto-model override for an endpoint
* [delete_org_auto_model](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmmodels/README.md#delete_org_auto_model) - Clear this org's auto-model override for an endpoint

### [Llm.Prompts](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#create) - Create a prompt
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#list) - List prompts
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#get) - Get a prompt
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#update) - Update a prompt
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#delete) - Delete a prompt
* [create_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#create_version) - Create a new version
* [list_versions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#list_versions) - List versions
* [get_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#get_version) - Get a specific version
* [rollback](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/prompts/README.md#rollback) - Rollback to a version

### [Llm.Responses](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#create) - Create an agent-powered response with tool support
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#list) - List all responses with pagination
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#get) - Retrieve response by ID with status and results
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#update) - Update a response
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#delete) - Permanently delete a response and its data
* [cancel](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#cancel) - Cancel an in-progress background response
* [wake](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#wake) - Wake a sleeping background response
* [list_input_items](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#list_input_items) - List paginated input items for a response
* [compact](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/responses/README.md#compact) - Compact a conversation

### [Llm.Skills](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#create) - Create skill
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#list) - List skills
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#get) - Retrieve skill
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#update) - Update skill
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#delete) - Delete skill
* [content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#content) - Download skill content
* [create_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#create_version) - Create skill version
* [list_versions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#list_versions) - List skill versions
* [get_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#get_version) - Retrieve skill version
* [delete_version](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#delete_version) - Delete skill version
* [version_content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#version_content) - Download skill version content
* [list_preconfigured](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/skills/README.md#list_preconfigured) - List preconfigured skills

### [Llm.Speech](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md)

* [transcribe](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#transcribe) - Speech to text transcription
* [speak](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#speak) - Text to speech
* [speak_streaming](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#speak_streaming) - Streaming text to speech
* [livekit_token](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#livekit_token) - Generate LiveKit room token
* [list_tts_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#list_tts_history) - List text-to-speech history
* [get_tts_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#get_tts_history) - Retrieve text-to-speech history item
* [delete_tts_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#delete_tts_history) - Delete text-to-speech history item
* [get_tts_history_content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#get_tts_history_content) - Retrieve text-to-speech audio
* [list_transcription_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#list_transcription_history) - List speech-to-text history
* [get_transcription_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#get_transcription_history) - Retrieve speech-to-text history item
* [delete_transcription_history](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#delete_transcription_history) - Delete speech-to-text history item
* [get_transcription_history_content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/speech/README.md#get_transcription_history_content) - Retrieve speech-to-text audio

### [Llm.Usage](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md)

* [completions](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#completions) - Get completions usage
* [responses](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#responses) - Get responses usage
* [conversations](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#conversations) - Get conversations usage
* [embeddings](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#embeddings) - Get embeddings usage
* [extract](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#extract) - Get extract usage
* [classify](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#classify) - Get classify usage
* [vector_stores](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#vector_stores) - Get vector stores usage
* [files](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/llmusage/README.md#files) - Get files usage

### [Llm.VectorStores](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#create) - Create a vector store
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#list) - List vector stores
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#get) - Retrieve a vector store
* [update](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#update) - Modify a vector store
* [delete](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#delete) - Delete a vector store
* [search](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#search) - Search a vector store
* [create_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#create_file) - Add a file to a vector store
* [list_files](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#list_files) - List files in a vector store
* [get_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#get_file) - Retrieve a vector store file
* [update_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#update_file) - Update file attributes
* [delete_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#delete_file) - Remove file from vector store
* [get_file_content](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#get_file_content) - Retrieve parsed file content
* [create_file_batch](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#create_file_batch) - Batch add multiple files to vector store
* [get_file_batch](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#get_file_batch) - Retrieve file batch status
* [cancel_file_batch](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#cancel_file_batch) - Cancel batch file processing
* [list_files_in_batch](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/vectorstores/README.md#list_files_in_batch) - List files in a batch

### [Permissions.Llm](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/permissionsllm/README.md)

* [grant](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/permissionsllm/README.md#grant) - Grant permission to a user or make public
* [revoke](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/permissionsllm/README.md#revoke) - Revoke permission from a user or remove public access
* [check](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/permissionsllm/README.md#check) - Check user permission

### [Sandbox](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md)

* [create](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#create) - Create Session
* [list](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#list) - List Sessions
* [get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#get) - Get Session
* [get_url](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#get_url) - Get Session URL
* [proxy_browser_port_request](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#proxy_browser_port_request) - Proxy Browser Port Request
* [run_command](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#run_command) - Run Command
* [run_code](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#run_code) - Run Code
* [terminate](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#terminate) - Terminate Session
* [get_workspace](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#get_workspace) - Get Workspace Manifest
* [download_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#download_file) - Download Workspace File
* [upload_file](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#upload_file) - Upload Workspace File
* [download_archive](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#download_archive) - Download Workspace Archive
* [upload_archive](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandbox/README.md#upload_archive) - Upload Workspace Archive

### [SandboxUsage](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandboxusage/README.md)

* [get_usage_api_v1_sandbox_usage_get](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/sandboxusage/README.md#get_usage_api_v1_sandbox_usage_get) - Get Usage

### [Search.Graphrag](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md)

* [create_graph_rag_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md#create_graph_rag_store) - Create Store
* [ingest_graph_rag_documents](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md#ingest_graph_rag_documents) - Ingest Documents
* [query_graph_rag_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md#query_graph_rag_store) - Query Store
* [inspect_graph_rag_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md#inspect_graph_rag_store) - Inspect Graph
* [delete_graph_rag_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/graphrag/README.md#delete_graph_rag_store) - Delete Store

### [Search.Tables](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md)

* [create_table](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#create_table) - Create Table
* [get_table_schema](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#get_table_schema) - Get Table Schema
* [delete_table](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#delete_table) - Delete Table
* [insert_data](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#insert_data) - Insert Data
* [delete_data](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#delete_data) - Delete Data
* [search_data](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#search_data) - Search
* [create_indices](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#create_indices) - Create Indices
* [list_indices](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#list_indices) - List Indices
* [drop_index](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/tables/README.md#drop_index) - Drop Index

### [Search.TextStore](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md)

* [create_text_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md#create_text_store) - Create Store
* [add_texts](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md#add_texts) - Add Texts
* [delete_texts](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md#delete_texts) - Delete Texts
* [search_texts](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md#search_texts) - Search Texts
* [delete_text_store](https://github.com/MeetKai/mk1-sdks/blob/master/python/docs/sdks/textstore/README.md#delete_text_store) - Delete Store

</details>
<!-- End Available Resources and Operations [operations] -->

<!-- Start Server-sent event streaming [eventstream] -->
## Server-sent event streaming

[Server-sent events][mdn-sse] are used to stream content from certain
operations. These operations will expose the stream as [Generator][generator] that
can be consumed using a simple `for` loop. The loop will
terminate when the server no longer has any events to send and closes the
underlying connection.  

The stream is also a [Context Manager][context-manager] and can be used with the `with` statement and will close the
underlying connection when the context is exited.

```python
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.responses.create(model="meetkai:functionary-urdu-mini-pak", input="What is the capital of France?", stream=False, store=True, background=False, parallel_tool_calls=True, max_tool_calls=64, truncation="auto", service_tier="auto")

    with res as event_stream:
        for event in event_stream:
            # handle event
            print(event, flush=True)

```

[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
[generator]: https://book.pythontips.com/en/latest/generators.html
[context-manager]: https://book.pythontips.com/en/latest/context_managers.html
<!-- End Server-sent event streaming [eventstream] -->

<!-- Start File uploads [file-upload] -->
## File uploads

Certain SDK methods accept file objects as part of a request body or 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]
>
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
>

```python
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.files.upload(file={
        "file_name": "example.file",
        "content": open("example.file", "rb"),
    }, purpose="assistants")

    # Handle response
    print(res)

```
<!-- End File uploads [file-upload] -->

<!-- Start Retries [retries] -->
## 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:
```python
from meetkai_mka1 import SDK
from meetkai_mka1.utils import BackoffStrategy, RetryConfig


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer",
        RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

    # Use the SDK ...

```

If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
```python
from meetkai_mka1 import SDK
from meetkai_mka1.utils import BackoffStrategy, RetryConfig


with SDK(
    retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

    # Use the SDK ...

```
<!-- End Retries [retries] -->

<!-- Start Error Handling [errors] -->
## Error Handling

[`SDKError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/sdkerror.py) is the base class for all HTTP error responses. It has the following properties:

| Property           | Type             | Description                                                                             |
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
| `err.message`      | `str`            | Error message                                                                           |
| `err.status_code`  | `int`            | HTTP response status code eg `404`                                                      |
| `err.headers`      | `httpx.Headers`  | HTTP response headers                                                                   |
| `err.body`         | `str`            | HTTP body. Can be empty string if no body is returned.                                  |
| `err.raw_response` | `httpx.Response` | Raw HTTP response                                                                       |
| `err.data`         |                  | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/MeetKai/mk1-sdks/blob/master/python/#error-classes). |

### Example
```python
from meetkai_mka1 import SDK, errors


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
    res = None
    try:

        res = sdk.llm.files.content(file_id="file-abc123")

        # Handle response
        print(res)


    except errors.SDKError as e:
        # The base class for HTTP error responses
        print(e.message)
        print(e.status_code)
        print(e.body)
        print(e.headers)
        print(e.raw_response)

        # Depending on the method different errors may be thrown
        if isinstance(e, errors.GetFileContentBadRequestError):
            print(e.data.error)  # Optional[models.BadRequestError]
```

### Error Classes
**Primary error:**
* [`SDKError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/sdkerror.py): The base class for HTTP error responses.

<details><summary>Less common errors (19)</summary>

<br />

**Network errors:**
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
    * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
    * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.


**Inherit from [`SDKError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/sdkerror.py)**:
* [`HTTPValidationError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 33 of 232 methods.*
* [`ErrorEnvelope`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/errorenvelope.py): Error response. Applicable to 20 of 232 methods.*
* [`TableErrorResponse`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/tableerrorresponse.py): Applicable to 9 of 232 methods.*
* [`TextStoreErrorResponse`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/textstoreerrorresponse.py): Error response for text store operations. Applicable to 5 of 232 methods.*
* [`GraphRAGErrorResponse`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/graphragerrorresponse.py): Applicable to 5 of 232 methods.*
* [`ValidationErrorResponse`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/validationerrorresponse.py): Status code `400`. Applicable to 3 of 232 methods.*
* [`ErrorResponse`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/errorresponse.py): Status code `400`. Applicable to 2 of 232 methods.*
* [`GetFileContentBadRequestError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getfilecontentbadrequesterror.py): Invalid request - File ID is required. Status code `400`. Applicable to 1 of 232 methods.*
* [`GetJwtFromKeyBadRequestError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getjwtfromkeybadrequesterror.py): Invalid request body. Status code `400`. Applicable to 1 of 232 methods.*
* [`GetFileContentUnauthorizedError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getfilecontentunauthorizederror.py): Unauthorized - Invalid or missing authentication. Status code `401`. Applicable to 1 of 232 methods.*
* [`GetJwtFromKeyUnauthorizedError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getjwtfromkeyunauthorizederror.py): Unauthorized. Status code `401`. Applicable to 1 of 232 methods.*
* [`NotFoundError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/notfounderror.py): File not found. Status code `404`. Applicable to 1 of 232 methods.*
* [`GetFileContentInternalServerError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getfilecontentinternalservererror.py): Internal server error. Status code `500`. Applicable to 1 of 232 methods.*
* [`GetJwtFromKeyInternalServerError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/getjwtfromkeyinternalservererror.py): Internal server error. Status code `500`. Applicable to 1 of 232 methods.*
* [`ResponseValidationError`](https://github.com/MeetKai/mk1-sdks/blob/master/python/./src/meetkai_mka1/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.

</details>

\* Check [the method documentation](https://github.com/MeetKai/mk1-sdks/blob/master/python/#available-resources-and-operations) to see if the error is applicable.
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `server_idx: 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

```python
from meetkai_mka1 import SDK


with SDK(
    server_idx=0,
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

    # Use the SDK ...

```

### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
from meetkai_mka1 import SDK


with SDK(
    server_url="https://apigw.mka1.com",
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    sdk.permissions.llm.grant(resource_type="completion", resource_id="my-completion-123", user_id="user-abc456", role="writer")

    # Use the SDK ...

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.

For example, you could specify a header for every request that this sdk makes as follows:
```python
from meetkai_mka1 import SDK
import httpx

http_client = httpx.Client(headers={"x-custom-header": "someValue"})
s = SDK(client=http_client)
```

or you could wrap the client with your own custom logic:
```python
from meetkai_mka1 import SDK
from meetkai_mka1.httpclient import AsyncHttpClient
import httpx

class CustomClient(AsyncHttpClient):
    client: AsyncHttpClient

    def __init__(self, client: AsyncHttpClient):
        self.client = client

    async def send(
        self,
        request: httpx.Request,
        *,
        stream: bool = False,
        auth: Union[
            httpx._types.AuthTypes, httpx._client.UseClientDefault, None
        ] = httpx.USE_CLIENT_DEFAULT,
        follow_redirects: Union[
            bool, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
    ) -> httpx.Response:
        request.headers["Client-Level-Header"] = "added by client"

        return await self.client.send(
            request, stream=stream, auth=auth, follow_redirects=follow_redirects
        )

    def build_request(
        self,
        method: str,
        url: httpx._types.URLTypes,
        *,
        content: Optional[httpx._types.RequestContent] = None,
        data: Optional[httpx._types.RequestData] = None,
        files: Optional[httpx._types.RequestFiles] = None,
        json: Optional[Any] = None,
        params: Optional[httpx._types.QueryParamTypes] = None,
        headers: Optional[httpx._types.HeaderTypes] = None,
        cookies: Optional[httpx._types.CookieTypes] = None,
        timeout: Union[
            httpx._types.TimeoutTypes, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
        extensions: Optional[httpx._types.RequestExtensions] = None,
    ) -> httpx.Request:
        return self.client.build_request(
            method,
            url,
            content=content,
            data=data,
            files=files,
            json=json,
            params=params,
            headers=headers,
            cookies=cookies,
            timeout=timeout,
            extensions=extensions,
        )

s = SDK(async_client=CustomClient(httpx.AsyncClient()))
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Resource Management [resource-management] -->
## Resource Management

The `SDK` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.

[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers

```python
from meetkai_mka1 import SDK
def main():

    with SDK(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    ) as sdk:
        # Rest of application here...


# Or when using async:
async def amain():

    async with SDK(
        bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
    ) as sdk:
        # Rest of application here...
```
<!-- End Resource Management [resource-management] -->

<!-- Start Debugging [debug] -->
## Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass your own logger class directly into your SDK.
```python
from meetkai_mka1 import SDK
import logging

logging.basicConfig(level=logging.DEBUG)
s = SDK(debug_logger=logging.getLogger("meetkai_mka1"))
```
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# 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](https://www.speakeasy.com/?utm_source=openapi&utm_campaign=python)
