Kimi Agent Module API
The stable, host-independent contracts for building Kimi application modules: separately installed packages that add commands, LLM tools, background jobs, event handlers, per-guild settings, and durable data to a Kimi deployment.
This package contains no bot runtime, Discord client, database implementation, or module loader. It exports:
ModuleSpec,ModuleLoadContext,ModuleRuntimeContext: the declaration a module publishes and the two contexts the host hands it.kimi_agent_module_api.contracts: every runtime port as atyping.Protocol(storage, scheduler, events, Discord actions, interactions, HTTP, services, trust, proposals, health) plus the validators the host runs at preflight.kimi_agent_module_api.events: the normalizeddiscord.*event payloads.kimi_agent_module_api.testing: a fake for every port,load_context()for exercisingcreate(), andMemoryStorage(install thetestingextra) so a module can unit test itself with only this package installed.
A module exposes a ModuleSpec through the kimi_agent.modules entry-point
group:
[project]
dependencies = ["kimi-agent-module-api>=1,<2"]
[project.entry-points."kimi_agent.modules"]
my_module = "my_module_package:SPEC"
The module guide documents installation, declarations, lifecycle, and every runtime port. The reference module is a complete, commented example that exercises most ports; start there.
Guild-scoped live command replacement was added in 1.1. Modules using
InteractionRouter.replace_guild_commands() should depend on
kimi-agent-module-api>=1.1,<2 and require the host capability
discord.guild_commands.v1.
Version 1.2 adds typed modal forms and a narrow Components V2 layout model. Once a response uses
that layout model, Discord requires every later edit of the same message to remain a layout.
Modules using them should depend on kimi-agent-module-api>=1.2,<2 and require
discord.modals.v1 and/or discord.components_v2.v1.
Version 1.3 adds cached author classification to message-deletion events:
MessageDeleteEvent.author_is_bot and MessageBulkDeleteEvent.bot_message_ids.
The values remain unknown for messages that were absent from Discord's cache.
Testing the SDK
From this package directory, run its tests without installing the Kimi application:
uv run --isolated --group test python -m pytest -q
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kimi_agent_module_api-1.3.0.tar.gz.
File metadata
- Download URL: kimi_agent_module_api-1.3.0.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23a6ade1cd56146912503a4564e5578e885f31337d2ed0f5acd8fd6eeaed230f
|
|
| MD5 |
b5c5ab2a02cc7d19e461db06284e32c4
|
|
| BLAKE2b-256 |
3c795839f42efa05d56c14375705de50e1000ca8207b5872b39763bf0bd11aaf
|
File details
Details for the file kimi_agent_module_api-1.3.0-py3-none-any.whl.
File metadata
- Download URL: kimi_agent_module_api-1.3.0-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e479d7c3bcb55fd397dfcd0c0782b41ae8759ebeb097f26b5697b731605d82ab
|
|
| MD5 |
69fc4a89321355d000d33fb861a1919e
|
|
| BLAKE2b-256 |
4cba5e4fb6789b542cdf34e868bdacce53cc098bc23e6060bf466ad5eb8b7ae4
|