Extrude curve into a surface by scripting in Python

Hi! How could I convert an extrude curve into a surface in order to offset the new surface into a solid?
Thank you in advance!

Are you looking for this?

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Surface_ToNurbsSurface.htm

Interesting, thank you so much!