GPT-2 is not available through the OpenAI api, only GPT-3 and above so far. I would recommend accessing the model through the Huggingface Transformers library, and they have some documentation out there but it is sparse. There are some tutorials you can google and find, but they are a bit old, which is to be expected since the model came out years ago now. Also, what do you mean by, "I wanted to use GPT2 API for the same as it is more reliable to catch the content generated by GPT 3.5"? By all accounts, GPT-3 should be much better than GPT-2 at text classification, and by signing up for a free trial with OpenAI you can use their API for free (with provided credits for only three months). If you want to train the GPT-2 XL model, you will probably get better results than GPT-3's Ada, but then you have Compute resources you have to worry about.