davinci-002 — Deprecated
- Deprecated
- —
- Shutdown
- 2026-09-28
- Status
- deprecated
- Replacement
- gpt-5.4-mini
Quick fix — copy & paste
Choose your language. The "before" block matches the deprecated call; the "after" block is the drop-in replacement.
# OpenAI: davinci-002 (deprecated)
model = "davinci-002" # Replacement
model = "gpt-5.4-mini" // OpenAI: davinci-002 (deprecated)
const model = "davinci-002"; // Replacement
const model = "gpt-5.4-mini"; "model": "davinci-002" "model": "gpt-5.4-mini" This migration was generated automatically from the model rename. If your code does more than swap a model id, double-check request/response shapes against the official OpenAI migration guide.
Error messages
Seeing one of these? You're in the right place.
-
model_not_found: davinci-002 -
The model `davinci-002` has been deprecated -
The model `davinci-002` does not exist or you do not have access to it
Replacement options
-
gpt-5.4-miniCompare token cost → -
gpt-5-miniCompare token cost →
Other OpenAI deprecations
What this means for your code
davinci-002 is a specialized model with provider-specific behavior. Verify the replacement supports the same modalities, parameters, and rate limits as the deprecated model. Read the provider's migration notes carefully — these models often have non-obvious behavioral changes.
OpenAI has scheduled davinci-002 for shutdown on 2026-09-28. That gives you 143 days to migrate. Until then the model still works, but every API call after that date will return a model_not_found error.
Find every call in your codebase
Before you change anything, locate every place the deprecated model id is referenced. Search source files, environment files, feature flags, and config repos. Use these commands from your project root:
Python projects
grep -rn '"davinci-002"' --include="*.py" . JavaScript / TypeScript projects
grep -rn '"davinci-002"' --include="*.{js,ts,tsx,jsx}" . Anywhere (configs, scripts, infra)
grep -rn "davinci-002" . Migration checklist
Steps in order. Skip any that don't apply, but read the whole list — for other models, the non-obvious steps are usually the ones that break in production.
- 1. Read the provider's official migration guide for this model
- 2. Update the model id and any model-specific parameters
- 3. Audit rate limits and request size caps for the replacement
- 4. Re-run your full integration test suite against the new model
- 5. Plan a rollback path in case the new model behaves differently in production
Will this migration cost more?
Switching from davinci-002 to gpt-5.4-mini could change your costs significantly. Calculate the exact difference for your prompts.
Open the cost calculator →