fix(quota-poller): switch Kilo balance to tRPC batch endpoint#215
Merged
typelicious merged 1 commit intomainfrom Apr 18, 2026
Merged
fix(quota-poller): switch Kilo balance to tRPC batch endpoint#215typelicious merged 1 commit intomainfrom
typelicious merged 1 commit intomainfrom
Conversation
The initial probe-list approach (4 REST URLs on kilocode.ai/kilo.ai) all returned 404 or 308 because Kilo's balance lives behind a tRPC batch call, not REST. Replaced with a single GET to https://app.kilo.ai/api/trpc/user.getCreditBlocks,kiloPass.getState, user.getAutoTopUpPaymentMethod?batch=1&input={urlencoded JSON} Implementation cribbed from CodexBar's open-source Swift fetcher (https://github.com/steipete/CodexBar) — same endpoint, same schema. Amounts arrive in mUSD; we sum amount_mUsd across creditBlocks for total, use totalBalance_mUsd for remaining, and divide by 1_000_000. Verified live: a real Kilo account now reports total=\$40.00 used=\$11.45 in the operator dashboard. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The REST URLs shipped in v2.2.0 all return 404/308 — Kilo never published a stable REST balance API. The real endpoint is a tRPC batch that CodexBar discovered and documented in its open-source Swift code.
Test plan
🤖 Generated with Claude Code