Hi@akhtar,
You can delete a key pair using the Boto3 module. For that, you need to set the AWS credentials first and then you can use the below code.
import boto3
ec2 = boto3.client('ec2')
response = ec2.delete_key_pair(KeyName='KEY_PAIR_NAME')
print(response)