How to get all keyframes for selected strip in python?
Import the bpy module to access Blender's data.
import bpy

Context Method
If you just created the keyframes and are simply scripting in the text editor, you can look up the objects by context. You need to be certain that the strip has two keyframes and is selected (active) in the sequencer.
Get the active scene by context.
scene = bpy.context.scene

Get the active sequencer strip by context.
strip = scene.sequence_editor.active_strip

Lookup the fcurve connected to the data_path of the active strip with it's name and property. (Look at batFINGER's answer on how to construct the data_path more elegantly with strip.path_from_id(&quot;blend_alpha&quot;).)
data_path = 'sequence_editor.sequences_all[&quot;' + strip.name + '&quot;].blend_alpha'
fcrv = scene.animation_data.action.fcurves.find(data_path)

Assign some values to the keyframe_points stored in the fcurve.
for i, y in [[0, 0.0], [1, 1.0]]:
    fcrv.keyframe_points[i].co.y = y
    fcrv.keyframe_points[i].handle_left.y = y
    fcrv.keyframe_points[i].handle_right.y = y

Force the sequencer to refresh.
bpy.ops.sequencer.refresh_all()

Data Method
If are trying to use this functionality from an addon or are unsure wether an active strip is selected or even if keyframes are present at all, you have to validate the data.
View code snippet from github.
Encapsulate the functionality in a method, which can be aborted, if a precondition is missing. The required parameters are:

the scene's name

the sequencer strip's name

the values which are used to overwrite the existing keyframes values
def modify_strip_keyframes(scene_name, strip_name, keyframe_values = [1.0, 0.0]):


Get the scene by name, but return if it doesn't exist.
    scene = bpy.data.scenes.get(scene_name)
    if scene == None:
        print(&quot;Scene not found.&quot;)
        return

Verify that there is animation_data and a sequence_editor. If there are no keyframes or no strips, these items will be None. (Calling properties of None will crash the script.)
    if (scene.animation_data == None or scene.sequence_editor == None):
        print(&quot;No strips with keyframes.&quot;)
        return
    

Get the strip by name and get the fcurve associated with it's blend_alpha (the opacity) property.
    strip = scene.sequence_editor.sequences.get(strip_name)
    if strip == None:
        print(&quot;Strip not found.&quot;)
        return
    
    data_path = 'sequence_editor.sequences_all[&quot;' + strip_name + '&quot;].blend_alpha'
    fcrv = scene.animation_data.action.fcurves.find(data_path)
    
    if fcrv == None:
        print(&quot;No opacity keyframes found.&quot;)
        return

Verify that there are as many keyframe_points on the fcurve, as values have been supplied. Then loop over the points and assign the new values to the keyframe_point coordinates co.
    if len(fcrv.keyframe_points) != len(keyframe_values):
        print(&quot;The strip has &quot; + str(len(fcrv.keyframe_points)) +
            &quot; keys, but &quot; + str(len(keyframe_values)) + &quot; values were supplied.&quot;)
        return
    
    for i in range(len(fcrv.keyframe_points)):
        key = fcrv.keyframe_points[i]
        key.co.y = keyframe_values[i]
        key.handle_left.y = keyframe_values[i]
        key.handle_right.y = keyframe_values[i]
        key.handle_left.x = key.co.x
        key.handle_right.x = key.co.x
    

To execute the function, call it and refresh the sequencer to visualize the change.
modify_strip_keyframes(&quot;Scene&quot;, &quot;cat&quot;, keyframe_values = [1, 0.5])
bpy.ops.sequencer.refresh_all()