New GPTâ3 capabilities: Edit & insert
Weâve released new versions of GPTâ3 and Codex which can edit or insert content into existing text, rather than just completing existing text.

Update on May 16, 2025: We launched Codex, a cloud-based software engineering agent that can work on many tasks in parallel. Learn moreâ .
Weâve released new versions of GPTâ3â (opens in a new window) and Codexâ (opens in a new window) which can edit or insert content into existing text, rather than just completing existing text. These new capabilities make it practical to use the OpenAI APIâ (opens in a new window) to revise existing content, such as rewriting a paragraph of text or refactoring code. This unlocks new use cases and improves existing ones; for example, insertion is already being piloted in GitHub Copilotâ (opens in a new window) with promising early results.
GPTâ3 and Codex have traditionally added text to the end of existing content, based on the text that came before. Whether working with text or code, writing is more than just appendingâitâs an iterative process where existing text is revised. GPTâ3 and Codex can now edit text, changing whatâs currently there or adding text to the middle of content.
The new insertâ (opens in a new window) capabilityâ (opens in a new window) adds contextually relevant text in the middle of existing content. Providing future context to the model can improve the quality of completions for applications such as writing long-form text, transitioning between paragraphs, following an outline, or guiding the model toward an ending.
In the example above, the desire is to fill-in text between two section headers of an outline. Without the context of future sections, the model generates a completion that isnât relevant to the second section. When the context of future sections are accounted for, the model generates a completion that ties the two sections together.
Insert is particularly useful for writing code. In fact, Codex was our original motivation for developing this capability, since in software development we typically add code to the middle of an existing file where code is present before and after the completion. In the example above, the model successfully completes the missing function prune, while connecting to code already written. We also add a docstring and missing imports, which is not possible without knowing the code that comes after. In GitHub Copilot, Insert is currently being piloted with early promising results.
The insert capability is available in the API today in beta, as part of the completions endpointâ (opens in a new window) and via a new interface in Playgroundâ (opens in a new window). The capability can be used with the latest versions of GPTâ3 and Codex, text-davinci-002 and code-davinci-002. Pricingâ  is the same as previous versions of Davinci.
A meaningful part of writing text and code is spent editing existing content. Weâve released a new endpoint in beta called editsâ (opens in a new window) that changes existing text via an instruction, instead of completing it.
Editing works by specifying existing text as a prompt and an instruction on how to modify it. The edits endpoint can be used to change the tone or structure of text, or make targeted changes like fixing spelling. Weâve also observed edits to work well on empty prompts, thus enabling text generation similar to the completions endpointâ (opens in a new window). In the example above, we use edits to (1) add a poem, (2) change the poem to be in first-person, (3) transform the poem into a letter, with the appropriate salutation and signature.
The edits endpoint is particularly useful for writing code. It works well for tasks like refactoring, adding documentation, translating between programming languages, and changing coding style. The example above starts with JSON input containing cities ranked by population. With our first edit, Codex removes the rank field from the JSON, and changes the state abbreviations into full names. The second edit converts the JSON file into YAML returned from a function.
Editing is available as a specialized endpoint in the APIâ (opens in a new window) and through a new interface in Playgroundâ (opens in a new window). It is supported by models text-davinci-edit-001 and code-davinci-edit-001. The edits endpoint is currently free to useâ  and publicly available as a beta.


