Summary
The sync audit log tracks LLM token usage and cost for summarisation, but does not account for the Composio API call costs incurred during data fetching (Gmail, Slack, GitHub via Composio, Notion, Linear, ClickUp).
Each Composio action execution (e.g. GMAIL_FETCH_EMAILS, SLACK_LIST_CONVERSATIONS, GITHUB_LIST_ISSUES) is a billable API call on the Composio platform. These costs are currently invisible in the audit trail.
What needs to change
-
Track Composio action call counts per sync — each call to execute_action / the Composio Edge API should be counted.
-
Surface Composio billing — if the Composio API returns usage/billing metadata, capture it. Otherwise track call counts and estimate based on Composio's per-action pricing.
-
Include in the audit entry — add fields like composio_actions_called: u32 and composio_cost_usd: f64 (or a generic api_calls counter) to SyncAuditEntry.
-
Display in the UI — the Sync History panel should show API call costs alongside LLM costs for a complete picture of sync expenses.
Where to hook in
- Composio sync providers live in
src/openhuman/memory_sync/composio/providers/
- Each provider's
sync.rs calls the Composio client which makes HTTP requests
- The client is at
src/openhuman/composio/client.rs
- Audit log:
src/openhuman/memory_sync/sources/audit.rs
Acceptance criteria
Summary
The sync audit log tracks LLM token usage and cost for summarisation, but does not account for the Composio API call costs incurred during data fetching (Gmail, Slack, GitHub via Composio, Notion, Linear, ClickUp).
Each Composio action execution (e.g.
GMAIL_FETCH_EMAILS,SLACK_LIST_CONVERSATIONS,GITHUB_LIST_ISSUES) is a billable API call on the Composio platform. These costs are currently invisible in the audit trail.What needs to change
Track Composio action call counts per sync — each call to
execute_action/ the Composio Edge API should be counted.Surface Composio billing — if the Composio API returns usage/billing metadata, capture it. Otherwise track call counts and estimate based on Composio's per-action pricing.
Include in the audit entry — add fields like
composio_actions_called: u32andcomposio_cost_usd: f64(or a genericapi_callscounter) toSyncAuditEntry.Display in the UI — the Sync History panel should show API call costs alongside LLM costs for a complete picture of sync expenses.
Where to hook in
src/openhuman/memory_sync/composio/providers/sync.rscalls the Composio client which makes HTTP requestssrc/openhuman/composio/client.rssrc/openhuman/memory_sync/sources/audit.rsAcceptance criteria