OpenAI API error: "The model `text-davinci-003` has been deprecated"

OpenAI API error: "The model `text-davinci-003` has been deprecated"

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

OpenAI API error: "The model text-davinci-003 has been deprecated"

You are encountering a specific deprecation notice because OpenAI has officially sunset the legacy completion models, including text-davinci-003. The error message you received is unambiguous: { "error": { "message": "The modeltext-davinci-003has been deprecated...", "code": "model_not_found" } }. This isn't a temporary outage or a configuration mismatch on your end; the endpoint simply no longer exists.

The code snippet you were likely provided, $endpoint = 'https://api.openai.com/v1/engines/text-davinci-003/completions';, relies on the older v1 Completions API architecture. While this was the standard for years, it has been deprecated in favor of the Chat Completions API. Continuing to use the old endpoint will result in a 404 Not Found or a deprecation error every time you make a request.

To resolve this, you must migrate your codebase to the new chat/completions endpoint and switch to a supported model like gpt-3.5-turbo or gpt-4. The API response format changes slightly between these two architectures, so a simple URL swap is not enough; you often need to adjust how you structure your payloads.

Migrating the Endpoint

The first step is updating your endpoint URL. Replace the legacy engine path with the new chat completions path:

$endpoint = 'https://api.openai.com/v1/chat/completions';

This change alone will stop the model_not_found error from throwing immediately, but you must also update the model name in your request body. You can no longer pass text-davinci-003. Instead, you should use:

{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "user",
      "content": "Your prompt here"
    }
  ]
}

Handling Payload Differences

The most significant friction point during migration is the payload structure. The legacy Completions API expected a prompt field containing a string of text. The new Chat API expects an array of objects under the messages key, where each object defines a role (system, assistant, or user) and content.

If your application currently sends a single prompt string to text-davinci-003, you cannot simply map that directly without modification. You must wrap your input in a message object:

$data = [
    'model' => 'gpt-3.5-turbo',
    'messages' => [
        [
            'role' => 'user',
            'content' => $yourOriginalPromptString
        ]
    ],
    'temperature' => 0.7
];

Trade-offs and Considerations

Migrating to the Chat API offers more than just fixing an error code. The new architecture provides better context handling, allowing you to maintain conversation history across multiple turns rather than treating every request as an isolated interaction. This is particularly useful for chatbots or multi-step reasoning tasks.

However, there are trade-offs to consider. The Chat API can be slightly more expensive per token depending on the model you choose (gpt-4 vs gpt-3.5-turbo). Additionally, the response structure changes; instead of receiving a raw completion string directly in the top-level JSON, it is nested within a choices[0].message.content array. You will need to update your parsing logic accordingly.

If you are maintaining legacy integrations that strictly require the old text-davinci-003 behavior, note that OpenAI has explicitly stated this model is no longer available for new deployments. Attempting to force it via URL manipulation or version hacking will not work and will only result in continued errors.

For developers looking for robust, well-documented integrations with these modern APIs, resources like https://laravelcompany.com often provide useful patterns for handling API versions and migrations within the Laravel ecosystem. Ensuring your application is built on the latest stable endpoints prevents technical debt before it becomes a migration nightmare later on.

The transition requires updating both your URL and your request payload structure, but it unlocks access to the full capabilities of the current OpenAI models.

Our network