example:
{
"id": "chatcmpl-ABN4bj9UXOEVsu0aAF0QVtsRitFEH",
"object": "chat.completion",
"created": 1727273665,
"model": "gpt-4-turbo-2024-04-09",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n ",
"refusal": null
},
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 2078,
"completion_tokens": 512,
"total_tokens": 2590,
"completion_tokens_details": {
"reasoning_tokens": 0
}
},
"system_fingerprint": "fp_22b855c4b7"
}
also reported e.g. here by others:
https://community.openai.com/t/why-is-gpt-api-giving-me-a-response-with-lots-of-spaces-and-new-lines/578701
OpenAI Developer Forum
At first, I’m sorry that I cannot share the prompt messages I used for the input. For some prompts, the contents of response only consists of lot’s of spaces and new lines. It doesn’t happens everytime, but sometimes without control. Q1. Why is this happens Q2. How to prevent from this situation?