kim-api

kim-api is a command for Claude Code from KimYx0207/Kim_Service. It costs 24 tokens per session (1,212 once invoked), scanned A, original, MIT.

An API-generation command that turns an interface description into an endpoint with routes, parameter checks, responses, error handling, and documentation.

In plain words
What is it for?
It helps create non-standard API endpoints from an operation, HTTP method, parameters, response format, and business rules.
Why use it?
It reduces the boilerplate needed to keep an API endpoint’s inputs, outputs, business logic, and documentation consistent.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Codex.

Good fit It helps create non-standard API endpoints from an operation, HTTP method, parameters, response format, and business rules.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kimyx0207/kim_service/kim-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/KimYx0207/Kim_Service

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kim-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-api/github.svg)](https://agentmods.dev/commands/kimyx0207/kim_service/kim-api)
Your own site
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-api"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kim-api

Your own site · 80×15
<a href="https://agentmods.dev/commands/kimyx0207/kim_service/kim-api"><img src="https://agentmods.dev/badge/commands/kimyx0207/kim_service/kim-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,212 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.01212
Opus 5.5 $0.00010 $0.00485
Sonnet 5.5 $0.00005 $0.00242
Haiku 4.5 $0.00002 $0.00121

Measured 1mo ago against content hash 54275702af1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kim-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • kim-api — 91% identical, 9 lines differ
tools/claudecode-codex-gemini/host/claude/commands/kim-api.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kim Service 执行门(必须先执行)

  1. 先复述原始用户意图,并列出本次计划调用的 MCP 工具、目标目录和拟新增或修改的文件;不要把本命令扩展成 Router 或自动验收流程。
  2. 任何项目写入、依赖安装、外部访问或环境变更都必须先获得对应的人类批准。未批准时只分析并展示计划。
  3. 写入前读取现有目标;目标已存在时不得用重定向、空文件或整文件覆盖。只做受管更新,遇到冲突停止并展示差异。
  4. 新文件只能在已批准的项目根目录内安全创建;不得写用户级配置。MCP 仅使用本 Tool 的 cli.mjs mcp codex 或 cli.mjs mcp gemini 运行时及其已注册工具。

Kim API生成命令

输入接口需求,生成完整API端点:路由、参数校验、错误处理、文档注释

你现在要生成API端点:$ARGUMENTS

模式说明:专门生成单个API端点,比CRUD更灵活,适合非标准接口。

执行流程

阶段1:分析接口需求

解析用户输入,提取:

  • 接口名称:如 sendVerificationCode、resetPassword
  • HTTP方法:GET/POST/PUT/DELETE
  • 请求参数:Query/Body/Path参数
  • 响应格式:返回数据结构
  • 业务逻辑:核心处理逻辑

如果信息不完整,询问用户:

📝 请补充接口信息:

1. 接口名称:发送验证码
2. HTTP方法:POST(推荐)
3. 请求参数:
   - email: string, 必填, 邮箱格式
   - type: string, 可选, 验证码类型(register/reset)
4. 响应格式:
   - success: boolean
   - message: string
   - expire_in: number (秒)

请确认或修改:

阶段2:检测项目结构

使用Glob检测项目现有的API结构:

# 查找现有路由文件
ls src/routers/ src/routes/ src/api/ routes/ 2>/dev/null

# 查找现有的Schema/Validator
ls src/schemas/ src/validators/ 2>/dev/null

遵循现有项目结构和命名规范。

阶段3:调用Codex生成代码

使用MCP工具调用Codex生成完整API:

生成内容:
1. 路由定义(含路径、方法、描述)
2. 请求参数Schema(含校验规则)
3. 响应模型Schema
4. Service层业务逻辑
5. 错误处理
6. API文档注释(OpenAPI格式)

阶段4:输出结果

# API生成结果:{接口名称}

## 接口信息

| 属性 | 值 |
|------|-----|
| 路径 | POST /api/verification/send |
| 描述 | 发送验证码到指定邮箱 |
| 认证 | 不需要 |
| 限流 | 60秒/次 |

## 请求参数

```json
{
  "email": "[email protected]",  // 必填,邮箱格式
  "type": "register"            // 可选,默认register
}

响应格式

成功 (200)

{
  "data": {
    "success": true,
    "message": "验证码已发送",
    "expire_in": 300
  },
  "error": null
}

失败 (400/429)

{
  "data": null,
  "error": {
    "code": "RATE_LIMITED",
    "message": "请求过于频繁,请60秒后重试"
  }
}

生成的代码文件

[代码内容...]


---

## 使用示例

```bash
# 基础用法
/kim-api "发送验证码接口,参数email和type"

# 详细描述
/kim-api "用户头像上传接口,POST方法,接收multipart/form-data,限制5MB,返回图片URL"

# 复杂逻辑
/kim-api "订单支付回调接口,验证签名,更新订单状态,发送通知"

支持的接口类型

类型 示例 特点
查询接口 搜索、筛选、统计 GET + Query参数
操作接口 发送、提交、触发 POST + Body参数
上传接口 文件上传 multipart/form-data
回调接口 支付、Webhook 签名验证
聚合接口 仪表盘数据 多数据源整合

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 172 lines · 24 tokens per session scan A 54275702af1e

Subscribe to this mod's changes

kim-api is a command published in the GitHub repository KimYx0207/Kim_Service (177 stars, last pushed 5d ago), licensed MIT. It adds 24 tokens to every session and 1,212 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.