I would suggest doing it with the GUI first and then examine the data structure.

I.e. added a driver to the Composite Node  
![GUI driver][1]

The path is relative to `node_tree`.

So try to add the driver to `node_tree` with the given data path

    import bpy
    
    #right click on the socket value of the node -> Copy Data Path
    path = 'nodes["Composite"].inputs[1].default_value'

    scene = bpy.context.scene
    scene.use_nodes = True
    driver = scene.node_tree.driver_add(path)

![Copy Data Path][2]


  [1]: https://i.sstatic.net/0Wo9w.png
  [2]: https://i.sstatic.net/dlWgD.png