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/messagesandcost_reportwith 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_reportedevent per settled day. - Anthropic reports cost in cents as a decimal string; the connector converts, so
cost_usdmeans 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 API | Becomes | Data |
|---|---|---|
| A settled usage bucket, per model | llm.usage_reported | input_tokens, output_tokens, cached_input_tokens, cache_creation_tokens, web_search_requests, total_tokens |
| A settled day of org spend | llm.cost_reported | cost_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}'
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.