
openai
#10078
input_validation_error
Validation error for request: additional_instructions must not exceed 32768 characters.
This error has been identified and solved.
Reason
The 400 status error you are encountering in the OpenAI API is due to a validation error in the request body. Specifically, the error message indicates that the additional_instructions
field exceeds the maximum allowed character limit of 32768 characters. This is a constraint imposed by the OpenAI API, where the request body must comply with specific length limits for certain parameters to be accepted as a valid request.
Solution
To fix the 400 status error caused by the additional_instructions
field exceeding the maximum allowed character limit, you need to ensure that your request complies with the OpenAI API's constraints. Here are the steps to resolve this issue:
Trim the instructions: Reduce the length of the
additional_instructions
to be within the 32768 character limit.Break instructions into chunks: If the instructions are too long, consider breaking them down into smaller, manageable chunks that can be sent in separate requests.
Optimize the content: Remove any unnecessary text or formatting to stay within the character limit.
By adhering to these steps, you can ensure that your API requests are valid and do not exceed the specified character limits.
Suggested Links
https://cheatsheet.md/chatgpt-cheatsheet/openai-api-error-axioserror-request-failed-status-code-400
https://github.com/openai/openai-node/issues/1140
https://community.openai.com/t/problem-with-assistant-max-length-32k-even-with-the-gpt-4-1106-preview-and-trying-to-get-the-status-i-get-a-passed-three-arguments-error-even-though-i-only-passed-two/479690
https://community.openai.com/t/getting-400-response-with-already-working-code/509212
https://swagger.io/docs/specification/v3_0/describing-request-body/describing-request-body/
https://community.openai.com/t/token-character-restrictions-for-assistants-api/511174
https://community.openai.com/t/function-call-description-max-length/529902