A keypair is used to authenticate to the operating system. AWS has no involvement in this login process. Therefore, it cannot link activity to keypairs. (That is, it doesn't know who is logging in each time.)
However, instances do have a KeyName
attribute that identifies which Keypair was used when the instance was launched. Users could still login under a different username if that user has been created on the instance.
While the KeyName
attribute is associated with an instance, it cannot be used to group costs. You could, however, copy the KeyName to a Tag, which could then be used for grouping in billing reports.