openai
#10113
request_parameter_error
Invalid request: "functions" and "tools" cannot both be provided. "Functions" are deprecated; use the "tools" parameter instead.
This error has been identified and solved.
Reason
The error you are encountering, where the OpenAI API returns a 400 status code with the message "Invalid request: 'functions' and 'tools' cannot both be provided. 'functions' are deprecated; use the 'tools' parameter instead," is due to the following reasons:
The API request is including both the deprecated
functionsparameter and the newtoolsparameter, which is not allowed.The
functionsparameter has been deprecated, and the API expects you to use thetoolsparameter instead.
This indicates a mismatch between the deprecated and current API parameters in your request configuration.
Solution
To fix the 400 status error due to the invalid request where both functions and tools are provided, you need to adjust your API request configuration as follows:
Remove the
functionsparameter from your request since it is deprecated.Use the
toolsparameter instead to specify the necessary tools.
Here are the key steps:
Ensure your request only includes the
toolsparameter.Update your code to comply with the current API requirements, eliminating any references to the deprecated
functionsparameter.Verify that your API request adheres to the latest OpenAI API documentation guidelines.



