provider-adapters
Provider-specific auth sources, quota windows, endpoint shapes, error recovery, and quirks for the quota-axi providers with dedicated sections below; Muse is covered in the README provider notes.
How do I install this agent skill?
npx skills add https://github.com/kunchenguid/quota-axi --skill provider-adaptersIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill acts as a technical reference for provider-specific authentication and quota management logic. It describes the legitimate handling of credentials, environment variables, and local CLI tools (like sqlite3 and agy) for monitoring AI usage. No malicious patterns, exfiltration, or obfuscation techniques were identified.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Provider Adapters & Quirks
This reference details the credential sources, endpoint contracts, quota window structures, error handling, and vendor-specific quirks for the providers with dedicated sections below. Muse has no section here; its specification lives in the README provider notes.
1. Anthropic Claude (claude)
- Credential Sources (evaluated in order):
env(CLAUDE_CODE_OAUTH_TOKEN): Takes top precedence because Claude Code resolves environment tokens before opening local stores. It has noexpiresAtor refresh token; never invent either and never route it through delegated refresh.claudeEnvOauthTokeninsrc/lib/claude-profile.tsis the single reader.claudeCredentialContextIdincludes an env marker to prevent serving stored-credential cache snapshots for environment sessions.oauth-file: Reads the local profile credentials file.keychain: macOS Keychain item matching Claude Code's validated user account selector. Ambiguous service-only queries are forbidden. Value reads require an existing non-secret access marker (0600) or--allow-keychain-prompt. Keychain failures (including exit 44) must never retire the cache.
- Quota Windows:
- Windows can include
five_hour,seven_day,seven_day_opus, andextra_usage. - When the OAuth usage payload includes a
limitsarray, that array is authoritative over top-level fields. It exposes active limits, including model-scoped limits (e.g. Fable) viascope.model.display_name, assigned window IDmodel:<slug>.
- Windows can include
- Soft Expiry: A stored-expired, refreshable Claude token definitively rejected by the endpoint produces
authStatus: expired_refreshable(a soft failure retaining cache), neverauth_required. - Native Quota Probe: Bounded opt-in native inference quota probe lives in
src/providers/claude-native-quota.ts. Keep it distinct from delegated refresh. - Delegated Refresh: Permitted via
claude doctoronly when no Claude Code process is running (src/lib/running-processes.ts).
2. OpenAI Codex (codex)
- Credential Sources (evaluated in order):
- Native
$CODEX_HOME/auth.jsonor~/.codex/auth.jsonOAuth. - Pi
openai-codexand any siblingopenai-codex-*entries in the same Piauth.json. - CLI fallback via the
app-serverJSON-RPC probe.
- Native
- Multi-Account Lanes:
src/providers/accounts.tscollects distinct Pi entries and the nativecodex-homelane.- Accounts are matched and deduplicated on the ChatGPT account ID reported by the probe/store, never on email or token strings.
- If a native reading matches an existing Pi lane account ID, it collapses into that lane, publishing whichever reading is fresher; coalescing never removes the shared
codex-homecache slot by name, so another account's snapshot cannot be discarded. Contract: README Multiple accounts.
- Authorization Rules: OAuth access token is authoritative. An expired
id_tokenalone must never markauth-jsonexpired or skip the bearer probe. Never sendOPENAI_API_KEYto ChatGPT quota endpoints. - Bound Conflict: Codex model windows are metered separately as
additional_rate_limits/rateLimitsByLimitId. If an inherited base weekly window reads zero while a model window retains allowance, quota-axi publisheseffectiveAvailability[].boundConflictand reports scopeunknownrather than asserting exhaustion. - Delegated Refresh: Codex
app-serverJSON-RPC probe acts as both CLI fallback and delegated refresh.
3. Cursor (cursor)
- Credential Sources:
- Editor
state-vscdb: Reads$CURSOR_STATE_DBor local Cursor state database viasqlite3 -readonlyforcursorAuthvalues. Ifsqlite3is missing, reportsqlite3_unavailablewithout attempting package installation. - Cursor CLI (
cursor-agentinsrc/providers/cursor-cli-credential.ts): macOS usescli-keychain; Linux usescli-authfilereadingaccessTokenfrom$CURSOR_CLI_CONFIGor XDGcursor/auth.json.
- Both sources operate independently; Cursor Desktop is not required.
- Never read
refreshTokenorcursor-refresh-token. No delegated refresh exists for Cursor.
- Editor
- Quota Windows:
- Windows from
GetCurrentPeriodUsage:included_usage,auto_usage,api_usage,spend_limit. - Grok Bot from
GetSandUsageStatus: Metered separately under scopegrok_bot. Kept off the IDEall_modelsbound. Do not invoke trial, banked-reset, or machine registration RPCs.
- Windows from
- Monthly Billing Cycle Calculation:
- Resets on subscription renewal date.
startsAtis calculated frombillingCycleStartor by steppingbillingCycleEndback one calendar month (clamped to the shorter month). - Never substitute a fixed 30-day duration.
- Resets on subscription renewal date.
4. GitHub Copilot (copilot)
- Credential Sources (
COPILOT_SOURCE_ORDER):api:$GITHUB_COPILOT_APPS_JSONor localgithub-copilot/apps.json.copilot-cli:keychain: Native secure store for standalone Copilot CLI (macOS Keychain or Windows Credential Manager viasrc/lib/windows-credential.ts).gh:hosts.yml: Narrow block-mapping reader insrc/providers/gh-cli-credential.tsthat extracts the selected host'soauth_token(github.comunlessQUOTA_AXI_COPILOT_HOSTnames a*.ghe.comhost). Never read theghkeyring orGH_TOKEN/GITHUB_TOKEN.
- Scope & Entitlement:
- Default endpoint is
https://api.github.com/copilot_internal/userwithgithub.comtokens.QUOTA_AXI_COPILOT_HOST=<subdomain>.ghe.com(case-insensitive; lowercased) opts into that GHE Cloud host:https://api.<host>/copilot_internal/user, tokens only from matchingapps.jsonentries and theghlogin for that host. Full URLs,api.prefixes,github.com, and other non-*.ghe.comvalues are ignored. Copilot CLI source is github.com-only. Cache is per host. - Quota snapshot windows include
chat,completions, andpremium_interactions. - If the endpoint returns entitlement without numeric quota windows, return a fresh report with
windows: []rather than inventing numbers or percentages. - Native CLI readings (
source: cli) are never cached.
- Default endpoint is
5. xAI Grok (grok)
- Credential Sources:
- Grok CLI session auth:
$GROK_AUTH_JSON, inline$GROK_AUTH,$GROK_AUTH_PATH, or~/.grok/auth.json. Recognizes official Grok Build OIDC records scoped toauth.x.aiwithauth_mode: oidc. - Pi
xaientry:$PI_CODING_AGENT_DIR/auth.json(OAuth or API key).
- Grok CLI session auth:
- Usability & Fallback:
- Usable if either CLI or Pi source is usable. True sign-out requires all applicable sources unavailable or rejected.
- Consumer credits are fetched via
GetGrokCreditsConfig. If rejected by an official Build/Pi OAuth token, probe the no-spend model catalog (cli-chat-proxy.grok.com/v1/modelsfor Build,api.x.ai/v1/modelsfor Pi), discard the response body, and reportauthStatus: usablewith empty windows. Never derive quota from model presence. - Pi API key establishes usable, unmeasurable model auth.
- Delegated refresh: Permitted via
grok models. Cache fallback accepts onlywebsource snapshots.
6. Moonshot Kimi (kimi)
- Quota Windows:
/usagesreturns a map (limit_5h,limit_7d,limit_month_total,limit_month_code) or legacyusage+limits[]. Ratios are read strictly fromused_ratio.limit_month_codeis the code-typed share oflimit_month_total, not a separate cap. It carriespercentUsedandshareOf: month_total. It never bounds a scope or derives a remaining allowance. Default TOON formats it as an attentionsharerow; TUI displays percent used of parent.- Any declared entry lacking a usable ratio is marked in
state.untrustedWindowIds(usages:<key>), degrading the bound topartial.
- Dual Deployment Environments:
src/providers/kimi-code-config.tsreadsconfig.toml(storage,key,oauth_host,base_url).- Region allowlist restricts requests to Kimi Code's two official deployments (global vs mainland China). Never pair one deployment's token with another's host origin.
- If configuration cannot be parsed conclusively, mark
environment_unconfirmedand open no credential to avoid cross-environment cache corruption.
- Pi Source & Expiry:
- Pi
kimi-codingentry (api_key or oauth). Refreshable expired credentials produce non-definitive failures preserving cache. Refresh token values are never read or exchanged.
- Pi
7. Z.AI GLM (zai)
- Credential Sources: Pi
auth.jsonzaiapi_keyfirst (sourcepi:zai), then opencodeauth.json(zai-coding-planor alias). - Endpoint: Single GET to
/api/monitor/usage/quota/limitwith the key in a BearerAuthorizationheader. - Window Decoding: Tolerant schema mapping using magic numbers:
TOKENS_LIMIT/CREDIT_LIMIT:unit: 3, number: 5->five_hour;unit: 6, number: 1->weekly.TIME_LIMIT->mcp_month.- Unrecognized or duplicate limits degrade to
kind: "unknown"windows named instate.untrustedWindowIds.
- Bound Separation:
zaiSemanticskeeps usage windows underall_modelsbound andmcp_monthundertoolsbound.
8. OpenCode Go (opencode-go)
- Quota Semantics: Rolling 5-hour ($12), weekly ($30), and monthly ($60) stacked plan caps jointly bind
all_models. Requests are blocked when any cap is hit. - Limitations: The endpoint supplies no cycle duration of its own, so plan-declared cycle lengths fill in when the payload carries none (a payload-supplied duration still wins) and pace, runway, and selection are measurable. The endpoint provides no Zen balance. An exhausted plan window with balance fallback reports plan-exhausted with fallback named in prose.
- Sources:
defaultOpenCodeGoCredentialSources(opt-in Pi auth, then OpenCode 2.x's read-onlyopencode.dbcredentialrowopencode:opencode.db, then legacyopencode:auth.json). Read-only; no refresh delegate.
9. Google Antigravity (agy)
- Discovery & Transport: Prefers installed CLI command
agy -p "/quota" --output-format json(bounded read, not an agent session). Falls back to active loopback endpoint. - CSRF Handling: Loopback 401 with
missing CSRF tokenis treated asunavailable, preserving disk cache. - Stale Resets: Readings with
resetsAtin the past are marked stale. - Safety: Antigravity is strictly read-only: never reads memory, signs in, mutates config, or contacts unowned ports.
- Uninstall Detection: Cache is retired (not served) when the
agyCLI is absent and no Antigravity process is running. An installed-but-stopped CLI still uses the stale fallback cache.
10. Command Code (commandcode)
- Credential Sources: Pi
commandcode,$COMMAND_CODE_API_KEY,$COMMANDCODE_API_KEY,~/.commandcode/auth.json,~/.omp/agent/auth.json. - Endpoints:
GET /alpha/whoami?limits=1andGET /alpha/billing/creditsviaproviderFetch. - Bound Interpretation: Exact
credits.remainingplusfive_hour/weeklyformincluded_creditsbound only when both windows are present and trusted. A credit-only reading reports balance as an attentioncreditsrow, neverno_quotaor derived percentage. - Context Scoping: Reuses stale snapshots only after successful
whoamimatches the source/account context.
11. ElevenLabs (elevenlabs)
- Credential Source:
$ELEVENLABS_API_KEY(sent asxi-api-key). CLI OAuth bundle is not read. - Endpoint:
GET /v1/user/subscriptionviaproviderFetch. - Quota Windows: Single
characterswindow (character_count/character_limit). Reset derived by steppingnext_character_count_reset_unixback bycharacter_refresh_period. - Permissions: HTTP 401 with
detail.status: missing_permissionsor HTTP 403 indicates a valid key lacking quota scope; reported asauthStatus: usablewithout clearing cache. - Context Scoping: Snapshots scoped by source plus SHA-256 digest of the API key.
12. DeepSeek & OpenRouter (deepseek, openrouter)
- Credential Skeleton: Shared env + Pi credential handling in
src/providers/env-pi-credential.tson top ofsrc/lib/pi-agent-dir.ts. - Semantics: Expose key caps or balances as raw credits with unknown effective semantics, never invented model headroom.
13. Alibaba Cloud (alibaba)
- CLI Fallback: Uses read-only
blusage command. Maintains established account bounds without own-window overrides unless empirical evidence exists.
14. MiniMax & MiMo (minimax, mimo)
- Endpoints (MiniMax only): Balance and quota inspection endpoints. Context-scoped cache via SHA-256 context hashing of credential source and host. Read-only.
- MiMo:
MIMO_API_KEYalone establishes usable auth; no endpoint is probed (quota display is dashboard/cookie based), nothing is cached, and windows stay empty.
15. Devin (devin)
- Credential Sources (evaluated in order):
env:WINDSURF_API_KEY: non-blank$WINDSURF_API_KEY(optional$WINDSURF_API_SERVER_URL). A blank value selects nothing.file:credentials.toml:$XDG_DATA_HOME/devin/credentials.toml,~/.local/share/devin/credentials.toml, or%APPDATA%\devin\credentials.tomlon Windows, reading thewindsurf_api_keykey.
- The session token never expires and carries no refresh token: there is no delegated refresh,
devinis never launched, anddevin auth loginappears only as sign-out advice after a definitive 401/403.
- Endpoint: One read-only Connect-JSON
POSTofSeatManagementService/GetUserStatusthroughproviderFetch. The token is sent only tohttps://server.codeium.com; any otherapi_server_urlorigin is a skippedunsupported_serverattempt and never receives the token. - Quota Windows:
weekly(week, 604,800s) plusdailyonly whenplanInfo.hideDailyQuotais explicitlyfalse(it reuses thesessionkind: iddaily, labelday, 86,400s). Both boundincluded_quotajointly when both are trusted (weekly alone whenhideDailyQuotais explicitlytrue), neverall_models. AbillingStrategyother thanBILLING_STRATEGY_QUOTApublishes no windows, and a proto3-omitted percent with a present reset reads 0 remaining. - Context Scoping: Snapshots carry an opaque SHA-256 of the answering source and first-party host plus a one-way digest of the token (
devinReadingContextIdinsrc/providers/devin-cache-context.ts); a definitive rejection retires only a snapshot whose identity matches the rejected token.
16. Higgsfield (higgsfield)
- Credential Source: The installed
higgsfieldCLI (higgsfield-cli).inspectAuthreports the command present or missing without probing quota; quota-axi never reads Higgsfield credential files, never runshiggsfield auth token, and never publishes the account email the status payload includes. - Fixed argv:
higgsfield account status --json,higgsfield account transactions --json --size 100, andhiggsfield generate list --json --size 20, each bounded to 15 seconds. The transactions and jobs aux commands run concurrently; a failure omits that aux rather than failing the status reading and is additionally surfaced as adegraded_sourceattention row (higgsfield-transactionsorhiggsfield-jobs). - Quota Windows: The status payload has no limit or reset field, so a
creditswindow (scopeincluded_credits) is published only when the firstaccount transactionspage holds asubscription creditsgrant as its only positive-credit entry and the balance reconciles with that grant plus the on-page entries newer than it (within floating-point slack); otherwise the rawcredits.remainingbalance is reported with no percentage. The grant must be on the first page. No cycle is invented: pace staysunknown, and runway readsexhausted_nowat zero balance andunknownotherwise, namingcreditsinunmeasurableWindowIds. - Jobs rollup:
generate listentries are reduced tojobs.{sampled,completed,failed,other}counts; job ids, prompts, URLs, and model names are discarded. Those counts are stored with the snapshot the same waycreditsis; a snapshot that never carried jobs stays without them. Higgsfield is excluded from--max-agereuse because a CLI login switch is not a traced file and the status payload has no stable non-email account discriminator. - Fresh reuse:
--max-age/QUOTA_AXI_MAX_AGEnever serves a Higgsfield reading; every Higgsfield quota call live-reads the vendor CLI. - Error handling: A status failure classifies only from the closed sentinel set (
higgsfield_cli_unavailable,higgsfield_sign_in_required,higgsfield_status_malformed_json, wrappedhiggsfield_status_failed); never re-run keyword regexes over wrapped stderr. - Delegated Refresh: None;
ProviderOptions.refreshCredentialsis ignored.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/kunchenguid/quota-axi/provider-adapters">View provider-adapters on skillZs</a>