Skip to content

v0.7.0 - Config-declared usage metering

Choose a tag to compare

@satya-anguluri satya-anguluri released this 21 Jul 02:38
· 20 commits to main since this release

Meter and price non-token-billed model calls (TTS characters, transcription seconds, per-request APIs) with zero client-code changes.

  • New capstead.capabilities[].usage block: model, unit (tokens | characters | seconds | requests), input-from-arg
  • CapabilityUsageRule (runtime): the interceptor synthesizes one ModelInvocation from the declared argument when the call records nothing itself; real enrichment always wins
  • Priced through the existing capstead.cost estimator like any token-billed model
  • Fix: capstead.cost.models now accepts input-only (or output-only) rates — required for usage-metered models

Example:

capstead:
  capabilities:
    - name: "Synthesize Speech"
      bean: elevenLabsSpeechSynthesizer
      method: synthesizeMp3
      usage:
        model: elevenlabs/eleven_multilingual_v2
        unit: characters
        input-from-arg: 0
  cost:
    models:
      "[elevenlabs/eleven_multilingual_v2]":
        input-per-million-tokens: 220