OpenAI Codex
A code-writing language model fine-tuned from GPT-3
OpenAI Codex is a large language model from OpenAI that turns plain-language instructions into source code. Announced in 2021 and built by fine-tuning GPT-3 on code, it powered GitHub Copilot and showed both strong code suggestion and notable reliability limits.
- Fine-tuned from GPT-3 on 159 GB of Python from 54 million GitHub repos
- OpenAI reported about 37% success on its evaluation tasks
- Writes in more than a dozen languages, strongest in Python
- Powered GitHub Copilot; a separate Codex agent appeared in 2025
- NYU study found flaws in about 40% of Copilot code in high-risk CWE cases
What it is
OpenAI Codex is a language model built to turn everyday instructions into working source code. It is a production variant of GPT-3, adjusted through fine-tuning on code rather than general text. OpenAI presented it in 2021 and it became the engine behind GitHub Copilot. The system can fill in unfinished functions, write new code from a short description, and reach out to other software and online services. OpenAI framed it as a speed-up for human programmers, not a replacement for them.
How it came about
OpenAI announced Codex in 2021 as a code-focused descendant of GPT-3. It was released as the model behind GitHub Copilot, and OpenAI ran public demonstrations showing it building a browser game and producing chart code. Greg Brockman, the company's chief technology officer, discussed its behaviour in an interview with The Verge. A separate coding agent also called Codex arrived from OpenAI in 2025; the two share a name but are different products.
Inside the model
The model starts from GPT-3 and is then fine-tuned on source code. OpenAI reports training on 159 gigabytes of Python drawn from 54 million GitHub repositories. Although Python dominates that corpus, the system can write in more than a dozen languages, among them Go, JavaScript, Perl, PHP, Ruby, Shell, Swift and TypeScript, with Python still its strongest area. Demonstrations suggested it could hold earlier parts of a request in mind while generating later code, and could call external applications such as Mailchimp, Microsoft Word, Spotify and Google Calendar.
What it can do
OpenAI said Codex resolved roughly 37% of the tasks in its evaluation set. It works best at turning simple problems into existing code, which the company called the least enjoyable part of programming. Jeremy Howard of Fast.ai described it as a way to get code written with less typing, adding that the output is often not exactly right but close enough to be useful. Weaknesses include inefficient code, odd results in some examples, trouble with multi-step instructions, and output that needs trial and error.
How to use it
Codex was offered through GitHub Copilot and OpenAI's own developer tools rather than as downloadable weights. The model itself remained proprietary.
Safety and testing
OpenAI researchers flagged several risks: beginners leaning too heavily on generated code, bias carried over from the training data, and security holes in code that looks plausible but is vulnerable. VentureBeat noted that training on public repositories leaves the model open to data poisoning through deliberately planted malicious code. A New York University study found that around 40% of Copilot outputs in scenarios tied to high-risk CWE categories contained bugs or exploitable design flaws.
Reception and debate
Commentators welcomed the productivity gains but questioned correctness and legal footing. The Free Software Foundation argued that generated snippets could clash with the GPL's requirement that derivative works carry the same licence, and raised open questions about fair use, discoverability of infringing output, and whether a trained model counts as source code or a compilation. An internal GitHub audit found direct copies of training data in about 0.1% of outputs, including one case where the model reproduced the fast inverse square root routine, comments and a wrong copyright notice included. OpenAI said the legal uncertainty around training imposes real costs and should be settled by authoritative ruling.
Why it matters
Codex established code generation as a mainstream use of large language models and supplied the engine for GitHub Copilot, one of the earliest widely used AI programming assistants. Its copyright questions fed into wider debate, with observers drawing parallels to Authors Guild, Inc. v. Google, Inc., where Google Books's use of short excerpts from scanned books was held to be fair use.
Questions people ask about OpenAI Codex
What is OpenAI Codex?
It is a large language model from OpenAI that converts plain-language instructions into source code. Announced in 2021, it is a version of GPT-3 fine-tuned on code and served as the original engine of GitHub Copilot.
Which programming languages does it handle?
OpenAI says Codex can produce code in more than a dozen languages, including Go, JavaScript, Perl, PHP, Ruby, Shell, Swift and TypeScript. Python is where it performs best, since its fine-tuning data was mostly Python.
How accurate is it?
OpenAI reported that Codex completed about 37% of the tasks in its evaluation set. It can also emit inefficient code, mishandle multi-step requests, and give unexpected results, so output often needs checking and revision.
What are the main legal concerns?
The Free Software Foundation questioned whether generated snippets could breach the GPL and whether training on public repositories counts as fair use. A GitHub audit found direct copies of training data in roughly 0.1% of outputs.
Is this the same as the Codex agent from 2025?
No. OpenAI released a separate coding agent under the Codex name in 2025. It shares the name with the 2021 language model but is a different product.
Good reading and sources
- GitHub’s Commercial AI Tool Was Built From Open Source CodeWired, Article
- GitHub Copilot auto-coder snags emerge, from seemingly spilled secrets to bad code, but some love itThe Register, Article
- A.I. Can Now Write Its Own Computer Code. That’s Good News for Humans. (Published 2021)The New York Times, Article
The facts on this page come from the Wikipedia article "OpenAI Codex (language model)", written by its contributors and used under the CC BY-SA 4.0 licence, and from its Wikidata record (CC0). EveryLLM rewrote the text in its own words, with AI assistance, and compares every page with the article to make sure no passage is copied. It may be reused under the same CC BY-SA 4.0 licence with a link back.
It may contain mistakes, and figures change over time. Nothing here is investment or buying advice. If something is wrong, tell us. Last refreshed 2026-11-14.