Writing, reviewing, editing, and answering questions about code is one of the primary use cases for OpenAI models today. This guide walks through your options for code generation with GPT-5.4 and Codex.
Get started
Use Codex
Codex is OpenAI’s coding agent for software development. It helps you write, review and debug code. Interact with Codex in a variety of interfaces: in your IDE, through the CLI, on web and mobile sites, or in your CI/CD pipelines with the SDK. Codex is the best way to get agentic software engineering on your projects.
Codex works best with the latest models from the GPT-5 family, such as gpt-5.4. We offer a range of models specifically designed to work with coding agents like Codex, such as gpt-5.3-codex, but starting with gpt-5.4, we recommend using the general-purpose model for most code generation tasks.
See the Codex docs for setup guides, reference material, pricing, and more information.
Integrate with coding models
For most API-based code generation, start with gpt-5.4. It handles both general-purpose work and coding, which makes it a strong default when your application needs to write code, reason about requirements, inspect docs, and handle broader workflows in one place.
This example shows how you can use the Responses API for a code generation use case:
1
2
3
4
5
6
7
8
9
10
from openai import OpenAI
client = OpenAI()
result = client.responses.create(
model="gpt-5.4",
input="Find the null pointer exception: ...your code here...",
reasoning={ "effort": "high" },
)
print(result.output_text)Frontend development
Our models from the GPT-5 family are especially strong at frontend development, especially when combined with a coding agent harness such as Codex.
The demo applications below were one shot generations, i.e. generated from a single prompt without hand-written code. Use them to evaluate frontend generation quality and prompt patterns for UI-heavy code generation workflows.
Next steps
- Visit the Codex docs to learn what you can do with Codex, set up Codex in whichever interface you choose, or find more details.
- Read Using GPT-5.4 for model selection, features, and migration guidance.
- See Prompt guidance for GPT-5.4 for prompting patterns that work well on coding and agentic tasks.
- Compare
gpt-5.4andgpt-5.3-codexon the model pages.
















