VERSION 1
NODE aggregate
SQL >

    SELECT
        workspaceId,
        apiId,
        countState(deniedReason IS NULL) AS success,
        countState(deniedReason = 'RATE_LIMITED') AS rateLimited,
        countState(deniedReason = 'USAGE_EXCEEDED') AS usageExceeded,
        toStartOfDay(fromUnixTimestamp64Milli(time)) AS time
    FROM key_verifications
    GROUP BY
        workspaceId,
        apiId,
        time
