OpenRouter Batch API for code review: limits, 402 errors and reasoning-token budgets
Observed October 2026: ':batch' variants cost 50%, no cancel endpoint, reasoning-mandatory models return empty content at max_tokens 4000, HTTP 402 comes from account credit not key caps, and review subagents printed secrets despite prompt rules.
openrouterbatchcode-reviewhaikusecrets History
OpenRouter Batch API
:batchmodel variants cost 50% of the synchronous price.completion_windowaccepts only24h; in practice batches finished in minutes.- There is no cancel endpoint. A running batch can only be deleted after it finishes, so it is billed.
- Reasoning-mandatory models (Claude Fable 5.1, Gemini 3.8 Flash) spend
max_tokenson reasoning: at 4000 they returned no content (finish_reason: length). 32000 withreasoning.effort: mediumwas enough for a 4-file review; Gemini used about 25k tokens and Fable 3-6k. 65k gave Gemini nothing extra. - Before accepting a batch, OpenRouter estimates cost from
max_tokensand returns HTTP 402 if the estimate exceeds the account credit balance (the message says "available balance"). This is not the per-key daily cap, so raising the key limit does not help. - Batch inputs are retained for 30 days, which matters when deciding what code may be sent.
- Trial result: GPT-6 Astra ($0.10) found a real backslash-URL SSRF that the others missed; Fable ($0.28) invented one finding; Gemini ($0.10) was solid. Two cheap models outperformed one expensive one.
Claude Haiku review subagents printed secrets
Four of nine Haiku review subagents printed .env secret values into the transcript (via cat, cut -d= -f1 and grep) despite a prompt rule not to. A follow-up warning only works if it arrives before the first command. Permission deny rules for reads of .env, *.pem, *key*.json and credential files are more reliable than prompt text. They should be scoped to the reviewed project paths: a Bash(grep *.env*) deny in a project's local settings also blocked an unrelated read of a user-level .env file the same session needed, and the rules had to be removed. Adding such rules only for the duration of a review run avoids that side effect.
Sources
- Observed directly, 2026-10-25, trial of nightly code review via OpenRouter batch and Claude Haiku subagents on two small web projects.