The Definitive Guide to OpenAI Codex for Beginners

@Codestudiopjbk
JAPANESE2 months ago · Apr 29, 2026
2.5M
2.4K
191
10
4.8K

TL;DR

This comprehensive guide explains how to master OpenAI Codex and GPT-5.5, covering everything from desktop installation and prompt engineering to automated debugging and seamless image generation.

I'll say it clearly. The era of "just using Claude Code" is completely over. On April 24, with the arrival of GPT-5.5, the accuracy of Codex has jumped to a "different dimension." Overseas, posts are already flooding in saying "following only Claude Code is a missed opportunity; the era belongs to Codex."

Codex Studio - inline image

0:53

Codex Studio - inline image

However, in Japan, most people are still stuck at "What is Codex?" or "What's so great about GPT-5.5?"

That's why in this article, I will👇

・Explain what Codex actually is

・Detail what changed with GPT-5.5

・Discuss the fundamental differences from Claude Code

・Show beginners exactly where to start

I will break these down to a level that can be understood even starting from zero.

If you have any of these concerns, you must read this article to the end👇

Codex Studio - inline image

・What is Codex anyway? How is it different from ChatGPT?

・I heard GPT-5.5 is amazing, but I don't know specifically why.

・I heard it can create images, but how does that work?

・I want to use it, but terms like API keys and CLI make no sense to me.

・I'm afraid to touch it because I don't know how much it costs.

These are the walls that almost everyone hits when they start getting interested in Codex.

Official documentation is in English, information is scattered everywhere, and it's hard to know where to begin. Plus, with new models and tools coming out every week, just keeping up is exhausting.

For this guide, I have read through all the OpenAI official materials, system cards, API docs, and developer guides as of April 29, 2026, to summarize the big picture of "Codex × GPT-5.5 × Image Generation" into one textbook.

From app installation to prompt design, image generation integration, cost management, and IDE integration—reading this article from top to bottom should get you from knowing nothing to being fully operational👇

■ What is 𝗖𝗼𝗱𝗲𝘅 anyway?

Codex Studio - inline image

In short, OpenAI Codex is an "AI Coding Agent."

To put the difference with ChatGPT simply: ChatGPT is an "AI that talks," while Codex is an "AI that works."

If you ask ChatGPT to "fix this code," it returns a text response. Codex is different. It actually opens the file, rewrites the code, runs tests, and confirms the results. Reading, writing, executing, and fixing—Codex does it all automatically.

Furthermore, with the major April 2026 update ("Codex for (almost) everything"), it now supports non-coding tasks. It has evolved into an "almost universal AI agent" that can integrate with over 90 tools including Jira, Slack, Notion, Google Workspace, and HubSpot.

There are three ways to use Codex:

Codex Studio - inline image

・𝗖𝗼𝗱𝗲𝘅 Desktop App ── The easiest way. Just download the app and log in. No terminal operations required. Supports macOS and Windows.

・𝗖𝗼𝗱𝗲𝘅 𝗖𝗟𝗜 ── An agent that runs in the terminal. It is released as open source (Apache 2.0). This is more flexible for those used to the terminal.

・𝗖𝗼𝗱𝗲𝘅 𝗖𝗹𝗼𝘂𝗱 ── Executes tasks in the background on the cloud. Good for running multiple tasks in parallel or integrating with GitHub repositories. Aimed at team development.

Beginners should start with the "Desktop App." You can begin without using the terminal at all.

■ Getting Started (Desktop App Edition)

Codex Studio - inline image
Codex Studio - inline image

The simplest way to start is downloading the desktop app.

For 𝗠𝗮𝗰:

Install via Mac App Store or Homebrew:

brew install --cask codex

For 𝗪𝗶𝗻𝗱𝗼𝘄𝘀:

Search for "Codex" in the Microsoft Store and install.

Once you open the app, just log in with your ChatGPT account. A browser will open for authentication, and you can use it immediately. No API key setup is required.

Yes, if you have a ChatGPT account, you can log in as is. Even the Free plan is okay.

Once the app is open, try something like this:

"Show me a list of files in this folder"

"Find and fix the bug in this code"

"Create a README.md"

Codex will read the files, think, execute, and return the results. At this point, you'll realize, "Oh, this is totally different from ChatGPT."

