Multi-provider metering and richer pricing.
Container image: docker pull ghcr.io/sylvester-francis/leash:0.2.6
Before you upgrade: one behavior change
Under a cost budget, leash now fails closed on billed activity it cannot price, not just on a blind meter. A call that reports server-side tool requests (Anthropic server_tool_use web search / fetch) is a per-request charge with no entry in the price table, so with the default --on-blind=refuse it now stops the run (server_tool_unpriced). If your agents use provider-side tools under a budget, either price them (web_search_per_request / web_fetch_per_request) or set --on-blind=warn.
Added
- Native Gemini metering. leash reads Google's Gemini
generateContent/streamGenerateContent(usageMetadata) as a third wire format. Because leash keys on the wire format, not the model name, "OpenAI-compatible" already covered Gemini and Ollama through their OpenAI-compatible endpoints; this adds the native API. A new model version never needs a code change. - Anthropic thinking tokens (
output_tokens_details.thinking_tokens) are metered at the reasoning rate, matching OpenAI reasoning and Gemini thoughts. - Opt-in priced dimensions in the
--pricestable: per-request tool rates (web_search_per_request,web_fetch_per_request), audio (audio_input,audio_output), per-TTL cache-write (cache_write_5m,cache_write_1h), and per-service-tier overrides undertiers. Each is optional and falls back to a coarser rate, so existing tables are unchanged; each subset is priced exactly once.
Verify
Every artifact is cosign-signed with SBOM and SLSA provenance; see docs/security-model.md.