cswap-bend-cli
Releases (1)
-
0.1.0.0 indexed
Definitions (4,210)
usage/norm.bend
- def result.keep
- def build_usage_resultThe normalised usage (five_hour, seven_day, spend, scoped), or JNull when the data carries nothing: build_usage_result.
usage/req.bend
- type Errkind: http-<code>, timeout, network, bad-response (the reference's _classify_usage_error names); retry: Retry-After seconds when sent; body: the response text, kept only to tell a scope 403 from other 403s (never shown).
- def retry.int
- def retry.norm
- def retry.zero
- def retry.neg
- def retry.of
- def retry_afterRetry-After in whole seconds (the seconds form only; fractions drop, a negative value is 0, anything else is none).
- def http.err
- def ok2xx
- def scope_errorThe reference raises on a 403 whose body says the token lacks scope.
- def is_429
- def bad
- def probe.pick
- def probe.reply
- def probe.result
- def probeThe one-token Messages call whose rate-limit headers carry the usage; a non-2xx that still has the headers (429 when exhausted) is a valid reading.
- def body.objdata.get on a non-object raises AttributeError in the reference.
- def body.json
- def usage.pick
- def usage.reply
- def usage.result
- def usage.get
- def fallback.pickA probe that failed after a usage-endpoint 429 hands back the 429.
- def fallback
- def route
- def usage.next
- def request_data.go
- def request_usage_datarequest_usage_data: the usage endpoint, with the probe for an inference-only token, after a scope 403, and after a 429 (whose own error stands if the probe fails too).
usage/text.bend
- def user_agent
- def usage_url
- def messages_url
- def token_url
- def client_id
- def probe_model
- def usage.config
- def probe.body
- def probe.config
- def refresh.body
- def refresh.config
- def maybe.none_if
- def strip0.pick
- def strip0Leading zeros dropped, keeping at least one digit.
- def float.mk
- def float.parts
- def float.sign
- def floatA JSON number's text as Python prints float(text): `50` -> `50.0`, `5.50` -> `5.5`.
- def split.int
- def div100.finfloat(text) / 100 as Python prints it (decimal shift, exact for decimals).
- def div100.parts
- def div100.go
- def div100
- def pct1.showround(float(s) * 100, 1) for a decimal fraction: tenths of a percent, as text.
- def pct1.fin
- def pct1.pick
- def pct1.parts
- def pct1
- def rl
- def reset.epoch
- def reset.iso
- def hwin.mk
- def hwin.pick
- def hwin.util
- def hwinOne window ("5h" or "7d") of the rate-limit headers: utilization is a fraction, reset an epoch.
- def hdata.set
- def hdata.keys
- def hdata.fin
- def usage_from_ratelimit_headers`anthropic-ratelimit-unified-*` response headers (the raw header block) in the /api/oauth/usage shape; None when neither window is present.
ustore.bend
- def ActM
- def ActM.pure
- def ActM.bind
- def usage_path
- def usage_lock
- type IdThe identity a slot number currently maps to.
- type ClaimA fetch lease: the slot and its fencing id.
- def jv
- def jstr
- def flAn epoch as the reference stores it: a float.
- def empty_rows
- def obj_or_empty
- def rows.pick
- def is_v2
- def rows_ofThe accounts object of a parsed usage.json; empty for any other schema.
- def rows.parsed
- def rows.text
- def read_rowsA missing, torn or other-version file reads as empty.
- def matches
- def fresh_row
- def row.if
- def row.pick
- def row_ofThe stored row of a slot, only when it belongs to this identity.
- def write_rows
- def with_usage_lock
- def read_act
- type RR
- def claim_row
- def reserve.take
- def reserve.fresh
- def reserve.stored