Hello there and welcome to the community!
So, custom GPTs aren’t directly accessible to the OAI API. What you would do is create and assistant. Custom GPTs are more meant for little-to-no code type stuff, unless you’re building your own custom API endpoint.