docs/groq.md
CodexBar shows Groq organization usage and spend from the console.groq.com dashboard API, read through your browser session. This replaces the old public-API rate-limit metric, which only described request/token throttles rather than actual usage.
Default (auto) pipeline:
Source modes: web (console only), api (Prometheus only), auto (console then Prometheus).
groq.com cookies, in browser import order:
stytch_session — long-lived (~30 day) opaque token. Preferred.stytch_session_jwt — short-lived (~5 min) JWT. Used directly only as a fallback.POST https://api.stytchb2b.groq.com/sdk/v1/b2b/sessions/authenticateAuthorization: Basic base64(<publicToken>:<sessionToken>), plus X-SDK-Client, X-SDK-Parent-Host, and
Origin: https://console.groq.com headers.GROQ_STYTCH_PUBLIC_TOKEN / GROQ_STYTCH_URL if Groq
rotates it.GET https://api.groq.com/platform/v1/organizations/{orgId}/activity?start_date={unix}&end_date={unix}Authorization: Bearer <fresh session JWT>.https://groq.com/organization claim (no signature verification —
the API authenticates the token, this only reads the routing claim).cost, n_context_tokens_total, n_non_cached_context_tokens_total
(cached = context − non-cached), n_generated_tokens_total, num_requests. CodexBar aggregates these into daily
buckets and renders the shared cost-history inline dashboard (as used by the OpenAI API provider).Console.GROQ_SESSION_TOKEN — an opaque stytch_session value; exercises the full refresh path.GROQ_SESSION_JWT — a session JWT used directly (skips refresh); handy for a quick check but expires in minutes.GROQ_SESSION_TOKEN=<stytch_session> codexbar usage --provider groq --json
~/.codexbar/config.json (Settings → Providers → Groq) or GROQ_API_KEY.GET https://api.groq.com/v1/metrics/prometheus/api/v1/query for rate5m request/token/cache series.Sources/CodexBarCore/Providers/Groq/GroqConsoleFetcher.swiftSources/CodexBarCore/Providers/Groq/GroqConsoleSession.swiftSources/CodexBarCore/Providers/Groq/GroqConsoleStytch.swiftSources/CodexBarCore/Providers/Groq/GroqConsoleUsageSnapshot.swiftSources/CodexBarCore/Providers/Groq/GroqUsageFetcher.swiftSources/CodexBarCore/Providers/Groq/GroqProviderDescriptor.swift