Decimate f-curves using python
Like this:
import bpy  
def simplify_fcurves():
    C=bpy.context
    old_area_type = C.area.type
    C.area.type='GRAPH_EDITOR'
    bpy.ops.graph.decimate(mode='ERROR', remove_ratio=0.698113, remove_error_margin=0.5)
    C.area.type=old_area_type    
simplify_fcurves()