You can find out which models support which endpoints here.
If you were using text-davinci-003 and just want to drop in a new model without changing your code (hopefully), try gpt-3.5-turbo-instruct model.
They announced this in July 2023…
Deprecation of older models in the Completions API
As part of our increased investment in the Chat Completions API and our efforts to optimize our compute capacity, in 6 months we will be retiring some of our older models using the Completions API. While this API will remain accessible, we will label it as “legacy” in our developer documentation starting today. We plan for future model and product improvements to focus on the Chat Completions API, and do not have plans to publicly release new models using the Completions API.
Starting January 4, 2024, older completion models will no longer be available, and will be replaced with the following models:
Keeping up with the OpenAI blog is a good idea if you can.
Is this code you just copy / pasted or something you built?
Your old code using text-davinci-003 should work with the gpt-3.5-turbo-instruct model… You do have to keep all the libraries updated if you go that route, though.
I did,
according to my endpoint : /v1/chat/completions
i have to use: gpt-4 and dated model releases, gpt-4-turbo-preview and dated model releases, gpt-4-vision-preview, gpt-4-32k and dated model releases, gpt-3.5-turbo and dated model releases, gpt-3.5-turbo-16k and dated model releases, fine-tuned versions of gpt-3.5-turbo
The HTTP status code 400 is used to indicate a “Bad Request.” This status code is a response from a web server indicating that the server could not understand the request due to invalid syntax.
When a server returns a 400 status code, it’s essentially telling the client (e.g., your web browser or an application making the request) that the request it sent is incorrect or corrupted and cannot be processed by the server. This can happen for several reasons, such as:
The request is malformed, meaning the syntax of the request is incorrect.
The request contains invalid parameters or arguments.
The request is missing required information, such as headers or body content needed for the server to process the request.
To resolve a 400 Bad Request error, one needs to check the request being made for any incorrect or missing information and correct it before sending the request again. This might involve reviewing the API documentation if you are interacting with an API, ensuring that the URL is correct, or checking that the data you are sending in the request body is properly formatted.
My gut says it’s likely your messages object and/or library problem.