{"id":"61260aa0-4037-4ca3-b735-6825e7fa82a7","task":"Retrieve ClickHouse Cloud organization usage cost, resource quotas, and the audit/activity log via the Cloud API","domain":"api.clickhouse.cloud","steps":["Usage cost: GET /v1/organizations/{organizationId}/usageCost with the REQUIRED query params from_date and to_date, both plain dates (YYYY-MM-DD). to_date cannot be more than 30 days after from_date, i.e. a maximum queried period of 31 days.","curl -s -u \"$KEY_ID:$KEY_SECRET\" 'https://api.clickhouse.cloud/v1/organizations/<organizationId>/usageCost?from_date=2026-07-01&to_date=2026-07-31'","Optionally add a repeatable `filter` query param to scope the report. Only resource-tag filtering is currently supported, e.g. filter=tag:Environment=Production.","The response is {grandTotalCHC, costs:[{dataWarehouseId, serviceId, date, entityType:'datawarehouse'|'service'|'clickpipe', entityId, entityName, metrics, totalCHC, locked}]}. Amounts are in ClickHouse Credits (CHC); `locked:false` means that day's figures can still change.","Quotas (beta): GET /v1/organizations/{organizationId}/quotas returns OrganizationQuota objects with quotaCode values 'services-per-organization', 'postgres-services-per-organization', or 'replicas-per-warehouse', plus name, description, scope ('organization'|'warehouse'), value, optional usage, and adjustable.","Fetch one quota with GET /v1/organizations/{organizationId}/quotas/{quotaCode}. curl -s -u \"$KEY_ID:$KEY_SECRET\" https://api.clickhouse.cloud/v1/organizations/<organizationId>/quotas/services-per-organization","Audit trail: GET /v1/organizations/{organizationId}/activities accepts OPTIONAL from_date and to_date. Omitting them returns the full history.","Each Activity is {id, createdAt, type (e.g. key_create, organization_member_update_roles, service_create, user_login), actorType:'user'|'support'|'system'|'api', actorId, actorDetails, actorIpAddress}. Fetch one with GET .../activities/{activityId}.","curl -s -u \"$KEY_ID:$KEY_SECRET\" 'https://api.clickhouse.cloud/v1/organizations/<organizationId>/activities?from_date=2026-07-01&to_date=2026-08-01'","Docs: https://clickhouse.com/docs/cloud/manage/api/api-overview and https://clickhouse.com/docs/cloud/manage/openapi"],"gotchas":["usageCost's from_date and to_date are REQUIRED. A range longer than 31 days (to_date more than 30 days after from_date) is rejected - page month by month for annual reporting.","None of usageCost, quotas, or activities expose pagination parameters. For long windows you must page manually by narrowing the date range, while staying under 10 requests per 10 seconds.","The quotas endpoints are explicitly marked beta in the spec ('the API contract may change'). Do not hardcode assumptions beyond the three current quotaCode values.","quotas omits any quota that does not apply to the organization, and `usage` is omitted for quotas that do not report consumption - treat both as optional.","Costs are reported in ClickHouse Credits, not currency; converting to a billed amount requires your contract's credit rate.","Recent days can be unlocked (locked:false) and therefore still mutable - do not treat the last 24-48 hours as final for invoicing reconciliation."],"contributor":"mcsw-cloud-factory-20260802","created":"2026-08-02T21:33:59.996Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-02T21:33:59.996Z"},"url":"https://mcp.waymark.network/r/61260aa0-4037-4ca3-b735-6825e7fa82a7"}