OpenAI API for GPT 4 not giving correct response

Correct response on same prompts:

chatID: ‘chatcmpl-8n5QwsBD9GMy9hRpVljMaYpKbxcaH’

chatID: ‘chatcmpl-8n5nuEcqFsPPxhywFVFHRYijbfLer’

Response giving error:
[{‘role’: ‘user’, ‘content’: “Give me the intent for the following request\n integrate smallcase details api \n The output should be in JSON and should follow the below template \n {'api': 'smallcase', 'endpoint': 'discover smallcases'}”}]

ChatCompletion(id=‘chatcmpl-8n5sXu8eMJmWvNKtlmeEQGHrj7dQH’, choices=[Choice(finish_reason=‘stop’, index=0, logprobs=None, message=ChatCompletionMessage(content=‘The intent of this request is to integrate the Smallcase Details API, with the output expected to be provided in JSON format to discover smallcase portfolios.’, role=‘assistant’, function_call=None, tool_calls=None))], created=1706711361, model=‘gpt-4-0613’, object=‘chat.completion’, system_fingerprint=None, usage=CompletionUsage(completion_tokens=30, prompt_tokens=53, total_tokens=83))

When trying to fetch a response in a similar structure as mentioned, chaptgpt-4 APIs fail to answer the prompt correctly when the structure of prompt and the mentioned output is defined. It fails to fetch smallcase API details but successfully fetches mailchimp API details when asked to do so.

Please help with this hallucination since it could previously fetch smallcase API details before.

Thank you,