provide a keypair api