When
You need a bounded view of Space usage, contributors, model mix, and App views for a reporting window.
Steps
- Pick a window from 1 to 365 days. The default is 30: ``
bash cohub -s <spaceId> spaces activity --json cohub -s <spaceId> spaces activity 90 --json`` - For an SDK client, use the Space-scoped API: ``
ts const activity = await client.space(spaceId).activity.get(30);`` - Render the summary and hourly series first, then contributors and rankings. The response includes both token and generation usage, plus top Apps by view count.
- Gate cost display on the viewer's management role. Hosts and builders can see costs; other viewers receive zeroed cost fields with the same response shape.
- Use the App ranking as a directional signal. Follow a specific App's version and view details through
client.apps.getStats()when you need release-level attribution.
API contract
GET /api/spaces/:id/activity?days=30Invalid or unbounded day values should be rejected at the boundary. Keep the returned contributor and ranking lists as summaries; do not infer a complete audit trail from them.
Done when
- [ ] The time range is explicit and within 1-365 days
- [ ] Cost fields are hidden for viewers without Space-management access
- [ ] LLM and generation usage are labeled separately
- [ ] App views are interpreted with the App's published versions
Avoid
- Showing cost totals to every Space viewer
- Treating a cached dashboard as the Billing ledger
- Requesting account-wide scopes for a single-Space report
- Exporting contributor rows without an access policy