Create completion
POST
https://api.openai.com/v1/editsGiven a prompt and an instruction, the model will return an edited version of the prompt.
Creates a new edit for the provided input, instruction, and parameters.
Request
ID of the model to use. You can use the text-davinci-edit-001
or code-davinci-edit-001
model with this endpoint.
The input text to use as a starting point for the edit.
The instruction that tells the model how to edit the prompt.
How many edits to generate for the input and instruction.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p
but not both.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature
but not both.
{
"model": "text-davinci-edit-001",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
}
Request samples
Responses
{
"object": "edit",
"created": 1670702460,
"choices": [
{
"text": "What day of the week is it?\n",
"index": 0
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 28,
"total_tokens": 53
}
}