| summary | Codebuff provider data sources: API token, CLI credentials file, credit balance, and weekly rate limits. | |||
|---|---|---|---|---|
| read_when |
|
CodexBar surfaces Codebuff credit balance and weekly rate limits next to your other AI providers.
POST https://www.codebuff.com/api/v1/usage— current credit usage, remaining balance, auto top-up state, and the next quota reset date.GET https://www.codebuff.com/api/user/subscription— subscription tier, billing period end, and the weekly rate-limit window (weeklyUsed/weeklyLimit) when CodexBar is using the CLI credentials-file session token.
Both endpoints use a Bearer token. Codebuff credentials come from the environment, the normal CodexBar config file, or the official CLI credentials file; the Codebuff provider does not write a separate Keychain credential.
CodexBar resolves the Codebuff API token in this order:
CODEBUFF_API_KEYenvironment variable (takes precedence so CI overrides work). API-key tokens fetch credit balance only.- The per-provider API key stored in Settings → Providers → Codebuff (saved
in
~/.codexbar/config.jsonvia the normal CodexBar config flow). API-key tokens fetch credit balance only. ~/.config/manicode/credentials.json— the file the officialcodebuffCLI (formerlymanicode) writes aftercodebuff login. CodexBar readsdefault.authToken, falling back to top-levelauthToken, and uses that session token for both credit balance and subscription metadata.
If none of those is available, Codebuff shows the “missing token” error.
- Primary row — credit balance (
usage / quota), with the "next quota reset" date if provided. - Secondary row — weekly rate-limit window (
weeklyUsed / weeklyLimit) shown with a 7-day window.
The account panel shows the Codebuff tier (e.g. "Pro"), remaining balance, and whether auto top-up is enabled.
-
Run
codebuff loginto refresh~/.config/manicode/credentials.json. -
Override the API base with
CODEBUFF_API_URLfor staging environments. -
Verify your token works manually:
curl -s -X POST -H "Authorization: Bearer $CODEBUFF_API_KEY" \ -H 'Content-Type: application/json' -d '{"fingerprintId":"codexbar-usage"}' \ https://www.codebuff.com/api/v1/usage
Sources/CodexBarCore/Providers/Codebuff/— descriptor, fetcher, snapshot, settings reader, error types.Sources/CodexBar/Providers/Codebuff/— settings store bridge + macOS settings pane implementation.Tests/CodexBarTests/CodebuffSettingsReaderTests.swift,CodebuffUsageFetcherTests.swift, and the Codebuff extensions inProviderTokenResolverTests.swift.