■ Getting Started (𝗖𝗟𝗜 Edition)

For those comfortable with the terminal, the Codex CLI offers more flexibility.

Installation:

npm i -g @openai/codex

On macOS:

brew install codex

Authentication:

codex auth

→ A browser opens to log in via ChatGPT account or enter an API key.

Verification:

codex "Please introduce yourself in English."

If you get a response, it's a success. That's it.

If you use an API key for authentication, it's convenient to set it as an environment variable:

export OPENAI_API_KEY="sk-xxxxxxxx"

Adding this to your ~/.zshrc (Mac) or ~/.bashrc (Linux) removes the need to enter it every time.

You can issue API keys at platform.openai.com under Dashboard → "API Keys" → "Create new secret key." The key is only shown once, so copy and store it safely. Never share it or push it to GitHub.

■ Creating a Config File

Codex Studio - inline image

If you want to customize Codex's behavior, create ~/.codex/config.toml. This is common to both the desktop app and CLI.

text
1model = "gpt-5.5"
2approval_policy = "on-request"
3sandbox_mode = "workspace-write"

Meaning of each setting:

𝗺𝗼𝗱𝗲𝗹 ── The model to use. gpt-5.5 is the highest performance. If you want to save costs, gpt-5.4 is also an option.

𝗮𝗽𝗽𝗿𝗼𝘃𝗮𝗹_𝗽𝗼𝗹𝗶𝗰𝘆:

・"untrusted" ── Automatically executes read-only commands only. Asks for confirmation for everything else (safest).

・"on-request" ── Asks for confirmation as needed (recommended).

・"never" ── Executes everything without confirmation (for advanced users).

𝘀𝗮𝗻𝗱𝗯𝗼𝘅_𝗺𝗼𝗱𝗲:

・"read-only" ── File reading only.

・"workspace-write" ── Read/write within the workspace + command execution (recommended).

・"danger-full-access" ── No restrictions (dangerous, usually not used).

Beginners should start with on-request + workspace-write. Codex will ask "May I do this?" before executing anything, preventing unintended operations.

