> ## Documentation Index
> Fetch the complete documentation index at: https://platform.kimi.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugins

> Create, manage, and reference plugins: compare official and custom plugins, prepare plugin packages, publish versions, and configure plugins on agents.

A **Plugin** is a reusable bundle of capabilities in Kimi Hosted Agents. Attaching a plugin to an agent gives it prepackaged tool connections and skills in one step, without configuring each item individually. Plugins include platform-maintained official plugins and project-owned custom plugins.

> [!NOTE]
>
> Official plugins are billed separately. For per-plugin pricing details, see [Hosted Agents Pricing](https://platform.kimi.ai/docs/pricing/hosted-agents.md).

> [!NOTE]
>
> **Plugins and MCP**: When an MCP server bundled inside a plugin requires access credentials, inject them through a Vault; tool enablement and permission rules work the same way as for MCP servers declared directly on an agent. See [MCP](https://platform.kimi.ai/docs/hosted-agents/mcp.md) for details.

## Official plugins vs. custom plugins

| Aspect | Official plugins | Custom plugins |
| - | - | - |
| Source | Published, maintained, and updated by the platform | Created and published via `kha` CLI, console, or API |
| Visibility | All projects | Only the project that created them |
| Creation and management | Users can browse and reference them, but cannot modify them via API | Create via `kha` CLI, console, or API; validate, publish versions, download, and archive via API or `kha` CLI |
| How to reference | Reference published plugins by `plugin_id` | Reference by `plugin_id` after creating and publishing a version |
| Versioning | Platform maintains the active version, pinned when referenced | Users publish immutable versions; pin an exact version, omit `version`, or pass `latest` |
| Lifecycle | Publishing and removal are managed by the platform | Users can archive plugins; archived plugins cannot be used in new agent versions, and their names can be reused |

## Official plugin catalog

The official plugin catalog displays published plugins only. Each plugin can contain:

| Component | Description |
| - | - |
| Manifest (`kimi.plugin.json`) | Metadata including the plugin's name, description, icon, and keywords |
| MCP servers (optional) | One or more bundled MCP server connections, connected automatically at runtime |
| Bundled skills (optional) | Skills distributed with the plugin, mounted automatically into the cloud sandbox at runtime |

You can list published official plugins via the API. By default, the endpoint returns both official plugins and custom plugins in the current project; pass `scope=official` to return official plugins only. The examples below read your API key from the `KIMI_API_KEY` environment variable:

```bash cURL theme={null}
curl "https://api.moonshot.ai/v1/plugins?scope=official" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta"
```

```bash CLI theme={null}
kha plugins list --scope official
```

> [!NOTE]
>
> List responses are paginated: plugins are returned in `items`, and `next_page_token` is used to fetch the next page.

## Create and manage custom plugins

You can create custom plugins via the `kha` CLI, console, or API. The examples below show both cURL and `kha` CLI commands for validating, creating, publishing versions, downloading, and archiving plugins; see [kha CLI](https://platform.kimi.ai/docs/hosted-agents/kha.md) for CLI workflows and [Console](https://platform.kimi.ai/docs/hosted-agents/console.md#plugins) for console instructions.

### Prepare the plugin package

The root directory of a plugin ZIP archive must contain a manifest file named `kimi.plugin.json` with the following top-level fields:

| Field | Required | Requirements |
| - | - | - |
| `name` | Required | Plugin name |
| `version` | Required | Semantic version string for this release |
| `interface` | Required | Display metadata for the plugin and its bundled capabilities |
| `skills` | Optional | Array of skill directory paths. Each path must start with `./`, and the directory must exist and contain `SKILL.md` |
| `mcpServers` | Optional | Object keyed by MCP server key. Each entry declares a remote MCP server via `url`; stdio/local plugins are not supported |

`interface` must contain the following fields:

| Field | Requirements |
| - | - |
| `displayName` | Display name of the plugin |
| `shortDescription` | At most 20 characters, with no trailing punctuation |
| `longDescription` | Full description of the plugin |
| `developerName` | Developer or team name |
| `tryPrompts` | At least one example prompt |
| `defaultLocale` | Base language for `interface` copy: `zh-CN` or `en-US` |
| `locales` | Fixed to `"./locales/"` |

When `skills` is used, you must also provide `displayName` and `description` for each skill keyed by skill directory name under `interface.skillOverrides`. When `mcpServers` is used, provide both fields keyed by MCP server key under `interface.mcpOverrides`.

Text inside `interface` is written in `defaultLocale`, and you must also include a translation file for the other locale under `locales/`: `zh-CN.json` when `defaultLocale` is `en-US`, or `en-US.json` when `defaultLocale` is `zh-CN`. The localization file must translate both the main interface copy and all corresponding entries in `skillOverrides` and `mcpOverrides`.

Plugin archives and projects are subject to the following limits:

* ZIP archive size up to 64 MiB, uncompressed size up to 128 MiB, and up to 500 entries.
* Up to 50 active custom plugins per project.
* Retains the 20 most recent versions per plugin.

### Validate and create a plugin

Call the validation endpoint first to check your plugin archive, then create the plugin and publish its initial version:

```bash cURL theme={null}
curl -sS -X POST "https://api.moonshot.ai/v1/plugins/validate" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta" \
  --form "file=@data-tools.zip"
```

```bash CLI theme={null}
kha plugins validate data-tools.zip
```

The validation endpoint returns a report without publishing the plugin. If validation fails, the HTTP status code is still `200`, while `report.ok` in the response body is `false`—resolve each item in `issues` before creating the plugin.

```bash cURL theme={null}
curl -sS -X POST "https://api.moonshot.ai/v1/plugins" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta" \
  --header "Idempotency-Key: plugin-create-001" \
  --form "file=@data-tools.zip" \
  --output plugin-created.json
PLUGIN_ID=$(jq -er .plugin.id plugin-created.json)
```

```bash CLI theme={null}
PLUGIN_ID=$(kha plugins create data-tools.zip -o json | jq -er .plugin.id)
```

The creation response contains `plugin`, `version`, and `report`. Save `.plugin.id` as `PLUGIN_ID` for subsequent commands. To list custom plugins in your current project, run:

```bash cURL theme={null}
curl -sS "https://api.moonshot.ai/v1/plugins?scope=project" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta"
```

```bash CLI theme={null}
kha plugins list --scope project
```

### Publish a new version

The version number is read directly from the `version` field in `kimi.plugin.json` rather than passed as a separate request parameter. After updating `version` and your archive contents, publish a new immutable version:

```bash cURL theme={null}
curl -sS -X POST "https://api.moonshot.ai/v1/plugins/$PLUGIN_ID/versions" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta" \
  --header "Idempotency-Key: plugin-version-1-1-0" \
  --form "file=@data-tools-1.1.0.zip"
```

```bash CLI theme={null}
kha plugins versions create "$PLUGIN_ID" data-tools-1.1.0.zip
```

`version` must not have been published before; duplicate versions return `409` (`conflict_error`). The `name` in the new archive must match the existing plugin—renaming requires creating a new plugin. Each release produces an immutable version, and version lists are ordered by semantic version from newest to oldest.

`latest` resolves to the highest published semantic version. Pre-release versions are excluded unless no stable release exists, in which case `latest` resolves to the highest pre-release version.

### Download and archive

Download the archive for a specific plugin version:

```bash cURL theme={null}
curl -sS "https://api.moonshot.ai/v1/plugins/$PLUGIN_ID/versions/1.1.0/content" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta" \
  --output data-tools-export.zip
```

```bash CLI theme={null}
kha plugins content "$PLUGIN_ID" 1.1.0 --out data-tools-export.zip
```

Archive a custom plugin when it is no longer needed:

```bash cURL theme={null}
curl -sS -X POST "https://api.moonshot.ai/v1/plugins/$PLUGIN_ID/archive" \
  --header "Authorization: Bearer $KIMI_API_KEY" \
  --header "kimi-api-version: 2026-09-01-beta"
```

```bash CLI theme={null}
kha plugins archive "$PLUGIN_ID"
```

Once archived, the plugin disappears from list results, and endpoints for retrieving the plugin, its version list, or version content all return `404`. Archived plugins cannot be used in new agent versions, and the plugin name becomes available for reuse.

> [!WARNING]
>
> Archived plugins are also filtered out at runtime, affecting existing agents even if they pinned an exact plugin version. Before archiving, review any agents that still need to run and confirm no active references remain.

## Use plugins in an agent

### Official agents: ready out of the box

Official agents provided by the platform (such as PPT Assistant) come preconfigured with the plugins they need—no setup is required. When you create a session directly with an official agent, the MCP servers and skills bundled in its plugins take effect automatically at runtime. Select an official agent and start a session in the [Console](https://platform.kimi.ai/docs/hosted-agents/console.md) to begin right away. For the PPT Assistant configuration, see [Design a PPT Generation Agent](https://platform.kimi.ai/docs/hosted-agents/official-ppt-agent.md).

### Custom agents: reference by ID

Custom agents reference plugins by `plugin_id` in their `plugins` array. Official plugins must be currently published, and custom plugins must be created with at least one published version first.

Referencing an official plugin requires only `plugin_id`; you cannot explicitly specify `version`. For custom plugins, version resolution works as follows:

* Omit `version`: Pins the latest published version available when creating or updating the agent.
* Specify an exact published version: Pins that version.
* Pass `latest`: Leaves the version unpinned and re-resolves to the current `latest` version on each wakeup.

When you omit `version` or specify an exact version, the pinned version appears in the `version` field of the agent response; when you pass `latest`, `"latest"` is retained and re-resolved on every wakeup. You can select official plugins on the **Agents** form in the console, or include their `plugin_id` entries in `plugins` when creating or updating an agent via the API.

> [!TIP]
>
> Some MCP servers bundled inside plugins require OAuth authorization or access credentials. Those credentials are not stored in the agent configuration—inject them at runtime via a Vault. See [Vaults](https://platform.kimi.ai/docs/hosted-agents/vaults.md) and [MCP](https://platform.kimi.ai/docs/hosted-agents/mcp.md).

## Version pinning for official plugins

Official plugin versions are maintained by the platform. Whenever a new agent version is created, the platform pins the official plugin version active at that time, so existing agents do not upgrade automatically; to adopt a newer official plugin version, update the agent and resubmit the plugin reference.

## Use plugins in the console

In the console, you can browse official plugins, create custom plugins, and select plugins while creating or configuring an agent. For navigation paths and step-by-step instructions, see [Console](https://platform.kimi.ai/docs/hosted-agents/console.md#plugins).

## Next steps

> [card] [Attach plugins to an agent](https://platform.kimi.ai/docs/hosted-agents/agents.md)
>
> Create and update agents that reference plugins.

> [card] [Manage plugin versions and archival](https://platform.kimi.ai/docs/hosted-agents/plugins.md#create-and-manage-custom-plugins)
>
> Publish, download, and archive custom plugins.

> [card] [Manage plugin credentials](https://platform.kimi.ai/docs/hosted-agents/vaults.md)
>
> Store access credentials required by plugins and MCP servers.
