Well,
There's a few scripting libraries for SP:
| Scripting framework | Language | Features/Notes |
|---|---|---|
| ScriptHookV | C++ | Barebones scripting interface, decently popular, standalone |
| ScriptHookVDotNet | C#/.NET languages | Powerful scripting interface, very popular, builds on ScriptHookV |
| RagePluginHook | C#/.NET languages | Powerful scripting interface, not as popular, standalone |
The raw "API" to the game is using script natives (essentially, functions R* uses in their scripts), which all the scripting frameworks resolve for you.
ScriptHookVDotNet and RagePluginHook throw some more abstraction into this for convenience, and group common functionality together in classes/objects.
If you want to do things that the natives don't expose - you could try messing with game memory, directly.