Keys / Moonshot AI

MOONSHOT_API_KEY

The Kimi API Platform key your app calls Kimi models with. Each key belongs to a project and stops working if its creator leaves the project.

Expires
the docs don't say
API
list, rename and revoke, with an Admin API key; no create

Get it

Create one on platform.kimi.ai/console/api-keys. The steps aren't recorded yet.

Set it

MOONSHOT_API_KEY=...

No official SDK reads it. Moonshot's docs use the OpenAI or Anthropic SDK with Kimi's base_url, and your app passes the key in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Create a new key in the same project, so it shares the project's budget and rate limits.
  2. Deploy it everywhere that reads MOONSHOT_API_KEY.
  3. Check that requests succeed with the new key, then revoke the old one. Revoking takes effect at once.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16