Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
AI and LLM integration

OpenAI rejects text-davinci-003 and the other completion models

Your error

The model `text-davinci-003` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations1 more line it can show

Fix it fast

Most common cause, 1 of 2

The code still asks for text-davinci-003

Replace the completions call with a Responses call.

Fix
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-6.2-sol",  # pick a current ID from the Models page
    input="Summarise this ticket in one line: ...",
)
print(response.output_text)
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

text-davinci-003 was shut down on 4 January 2024, and the models people moved to next (gpt-3.5-turbo-instruct, davinci-002, babbage-002) were shut down on 28 September 2026. No completion-style model is left to switch to. Rewrite the call for the Responses API, choose a model the Models page lists today, and pass your old prompt as input.

  • Applies to OpenAI Responses API, openai Python library 3.57, openai Node.js library 7.62
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Search the project, its config and its environment files for every retired completion model name. Each hit is a call that has to move.

Run this first
grep -rnE "text-davinci|davinci-002|babbage-002|gpt-3.5-turbo-instruct" --include=*.{py,js,ts,php,env,json,yaml} .

Then find the line you see in this list and open its fix:

  1. 1The code still asks for text-davinci-003The error names text-davinci-003, text-davinci-002 or another text- model
  2. 2The earlier fix used gpt-3.5-turbo-instruct, which was retired in September 2026Code that worked after the 2024 change now fails with the same message for gpt-3.5-turbo-instruct, davinci-002 or babbage-002

What does the error look like?

  • The model `text-davinci-003` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
  • The model `gpt-3.5-turbo-instruct` has been deprecated

Cause 1 of 2

The code still asks for text-davinci-003

You seeThe error names text-davinci-003, text-davinci-002 or another text- model

Check

OpenAI's deprecations table lists text-davinci-003 as shut down on 4 January 2024, together with text-ada-001, text-babbage-001 and text-curie-001. Requests that name any of them cannot succeed again, whatever key or account you use.

Check
grep -rn "text-davinci-003" .

Fix

Replace the completions call with a Responses call. The old prompt string goes into input, and the reply text is read from output_text instead of choices[0].text.

Fix
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-6.2-sol",  # pick a current ID from the Models page
    input="Summarise this ticket in one line: ...",
)
print(response.output_text)

Verify

Run the same request again. A reply comes back and the deprecation message is gone.

Verify
python app.py

Confirmed by platform.openai.com

Did this fix it?

Cause 2 of 2

The earlier fix used gpt-3.5-turbo-instruct, which was retired in September 2026

You seeCode that worked after the 2024 change now fails with the same message for gpt-3.5-turbo-instruct, davinci-002 or babbage-002

Check

The same deprecations page shows gpt-3.5-turbo-instruct, davinci-002 and babbage-002 announced for retirement on 26 September 2025 and shut down on 28 September 2026. A drop-in swap inside the old completions endpoint is no longer possible.

Check
grep -rnE "gpt-3.5-turbo-instruct|davinci-002|babbage-002" .

Fix

Move the call to the Responses API, which OpenAI recommends for all new projects. In Node.js the shape is the same: input in, output_text out.

Fix
import OpenAI from "openai";

const client = new OpenAI();
const response = await client.responses.create({
  model: "gpt-6.2-sol",
  input: "Summarise this ticket in one line: ...",
});
console.log(response.output_text);

Verify

The script prints model text instead of an error, and your logs show the new model name on each call.

Verify
node app.mjs

Confirmed by platform.openai.com

Did this fix it?

How do I stop it coming back?

  • Keep the model ID in one config value so a retirement means one edit, not a search through the codebase.
  • Check the OpenAI deprecations page a few times a year; it lists each model's announcement and shutdown date.
  • Upgrade the openai library when you change models, so examples from the current docs match the code you run.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex, Workforce, stegnor.com.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.