Agent/MCP Audit Sprint

OpenRouter incident intake

OpenRouter 402 Brownout Runbook

A focused handoff for OpenRouter-backed apps that hit 402 Payment Required, insufficient credits, stale balance snapshots, impossible max_tokens settings, or retry storms. The goal is to stop unsafe dispatch first, then choose the smallest paid review scope that can prove the fix.

SignalOpenRouter 402, waiting credits, or insufficient credits
GateStop dispatch before another expensive agent step
QuickUSD $99 for one error path or launch guardrail
FocusedUSD $299 for one live agent or SaaS workflow
EmergencyUSD $1,000 when daily burn needs containment

Brownout states to separate

Treat balance and dispatch as separate decisions. A user-facing "waiting credits" state can be useful, but the backend still needs a hard admission-control rule that decides whether the next model call is affordable, stale, unauthorized, or blocked.

Cost-control audit dashboard with status rows and review bands
402Payment Required blocks dispatch and records the active workflow state
CapAffordable max_tokens is calculated before the call, not after provider rejection
RetryStreaming fallback and retry policies cannot loop through the same failing budget state
ReceiptActual generation cost reconciles after success and refunds unused reservation

What the review checks

The paid review is scoped around one OpenRouter cost boundary: the point where your app decides whether an agent step, chat response, background job, or tool loop is allowed to spend more money.

Affordable cap: compute a viable max_tokens ceiling from balance, model price, prompt tokens, cache-read share, and safety margin.
Viable floor: if the remaining budget cannot buy a useful response, return a clear waiting-credits or upgrade state instead of dispatching.
Stale state: credits, current key limit, and cached usage snapshots have explicit TTLs and fail closed when stale.
Retry containment: 402, 429, timeout, stream abort, and provider fallback do not re-enter the same expensive route without a new reservation.
Task overrides: admin or high-priority tasks can have different caps, but every override leaves an audit trail.
Actual-cost closeout: generation total_cost or usage.cost reconciles reservation, display, and budget ledger.

Scope routing

Choose the smallest useful paid path

If the app is not burning money yet, the $99 path is enough for one brownout state or one launch guardrail. If a live workflow can repeatedly hit 402, retry, or degrade user output, use the $299 focused review. If the bill is already moving, use the $1,000 emergency sprint.

USD $99: one 402 error path, one max_tokens cap, one stale balance rule, or one launch-pricing sanity check.
USD $299: one OpenRouter-backed agent workflow with reservation, retry containment, actual-cost reconciliation, and user-facing block states.
USD $1,000: live production incident, daily burn spike, repeated agent loop, runaway retry path, or urgent launch-risk window.
Start rule: Payment only after written scope acceptance. Do not paste prompts, API keys, account ids, billing screenshots with sensitive data, or raw production traces into public issues.

Packet builder

Generate a sanitized 402 handoff

Capture only the failure shape: state, token cap, retry count, stale snapshot age, rough daily burn, and the dispatch decision needed. The generated packet routes bounded incidents to the dedicated OpenRouter 402 intake and live burn-rate incidents to emergency scope.

FitUSD $299 OpenRouter Agent Cost-Control Review
StopBlock dispatch before retrying the same budget state
RiskRetry containment and stale balance need review
GuardrailPayment only after written scope acceptance; no keys or private traces.
Open GitHub intake

Sanitized evidence packet

Public intake can stay small. The useful packet is a redacted state transition, not a dump of production data.

Product or repo URL, plus the exact workflow that calls OpenRouter.
Observed error text: 402, insufficient credits, waiting credits, current-key limit, or provider fallback.
Model id, prompt token range, intended output token range, cache-read share, and current retry policy.
Whether streaming, background jobs, tool loops, or agent continuations can retry after the first failure.
Desired decision: block, degrade, cap, queue, ask user for credits, switch model, or trigger emergency stop.