docs/kimi-k2.md
This is a legacy, unofficial provider for the
kimi-k2.aicredit endpoint. For the official Kimi API account and billing surface, use the Moonshot / Kimi API provider instead.
Kimi K2 is API-only. Usage is reported by the credit counter behind
GET https://kimi-k2.ai/api/user/credits, so CodexBar only needs a valid API
key for that legacy endpoint to pull your remaining balance and usage.
~/.codexbar/config.json or supplied via KIMI_K2_API_KEY / KIMI_API_KEY / KIMI_KEY.
CodexBar stores the key in config after you paste it in Preferences → Providers → Kimi K2 (unofficial).GET https://kimi-k2.ai/api/user/creditsAuthorization: Bearer <api key>, Accept: application/jsonX-Credits-Remaining.consumed / (consumed + remaining).Sources/CodexBarCore/Providers/KimiK2/KimiK2ProviderDescriptor.swift (descriptor + fetch strategy)Sources/CodexBarCore/Providers/KimiK2/KimiK2UsageFetcher.swift (HTTP client + parser)Sources/CodexBarCore/Providers/KimiK2/KimiK2SettingsReader.swift (env var parsing)Sources/CodexBar/Providers/KimiK2/KimiK2ProviderImplementation.swift (settings field + activation logic)Sources/CodexBar/KimiK2TokenStore.swift (legacy migration helper)