Skip to content

Docs

CommunityJev Cookbooks

Gate Agent Tool Calls with Jev

An OpenRouter cookbook recipe that replaces a blanket human-approval rule with a per-call Jev check: the proposed tool call, ticket, and policy go to Jev, whose probabilities route to approve, block, or review.
Format
Docs
Reading time
2 min
Published by
Community
Last verified
Oct 2026

Highlights

  • Jev is on OpenRouter as typesafe/jev-1.13 through the Decisions endpoint, so the agent model and the gate share one API key.
  • gateRefund runs two deterministic order checks, then asks Jev three yes-or-no questions about the refund, ticket, and policy.
  • Thresholds route the result: run on approve, refuse on block, and pause with status: 'awaiting_hitl' on review.
  • The client posts to https://openrouter.ai/api/alpha/decisions and validates the reply with zod, throwing on bad probabilities.
  • The recipe reports one Decisions request per call at under $0.0001 in its runs, and each decision includes a reason for the audit log.

Watch out

Grounded in the truncated cookbook capture from 2026-10-15; only the setup and the start of the request client are visible, the full gateRefund implementation, fixtures, and test harness were cut off, and the sub-$0.0001 cost is the page's own figure.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai