The availability of Codex through the OpenAI API has a complex history that’s important to understand. The original OpenAI Codex model that was released in 2021 was indeed available through the OpenAI API until March 2023, when it was officially deprecated and shut down. This original API allowed developers to integrate Codex’s code generation capabilities directly into their applications using HTTP requests. However, after significant demand from researchers and developers, OpenAI reinstated limited access to the original Codex through the OpenAI Research Access Program, though this access is restricted and primarily intended for research purposes.
The current 2025 version of Codex operates differently and is not available as a traditional API service in the same way the original model was. Instead, it’s integrated into ChatGPT as an autonomous agent and is also available as a CLI tool that uses OpenAI’s API infrastructure. The CLI version of Codex does rely on OpenAI’s API services to function, requiring users to provide their OpenAI API key, but it’s not a direct API endpoint that developers can call programmatically like the original Codex API. The new Codex is designed more as a complete development environment and autonomous agent rather than a simple API service for code generation.
For developers looking to integrate AI coding capabilities into their applications programmatically, OpenAI recommends using their more advanced models like GPT-4 or the newer o-series models through the standard OpenAI API. These models have strong coding capabilities, though they operate differently than the specialized Codex agent. Enterprise customers can also access various OpenAI models, including some Codex functionality, through Microsoft’s Azure OpenAI Service, which provides API access with additional enterprise features like data residency and compliance controls. The shift away from a traditional Codex API reflects OpenAI’s move toward more sophisticated, agent-based approaches to AI-assisted software development.