How can I use Unreal Python API to export an asset from the level?

for gltf Scripting glTF Exports in Unreal Engine | Unreal Engine 5.3 Documentation | Epic Developer Community

You can use asset export tasks for FBX and obj exports.
here in python Export Selected with Python or Blueprint?
you should have similar functions in blueprint.