def reset_key_secret(api, configuration, api_version, api_exception, key_id):
    """ Resets the secret of an API key.

    :param api: The Deep Security API modules.
    :param configuration: Configuration object to pass to the api client.
    :param api_version: The version of the API to use.
    :param api_exception: The Deep Security API exception module.
    :param key_id: The ID of the key.
    :return: An APIKeysApi object that contains the secret of the key.
    """

    try:
        # Reset the key
        api_keys_api = api.APIKeysApi(api.ApiClient(configuration))
        return api_keys_api.replace_api_secret_key(key_id, api_version)

    except api_exception as e:
        return "Exception: " + str(e)