docs/perplexity.md
CodexBar reads Perplexity account credit data with a Perplexity web session cookie. It does not use a Perplexity API key and does not support token-cost history.
Cookie: header or a bare
Perplexity session-token value.Manual mode accepts these session cookie names:
__Secure-authjs.session-tokenauthjs.session-token__Secure-next-auth.session-tokennext-auth.session-tokenYou can also provide credentials through the environment:
export PERPLEXITY_SESSION_TOKEN="..."
export PERPLEXITY_COOKIE="__Secure-next-auth.session-token=..."
CodexBar requests:
GET https://www.perplexity.ai/rest/billing/credits?version=2.18&source=defaultThe request sends the resolved Perplexity session cookie, Origin: https://www.perplexity.ai, and
Referer: https://www.perplexity.ai/account/usage.
Automatic mode tries any cached Perplexity cookie first, then imports browser cookies, then falls back to environment variables. Browser-imported cookies are cached and invalid cached cookies are cleared after a rejected request.
Purchased credits do not reset, so the menu displays that balance without a reset prefix.
codexbar usage --provider perplexity --verbose
Sign in to perplexity.ai and refresh CodexBar, or paste a fresh cookie/session token in manual mode.
Log out and back in to Perplexity. If manual mode is enabled, paste a new Cookie: header or session-token value.
Open Perplexity account usage in the same browser profile and confirm the account has visible credit data.
Sources/CodexBarCore/Providers/Perplexity/PerplexityProviderDescriptor.swiftSources/CodexBarCore/Providers/Perplexity/PerplexityUsageFetcher.swiftSources/CodexBarCore/Providers/Perplexity/PerplexityUsageSnapshot.swiftSources/CodexBarCore/Providers/Perplexity/PerplexityCookieHeader.swiftSources/CodexBar/Providers/Perplexity/PerplexityProviderImplementation.swift