Skip to content

feat: add BlockRun account API mode - #30

Merged
VickyXAI merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:feat/account-api-key
Sep 5, 2026
Merged

feat: add BlockRun account API mode#30
VickyXAI merged 2 commits into
BlockRunAI:mainfrom
KillerQueen-Z:feat/account-api-key

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Collaborator

XClawRouter currently requires wallet setup before the proxy can start, so BlockRun account customers cannot use the newly launched API. This adds an account billing mode that resolves BLOCKRUN_API_KEY (or the sensitive OpenClaw apiKey setting), sends Bearer-authenticated requests to https://api.blockrun.ai, and never creates or consults a wallet in that mode.

The local proxy preserves smart-routed chat and Messages behavior, streams other account API surfaces without buffering, polls async music/image-edit jobs, and keeps the existing video workflow. It strips all payment headers, reports account mode safely through /health, points 401/402 errors to the keys/credits dashboards, and updates Doctor, CLI, README, configuration docs, and bundled output. Wallet settlement remains available, with Solana listed before Base in the updated docs.

Validation:

  • npm run typecheck
  • npm test — 562 passed, 3 skipped
  • npm run lint
  • npm run build
  • npm pack --dry-run
  • Live production account API through the built local proxy: /health, 227-model catalog, and non-streaming openai/gpt-4.1-nano chat passed; the local placeholder Authorization header was overridden

Production note: account Responses streaming and video submission remain gated on deploying/configuring BlockRunAI/enterprise#10. This PR forwards those contracts but does not deploy the account gateway.

KillerQueen-Z and others added 2 commits September 4, 2026 11:51
The Lint & Typecheck job runs three steps and only the first was red:
`npx prettier --check .` flagged 7 files. `eslint src/` and `tsc --noEmit`
were already clean, and Build & Test, check and scanner all passed — so the
red X on this PR was formatting, not the account API work.

`prettier --write` on exactly those 7 files. No semantic change: the diff is
whitespace, line wrapping and quote style. Verified after: prettier --check
clean, eslint clean, tsc clean, and the suite at 562 passed / 3 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Je8JRrGK7mifyGbf8VjRM
@VickyXAI

VickyXAI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Pushed a formatting fix (b42ffc0) — Lint & Typecheck is green now.

The red X on this PR was not the account API work. That job runs three steps and only the first was failing: npx prettier --check . flagged 7 files (docs/configuration.md, README.md, src/api-key.ts, src/cli.ts, src/doctor.ts, src/index.ts, src/proxy.ts). eslint src/ and tsc --noEmit were already clean, and Build & Test, check and scanner had all passed.

Ran prettier --write on exactly those 7 files. No semantic change — whitespace, wrapping and quote style. Verified after: prettier clean, eslint clean, tsc clean, suite at 562 passed / 3 skipped.

CI has since re-run: Lint & Typecheck pass, Build & Test pass, check pass.

@VickyXAI
VickyXAI merged commit a4365f8 into BlockRunAI:main Sep 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants