Responses via api do not follow instructions

Why is it that the response to a prompt from ChatGPT-4 in the ChatGPT interface, and the response from gpt-4 sent via API are so different in quality?
The response from prompts sent via the API are inferior, and do not carry out all the instructions of the prompt. And when I ask it why it has not carried out all the instructions, it says it doesn’t know what instructions I am referring to.
Whereas ChatGPT carries out all the instructions perfectly?
How am I supposed to build an app on the API if it cannot carry out a very clearly structured prompt, with every step clearly indicated?