docs/moonshot.md
Moonshot / Kimi API is API-only. Balance is reported by GET /v1/users/me/balance,
so CodexBar only needs a valid API key to show the current account balance.
Kimi API docs use the Moonshot API surface for current Kimi models: examples read
MOONSHOT_API_KEY and call https://api.moonshot.ai/v1, including the Kimi K2.6
quickstart. This provider is therefore named after the account and billing surface,
not a specific Kimi model version.
The existing Kimi K2 provider remains separate because it targets the legacy
kimi-k2.ai credit endpoint. Migrating or deprecating that provider should be a
separate cleanup so existing user settings are not silently repointed.
~/.codexbar/config.json or supplied via MOONSHOT_API_KEY / MOONSHOT_KEY.
CodexBar stores the key in config after you paste it in Settings → Providers → Moonshot / Kimi API.https://api.moonshot.ai/v1/users/me/balancehttps://api.moonshot.cn/v1/users/me/balanceMOONSHOT_REGION.Authorization: Bearer <api key>, Accept: application/jsonavailable_balance, voucher_balance, and cash_balance.cash_balance is negative, the card also surfaces the deficit.Sources/CodexBarCore/Providers/Moonshot/MoonshotProviderDescriptor.swift (descriptor + fetch strategy)Sources/CodexBarCore/Providers/Moonshot/MoonshotUsageFetcher.swift (HTTP client + JSON parser)Sources/CodexBarCore/Providers/Moonshot/MoonshotSettingsReader.swift (env var resolution)Sources/CodexBar/Providers/Moonshot/MoonshotProviderImplementation.swift (settings field + activation logic)Sources/CodexBar/Providers/Moonshot/MoonshotSettingsStore.swift (SettingsStore extension)