HookGet Open dashboard

Anthropic → HookGet

HookGet reads Anthropic's reporting API on a schedule and turns it into normalised events on the same pipeline as everything else you deliver.

In short

  • Reads /v1/organizations/usage_report/messages and cost_report with an admin key.
  • Per model, per bucket: uncached and cached input tokens, cache-creation tokens, output tokens, web-search count. Money arrives separately as one llm.cost_reported event per settled day.
  • Anthropic reports cost in cents as a decimal string; the connector converts, so cost_usd means dollars everywhere. Misreading this overstates spend 100×.
  • Empty buckets still advance the cursor — a quiet weekend does not stall the source.

What it produces

Read from the APIBecomesData
A settled usage bucket, per modelllm.usage_reportedinput_tokens, output_tokens, cached_input_tokens, cache_creation_tokens, web_search_requests, total_tokens
A settled day of org spendllm.cost_reportedcost_usd — sum it and you have the bill

Set up

# Create an Admin API key in the Anthropic console, then:
curl -X POST https://api.hookget.com/v1/sources \
  -H "authorization: Bearer $HOOKGET_KEY" \
  -d '{"provider":"anthropic","secret":"<admin key>",
       "config":{"bucket_width":"1h"},"sync_interval_sec":900}'
One scheduled sync of a pull source The scheduler claims a due source, fetches from the provider's API with the saved cursor, normalises the response into events, and stores them. Only when the sync succeeds does the cursor advance. A failure keeps the old cursor and retries with a growing backoff; after twenty consecutive failures the source pauses and reports its health. Due interval passed Fetch from the saved cursor Normalise dedupe on provider ids Stored, cursor advances only on success — never mid-failure Failure: old cursor kept backoff doubles · 20 strikes → paused, health says why
The two rules that make polling safe: the cursor advances only on success (a partial read never silently skips events — re-reads deduplicate for free), and a failing credential backs off and eventually pauses instead of hammering the provider in your name.

Stated plainly

Same shape and same honesty as the OpenAI source: aggregates per settled bucket, never prompts or completions, and the most recent ~90 minutes deliberately lag. Service tier and context window arrive as attributes, so batch and standard traffic can be told apart in a filter.

Questions

Why do you make a point of the cents conversion?

Because it is the kind of bug a dashboard cannot reveal. Anthropic's cost report returns "123.45" meaning $1.2345 — lowest currency units as a decimal string. Read as dollars, every AI cost figure would be silently wrong by a factor of one hundred. The conversion has a test named after it.

Can I separate batch traffic from interactive traffic?

Yes — service_tier and context_window ride as attributes on each event, so a filter or a destination split on them takes one rule.