Kimi API first request — 27 September 2026

Python 3, standard library only. No SDK needed.

1. Extract this ZIP. Open a regular terminal in the extracted folder.
2. Windows: py first_request.py (or python first_request.py).
   macOS/Linux: python3 first_request.py.
3. If MOONSHOT_API_KEY is already supplied to the process, the script uses it
   and sends one paid request immediately. Otherwise paste/type your key at
   the hidden prompt. No characters appear. Enter sends one paid request;
   Ctrl+C cancels. Empty input sends nothing.

The prompt does not write your key to a file or set it for later shell commands.
If hidden input is unavailable, use a regular terminal or let your secret
manager supply the environment variable. Do not put your key in source files.

The example prints finish reason, usage and a completed answer. Read the answer
for accuracy. There are no automatic retries; after a failure, check provider
usage before running the example again.

Offline checks (do not send requests or require credentials):
  Windows: py test_first_request.py
  macOS/Linux: python3 test_first_request.py
The tests use dummy values and simulated responses and block HTTPSConnection.
original_first_request.py is included ONLY for the offline comparison test;
run first_request.py for the current guide.

Provenance:
The request_once function and REQUEST payload are unchanged from the live
25 September 2026 example. The hidden-input helper was added and tested locally
on 27 September; this is not a new live API trial. The four original requests
and responses are preserved separately:
https://chinaai.chat/wp-content/uploads/2026/09/chinaai-kimi-api-evidence-2026-09-25.zip

Guide: https://chinaai.chat/kimi/api/
Python hidden input: https://docs.python.org/3/library/getpass.html
Kimi API: https://platform.kimi.ai/docs/overview
