You’ll have to study the documentation for whatever libraries you have on your unspecified server installation
I’m sure there must be Python packages/libraries that can send SMS using a GSM modem…
Have you looked in PyPI - the Python Package Index
Or try googling…
RTFM for whatever “API” you’re using.