Back to all models
Get all the details on davinci-002, an AI model from OpenAI. This page covers its token limits, pricing structure, key capabilities such as Code Generation, language_understanding, text_generation, available API code samples, and performance strengths.
Key Metrics
Input Limit
16.4K tokens
Output Limit
16.4K tokens
Input Cost
$2.00/1M
Output Cost
$2.00/1M
Sample API Code
from openai import OpenAI
client = OpenAI()
completion = client.completions.create(
model="davinci-002",
prompt="Write a short story about a robot dog.",
max_tokens=150
)
print(completion.choices[0].text)
Required Libraries
openai
openai
Notes
GPT base models can understand and generate natural language or code but are not trained with instruction following. These models are made to be replacements for our original GPT-3 base models and use the legacy Completions API. Most customers should use GPT-3.5 or GPT-4.
Capabilities
Code Generation
language understanding
text generation
Supported Data Types
Input Types
Text
Output Types
Text
Strengths & Weaknesses
Good at
Text Generation
Code Generation
Language Understanding
Poor at
Instruction Following
Complex Reasoning
Additional Information
Latest Update
Sep 1, 2021
Knowledge Cutoff
Sep 1, 2021