How to make API calls to get the desired result?

I will to do my best to explain my problem.
I am a developer, I am testing the API calls using PHP, and I want to know the logic behind the API calls. I mean, if I want to paraphrase a text, what I need to send on the prompt to make to the AI to understand that I need a paraphrased text?

In the playground I can make it works, but not on a simple API call, so, I know i am missing something, but I am not pretty sure what!

I read the documentation, but i can’t find something about this.
Thank you very much for your time.

1 Like

Hi. I’m also using php mostly.
Can you give a more practical example of what you are doing? Maybe its easier to understand with more context.

Sure. Between my post and right now, I understood the importance of the examples before to send the request to the API.
Basically I am looking to ask to AI to write a sentence using other words but keeping the meaning.
For the moment i did changes on the classes to send the examples and concatenate all the request into the prompt, but i didn’t test yet.

But basically, what I want is something like paraphrase a sentence or paragraph.

What is the difference between the prompt you’re using in Playground versus the API call? It would help if you post both.

It is the same! that’s the weird.
Today I changed the code and debug step by step, i sent the same playground data, and the results are totally different.
So, I am not sure what is the difference.

Eureka!! (i hope), I think the code is working now! I tested a couple of examples and I have good results.
So, I have another doubt, if I sent examples on every API call, this examples count as tokens?

@hstanleycrow what did you do to fix it? I am having the same problem…