RaksHex Documentation
Spend limits and change safety for the APIs your code depends on.
What RaksHex does
RaksHex has three parts, built in this order:
- Budget Lock (private beta): Route OpenAI-compatible (
/v1/chat/completions) and Anthropic (/v1/messages) calls through the RaksHex gateway. Hard spend caps per workspace, per agent, and per gateway key are checked together before each call runs. - Self-Repair (prototype): Locates TypeScript call sites hit by an API change, proposes the minimal fix as a draft pull request, checks compilation with
tsc --noEmit, and waits for human review. It never merges. - Leaked-key alerts (in development): Scans built bundles (
rakshex secrets --bundle) for keys shipping to browsers and checks code against API retirements (rakshex retirements).
Honest limit: Only calls routed through the RaksHex gateway are capped. Calls made directly to a provider are not metered or blocked.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RAKSHEX_GATEWAY_KEY,
baseURL: process.env.RAKSHEX_GATEWAY_URL, // issued with your private-beta access
defaultHeaders: {
"x-rakshex-agent-id": "support-triage",
},
});Access & packages
RaksHex is in private beta, built by an early-stage team in Bengaluru, India. The CLI and SDK are not yet published to npm. Access is by request.
Guides
Change baseURL, add x-rakshex-agent-id, set a hard cap, and handle 403 refusals.
Caps, scopes, worst-case reservation, settlement, webhooks, and limits.
Draft PRs, tsc --noEmit verification, Stripe Endive rule, and boundaries.
Scan built bundles with rakshex secrets --bundle and check API retirements.
Commands: budgets, costs, secrets, retirements, and repair.
Plain answers on metering, caps, prototype scope, and private-beta access.