■ What is 𝗚𝗣𝗧-𝟱.𝟱? (Why it's called the "Strongest")

Codex Studio - inline image

GPT-5.5 is OpenAI's latest flagship model released on April 23, 2026. Codenamed "Spud," OpenAI positions it for the "most complex business tasks."

GPT-5.5 is the model Codex uses under the hood and is the "recommended model" for Codex. In other words, Codex is amazing because GPT-5.5 is amazing.

Let's look at the specific numbers.

𝟭. Context Window: 𝟭,𝟬𝟱𝟬,𝟬𝟬𝟬 tokens

Codex Studio - inline image

The amount of data it can read at once is on a different scale. It's equivalent to about 800,000 Japanese characters. Since a typical paperback is about 100,000 characters, it can process the info of 8 books at once. It's at a level where you can feed it an entire large-scale codebase and say, "Find the bug here."

𝟮. Max Output: 𝟭𝟮𝟴,𝟬𝟬𝟬 tokens

With previous models, there were times when it would "cut off midway" or you'd have to ask it to "continue," but with GPT-5.5, that concern is almost gone. This is extremely helpful when generating long code or documentation in one go.

𝟯. Multimodal Support

It can process not just text, but images, audio, and video as input. You can show a UI screenshot and say "recreate this design," or hand over a photo of a handwritten note and say "textualize this"—all of these use cases are possible.

𝟰. Reasoning Effort Adjustment

Codex Studio - inline image

Five levels: none / low / medium / high / xhigh. Default is medium. Use low for fast responses on simple tasks, and high for complex tasks that require deep thinking. Since cost is proportional to reasoning effort, switching based on the situation is important.

𝟱. Benchmarks

・Terminal-Bench 2.0 (Agent Automation) ── GPT-5.5: 82.7% (1st place), Claude Opus 4.7: 69.4%

・GPQA Diamond (Graduate Level Knowledge) ── GPT-5.5: 93.6%, Claude Opus 4.7: 94.2%, Gemini 3.1 Pro: 94.3%

・SWE-Bench Pro (Software Engineering) ── GPT-5.5: 58.6%, Claude Opus 4.7: 64.3%

The Terminal-Bench score of 82.7% is particularly important. This is an index of the "ability to complete tasks automatically as an agent," which directly affects agent-based development like Codex. While no model wins in every category, the Codex × GPT-5.5 combo is currently the strongest for automation purposes.

■ Integration with 𝗴𝗽𝘁-𝗶𝗺𝗮𝗴𝗲-𝟮 (Seamless Image Generation)

Codex Studio - inline image

Released the same week as GPT-5.5 (April 21, 2026) was "gpt-image-2" (ChatGPT Images 2.0).

What's amazing about this model is its ability to accurately render Japanese text within images. Previously, it was normal for Japanese characters to be garbled in AI images, but gpt-image-2 achieves over 95% character-level accuracy across 12+ languages. Posters, logos, diagrams—it doesn't break even in Japanese.

And the biggest advantage is the ease of integration with Codex.

You don't need special settings to call gpt-image-2 from Codex. For example:

"Create 3 patterns for this app's icon and save them in the assets folder"

"Create a diagram based on this data"

"Generate a hero image for the landing page"

With just this, Codex handles everything from image generation to file saving. If you think "I want a diagram here" while writing code, you can just instruct it right there. It's incredibly convenient that the workflow isn't interrupted.

It supports generating up to 8 consistent images in one prompt, editing from up to 16 reference images, and high-resolution output up to 3840px. The cost for image generation is effectively about $0.006 to $0.21 per image, depending on resolution and quality.

■ 𝗣𝗿𝗶𝗰𝗶𝗻𝗴 (Understanding Costs Accurately)

Codex Studio - inline image

Money is the biggest concern when starting AI development. Don't leave it vague; understand it clearly.

First, the billing structure differs between using Codex via a ChatGPT subscription (Free / Go / Plus / Pro) and hitting the API directly.

Via 𝗖𝗵𝗮𝘁𝗚𝗣𝗧 Plans (Start here as a beginner):

・Free ($0) ── GPT-5.5 available. Codex available for a limited time.

・Go ($8/mo) ── GPT-5.5 available. Codex available for a limited time.

・Plus ($20/mo) ── GPT-5.5 available. Codex available.

・Pro ($100–$200/mo) ── All features including GPT-5.5 Pro.

I recommend trying the Free plan first, then upgrading to Plus ($20/mo) for serious use. Getting both GPT-5.5 and Codex for $20/month is great value.

Direct 𝗔𝗣𝗜 Usage (Intermediate and above):

Codex Studio - inline image

・GPT-5.5 ── Input $5.00 / Output $30.00 (per 1M tokens)

・GPT-5.4 ── Input $2.50 / Output $15.00

・GPT-5.3 ── Input $1.75 / Output $14.00

GPT-5.5 costs twice as much as 5.4. A smart way to use it is "usually 5.4, and 5.5 only for complex processing."

There are also discount options:

・Batch ── 50% off standard. For tasks that don't need real-time responses.

・Flex ── Also 50% off. Cheaper in exchange for variable wait times.

Note that long-context usage (inputs over 272,000 tokens) costs 2x for input and 1.5x for output. Keep this in mind when passing massive amounts of code.

■ 𝗣𝘆𝘁𝗵𝗼𝗻 / 𝗡𝗼𝗱𝗲.𝗷𝘀 𝗦𝗗𝗞 (For Direct API Use)

Codex Studio - inline image

If you want to hit the GPT-5.5 API directly from your own code rather than using the Codex CLI or app, install the SDK.

𝗣𝘆𝘁𝗵𝗼𝗻:

pip install openai

python
1from openai import OpenAI
2client = OpenAI()
3response = client.responses.create(
4 model="gpt-5.5",
5 reasoning={"effort": "medium"},
6 input="Write a function to calculate the Fibonacci sequence in Python."
7)
8print(response.output_text)

𝗡𝗼𝗱𝗲.𝗷𝘀:

npm install openai

javascript
1import OpenAI from "openai";
2const client = new OpenAI();
3const resp = await client.responses.create({
4 model: "gpt-5.5",
5 reasoning: { effort: "medium" },
6 input: "Create a simple API server with Express.js."
7});
8console.log(resp.output_text);

Use this when you want to "embed GPT-5.5 into your own app." For starters, the Codex CLI or desktop app is enough.

■ 𝗟𝗼𝗰𝗮𝗹 𝘃𝘀 𝗖𝗹𝗼𝘂𝗱 (Differences)

Codex Studio - inline image

Codex has two modes: local execution and cloud execution.

Local execution calls the model directly from the desktop app or CLI. It automatically uses local files as context, making it efficient with minimal prompts. It's fast and suited for personal development or quick fixes.

Cloud execution (Codex Cloud) runs tasks in the background on the cloud. It's strong for parallel tasks, GitHub integration, and team development. Requires login with a ChatGPT account.

Beginners should start with local and try cloud once they get used to it.

Points by 𝗢𝗦:

Codex Studio - inline image

・macOS ── Desktop app, CLI, and IDE extensions all supported. The most complete environment.

・Windows ── Desktop app, CLI, and IDE extensions supported. Windows 11 + WSL2 recommended.

・Linux ── Desktop app not supported. CLI and IDE extensions are available.

■ 𝗜𝗗𝗘 𝗜𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻

Besides the app and terminal, you can use Codex directly inside your editor.

𝗩𝗦 𝗖𝗼𝗱𝗲:

Install "Codex - OpenAI's coding agent" from the Marketplace. It can be used alongside Claude Code or GitHub Copilot.

It automatically uses open files or selected code as context, so you can write prompts without copy-pasting.

Inside the extension, you can:

・Switch models (GPT-5.5 ↔ 5.4 ↔ 5.3)

・Change reasoning effort levels

・Toggle approval modes

・Connect to Cloud environments

𝗝𝗲𝘁𝗕𝗿𝗮𝗶𝗻𝘀 (IntelliJ, PyCharm, WebStorm, etc.):

Native integration since January 2026. Available in IDE version 2025.3 or later.

■ 𝗣𝗿𝗼𝗺𝗽𝘁 𝗗𝗲𝘀𝗶𝗴𝗻 (Writing Prompts Changes Results)

Codex Studio - inline image

When using GPT-5.5, the biggest difference comes from how you write prompts. Even with the same model, the quality of output changes completely based on the prompt.

For GPT-5.5, a structured prompt with these 4 elements is recommended:

・𝗚𝗼𝗮𝗹 ── What you want to achieve

・𝗖𝗼𝗻𝘁𝗲𝘅𝘁 ── The situation or environment

・𝗖𝗼𝗻𝘀𝘁𝗿𝗮𝗶𝗻𝘁𝘀 ── Things not to do or limitations

・𝗗𝗼𝗻𝗲 𝘄𝗵𝗲𝗻 ── What defines "completion"

Example:

Codex Studio - inline image

Goal: Create a user registration API endpoint.

Context: Python + FastAPI + PostgreSQL. INSERT into the existing users table.

Constraints: No additional external libraries. Hash passwords with bcrypt. Email duplication check is mandatory.

Done when: Sending JSON (name, email, password) to POST /users creates a user and returns 201. Duplicate emails return 409.

Just saying "make a user registration API" works, but writing like the above drastically improves accuracy. It reduces back-and-forth, making it faster in the end.

Choosing Reasoning Effort:

・none / low ── Simple conversions or routine tasks. Fastest response.

・medium ── General coding or Q&A (default).

・high ── Complex algorithm design or debugging.

・xhigh ── Highest difficulty agent tasks.

Cost is proportional to effort, so setting everything to xhigh is inefficient. Choose the level that fits the task.

■ 𝗗𝗲𝗯𝘂𝗴𝗴𝗶𝗻𝗴 & 𝗧𝗲𝘀𝘁𝗶𝗻𝗴

Codex Studio - inline image

After writing code comes debugging and testing. Codex + GPT-5.5 shines here too.

The trick to debugging is passing the error log as is.

"It doesn't work" → NG

"RuntimeError occurred in pytest. Stack trace: (full error). Please fix." → OK

GPT-5.5 has a 1,050,000 token context, so long logs are no problem. In fact, more information is better.

With Codex CLI, in the project folder:

codex "Investigate why this test is failing and fix it. Confirm that the test passes."

Codex will read the file, run the test, analyze the error, fix it, and run the test again automatically. This is the essence of an "AI that works."

You can also leave test generation to it:

Codex Studio - inline image

codex "Write pytest tests for the register_user function in src/auth/register.py. Include three patterns: success, error, and validation."

It handles everything from creating the test file to verifying execution.

■ 𝗦𝗲𝗰𝘂𝗿𝗶𝘁𝘆

Codex Studio - inline image

Codex has a two-layer security structure.

① Sandbox Mode ── Technically limits the scope of what it "can do." With workspace-write, it cannot touch anything outside the workspace.

② Approval Policy ── Asks "May I do this?" before operations that cross boundaries. Prevents unintended actions.

Codex Cloud runs in isolated OpenAI-managed containers, so it cannot access the host system. Local CLI/IDE extensions are also forced into sandboxes at the OS level.

Beginners are safe starting with on-request + workspace-write.

■ Real-World Usage

Codex Studio - inline image

85% of OpenAI employees reportedly use Codex weekly.

・Finance Team ── Processed reviews of 24,771 K-1 tax documents (71,637 pages) with Codex. Finished 2 weeks earlier than the previous year.

・Marketing Team ── Automated weekly business report generation. Saved 5–10 hours per week.

・Developer Examples ── Generated a pixel art game in a single HTML file with one prompt. Automated generation of an e-commerce CRUD API with Express.js plus a test suite.

Not just writing code, but analyzing materials, creating reports, and organizing data—the strength of current Codex is "automation of knowledge work."

■ Summary ── Roadmap to Mastering Codex from Zero

Codex Studio - inline image

That is the big picture of Codex × GPT-5.5 × gpt-image-2.

𝗦𝘁𝗲𝗽 𝟭 (Understand) ── Know what Codex is.

→ ChatGPT is "AI that talks," Codex is "AI that works."

𝗦𝘁𝗲𝗽 𝟮 (Start) ── Download the desktop app and log in.

→ Start in 5 minutes. No terminal needed.

𝗦𝘁𝗲𝗽 𝟯 (Basics) ── Use the 4-element prompt (Goal/Context/Constraints/Done when).

→ Don't write vaguely; get into the habit of specifying completion conditions.

𝗦𝘁𝗲𝗽 𝟰 (Practice) ── Pass error logs for debugging + auto-generate tests + IDE integration.

→ Incorporate Codex into your development cycle.

𝗦𝘁𝗲𝗽 𝟱 (Optimize Cost) ── Use GPT-5.4 normally, 5.5 for complex tasks.

→ Utilize Batch and Flex for 50% off.

𝗦𝘁𝗲𝗽 𝟲 (Advanced) ── Image generation with gpt-image-2, parallel tasks in Cloud, automation with plugins.

→ Expand usage beyond coding.

Start with Step 2. Download the app, log in, and try one thing. You can start in 5 minutes. Once you get it moving, you can learn the rest as you go.

Codex is still evolving. Since the start of 2026, there have been major updates almost every month. That's why it's important to grasp the basics now and build a foundation to adapt to changes.

To those who found this article helpful:

Codex Studio - inline image

𝗖𝗼𝗱𝗲𝘅 𝗦𝘁𝘂𝗱𝗶𝗼 (@Codestudiopjbk) is an account run by three Codex enthusiasts.

We post daily about practical CLI usage and automation.

We post about:

・Real product development examples using GPT-5.5 and OpenAI Codex

・Codex usage / CLI automation / development trends

・Latest overseas info on GPT-5.5 and Codex

From development philosophy to design, implementation, and improvement, we summarize primary and overseas information to help you release working products.

If you're interested, please follow us! For development consultations, please send a DM.

One-click save

Use YouMind for AI deep reading of viral articles

Save the source, ask focused questions, summarize the argument, and turn a viral article into reusable notes in one AI workspace.

Explore YouMind
For creators

Turn your Markdown into a clean 𝕏 article

When you publish your own long-form writing, images, tables, and code blocks make 𝕏 formatting painful. YouMind turns a full Markdown draft into a clean, ready-to-post 𝕏 article.

Try Markdown to 𝕏

More patterns to decode

Recent viral articles

Explore more viral articles