SuperAPI AI Directory

kimi-tools

Coding & development

View repository

Updated 10-15 21:42

About this skill

Kimi API Tools

Prerequisites

  • An available Kimi Code subscription is required, and set it as an environment variable:KIMI_API_KEY
  • Python 3.9 or higher is required; depending on the environment, use python3 or the python command
  • Network access is required

Quick Start

  1. Set the API Key:export KIMI_API_KEY=...
  2. First use kimi_search.py to perform keyword search.
  3. Then use kimi_fetch.py to fetch the main text by URL.

Script Description

scripts/kimi_search.py

Invoke POST /search。

python ./scripts/kimi_search.py \
  --query "短剧创作指南" \
  --limit 5 \
  --timeout-seconds 30

Parameters:

  • --query -> Search keywords (required)
  • --limit -> Number of results to return (1-20, default 5)
  • --include-content -> Whether to enable page scraping (default false)
  • --timeout-seconds -> Timeout (default 30 seconds)

scripts/kimi_fetch.py

Invoke POST /fetch。

python ./scripts/kimi_fetch.py \
  --url "https://example.com" \
  --timeout-seconds 30

Parameters:

  • --url -> Target URL (required)
  • --timeout-seconds -> Timeout (default 30 seconds)

Escape Hatch

If there is no KIMI_API_KEYin the environment, it can be passed in via the --api-key parameter, but exposing sensitive information on the command line is strongly discouraged.

Agent Usage Conventions

  • Enable --include-content and --limitas needed to control token costs.