Claude Code • AI Tools • 2026

יצירת תמונות עם המודל החדש של ChatGPT דרך Claude Code

חיבור ChatGPT Plus/Pro ל-Claude Code — ייצור תמונות עם gpt-image-1 ישירות מהטרמינל, בלי API key ובלי תשלום נוסף

נכתב על ידי @leecohen.ai • Owner of Clearlee-Ai

💡 מה עושים כאן ולמה זה שווה

יש לך מנוי ChatGPT Plus או Pro? אתה יכול לייצר תמונות עם המודל החדש של OpenAI ישירות מתוך Claude Code — בלי לשלם על API key נפרד.

רוצה לדלג ישר לעשייה? העתק את הפרומפט הזה והדבק אותו ב-Claude Code — הוא יטפל בכל ההתקנות צעד אחר צעד:

📋 פרומפט מוכן להדבקה — Claude Code
התקן עבורי את שלושת הכלים הבאים ובדוק שכולם עובדים לפני שתמשיך לשלב הבא. בכל פעם שתסיים שלב, אמת שאין שגיאות לפני שתמשיך: 1. Codex CLI: - הרץ: npm install -g @openai/codex - בדוק: codex --version (פלט צפוי: codex-cli 0.130.0 או גרסה גבוהה יותר) 2. openai-mcp: - השתמש ב-pipx (לא pip3) — על macOS עם Homebrew, pip3 system-wide חסום - אם pipx לא מותקן, התקן קודם: brew install pipx - הרץ: pipx install git+https://github.com/robotlearning123/chatgpt-pro-mcp.git - בדוק: which openai-mcp ו-openai-mcp --help 3. רישום openai-mcp עם Claude Code: - הרץ: openai-mcp setup - הפקודה תאתר אוטומטית את תעודות ChatGPT מקובץ הקונפיגורציה של Codex - אם אין קובץ כזה, הרץ קודם: codex login (OAuth עם חשבון ChatGPT) - בדוק שמופיע: ✓ Claude Code → ~/.claude.json updated 4. התקנת פלאגין codex-image: - הרץ: claude plugin marketplace add KingGyuSuh/codex-image-in-cc - הרץ: claude plugin install codex-image@codex-image-in-cc - בדוק: claude plugin list → רשומה codex-image@codex-image-in-cc עם Status: ✓ enabled 5. בדיקה סופית: - תיצור תמונה: "generate an image of a glowing AI brain, dark background, cinematic style" - בדוק שמתקבלת שורת SAVED: עם נתיב לקובץ PNG

הטריק: שלושה כלים עובדים יחד:

רכיב מה הוא עושה
Codex CLI (@openai/codex) ה-CLI הרשמי של OpenAI. מחזיק את טוקן הכניסה לחשבון ChatGPT שלך
openai-mcp (chatgpt-pro-mcp) שרת MCP שמגשר בין ChatGPT ל-Claude Code
פלאגין codex-image סקיל ל-Claude Code שמפעיל יצירת תמונות דרך Codex
דרישות מקדימות: מנוי ChatGPT Plus או Pro פעיל, Claude Code מותקן, Node.js ו-npm.

📦 שלב 1 — התקנת Codex CLI

Codex CLI הוא הכלי של OpenAI שמנהל את הזיהוי לחשבון ChatGPT. מתקינים גלובלית:

npm install -g @openai/codex

בודקים שהכל עלה תקין:

codex --version

פלט צפוי: codex-cli 0.130.0 (או גרסה עדכנית יותר).

🔌 שלב 2 — התקנת openai-mcp

openai-mcp הוא שרת MCP שמחבר את ChatGPT ל-Claude Code. על macOS משתמשים ב-pipx במקום pip3 — הוא יוצר סביבה בידודית ומונע קונפליקטים עם Python של המערכת.

אם pipx לא מותקן:

brew install pipx

מתקינים את openai-mcp:

pipx install git+https://github.com/robotlearning123/chatgpt-pro-mcp.git

פלט צפוי:

installed package openai-mcp 0.0.1, installed using Python 3.x
These apps are now available: openai-mcp
הכלי לא נמצא אחרי ההתקנה? הריצו pipx ensurepath ואז פתחו טרמינל חדש.

🔗 שלב 3 — רישום openai-mcp על Claude Code

הפקודה הזו מחברת את שרת ה-MCP ל-Claude Code ומגדירה אוטו-סטרט:

openai-mcp setup

הפקודה מחפשת אוטומטית את טוקן Codex ב-~/.codex/auth.json. אם הוא לא קיים — מריצים לוגין:

codex login

נפתח דפדפן עם OAuth לחשבון ChatGPT. אחרי אישור — חוזרים ומריצים openai-mcp setup.

פלט מוצלח נראה כך:

✓ Found Codex CLI token (~/.codex/auth.json)
✓ ChatGPT Plus detected
✓ MCP server started on :9000
✓ Auto-start enabled (LaunchAgent)
✓ Claude Code → ~/.claude.json updated
✓ Restart Claude Code to activate tools
חשוב: אחרי ה-setup — יש להפעיל מחדש את Claude Code כדי שהכלים החדשים ייטענו.

אחרי ההפעלה מחדש, Claude Code יקבל גישה לכלים: chat, deep_research, codex_task_create, list_models ועוד.

🖼️ שלב 4 — התקנת פלאגין codex-image

הפלאגין הזה מוסיף ל-Claude Code סקיל ייעודי ליצירת תמונות דרך Codex CLI:

claude plugin marketplace add KingGyuSuh/codex-image-in-cc
claude plugin install codex-image@codex-image-in-cc

בודקים שהפלאגין פעיל:

claude plugin list

הפלט אמור לכלול:

⯃ codex-image@codex-image-in-cc
  Version: 0.1.0
  Scope: user
  Status: ✓ enabled

🚀 שלב 5 — בדיקה סופית: יצירת תמונה

פותחים Claude Code בתיקיית הפרויקט ומבקשים תמונה בשפה חופשית, למשל:

generate an image of a glowing AI brain, dark background, cinematic style

Claude Code מזהה את הבקשה, מפעיל את סקיל codex-image, שולח ל-Codex CLI שמריץ את gpt-image-1 — והתמונה נשמרת:

SAVED: /path/to/project/codex-images/20260509T151705Z-1.png

הקובץ נוצר בתיקיית codex-images/ בתוך הפרויקט הנוכחי.

טיפ: אפשר לבקש כמה תמונות בפרומפט אחד, בסגנונות שונים. הכלי שומר כל תמונה עם timestamp ייחודי.

🛠️ פתרון תקלות נפוצות

בעיה פתרון
pip3 install נכשל עם "externally-managed-environment" השתמשו ב-pipx במקום — זה בדיוק מה שהוא נועד לפתור
openai-mcp לא נמצא אחרי התקנה הריצו pipx ensurepath ואז פתחו טרמינל חדש
כלי ה-MCP לא נטענים ב-Claude Code חייבים להפעיל מחדש את Claude Code אחרי openai-mcp setup
שגיאת אימות / "no token found" הריצו codex login — נפתח דפדפן עם OAuth לחשבון ChatGPT
תמונה לא נשמרת Claude Code בודק שתיקיית codex-images/ קיימת — אם לא, צרו אותה ידנית

סיכום — מה עשינו

  • התקנו Codex CLI — מחזיק את החיבור לחשבון ChatGPT
  • התקנו openai-mcp — שרת MCP שמגשר בין ChatGPT ל-Claude Code
  • רישמנו את השרת על Claude Code עם openai-mcp setup
  • הוספנו את פלאגין codex-image ליצירת תמונות
  • בדקנו שהכל עובד — תמונה ראשונה נוצרה ונשמרה
מנוי ChatGPT Plus/Pro שכבר שילמתם עליו עובד כעת גם בתוך Claude Code. בלי API key נפרד, בלי תשלום נוסף.
Claude Code • AI Tools • 2026

ChatGPT Images via Claude Code

Connect ChatGPT Plus/Pro to Claude Code — generate images with gpt-image-1 directly from the terminal, no API key, no extra cost

By @leecohen.ai • Owner of Clearlee-Ai

💡 What This Is and Why It's Worth It

Have a ChatGPT Plus or Pro subscription? You can generate images with OpenAI's latest model directly inside Claude Code — without paying for a separate API key.

Want to skip straight to doing? Copy this prompt and paste it into Claude Code — it will handle all installations step by step:

📋 Ready-to-Paste Prompt — Claude Code
Install the following three tools for me and verify each one works before moving to the next step. After each step, confirm there are no errors before continuing: 1. Codex CLI: - Run: npm install -g @openai/codex - Verify: codex --version (expected output: codex-cli 0.130.0 or higher) 2. openai-mcp: - Use pipx (not pip3) — on macOS with Homebrew, system-wide pip3 is blocked - If pipx is not installed, install it first: brew install pipx - Run: pipx install git+https://github.com/robotlearning123/chatgpt-pro-mcp.git - Verify: which openai-mcp and openai-mcp --help 3. Register openai-mcp with Claude Code: - Run: openai-mcp setup - The command will automatically find the ChatGPT credentials in Codex's config file - If no file exists, run first: codex login (OAuth login with ChatGPT account) - Verify you see: ✓ Claude Code → ~/.claude.json updated 4. Install the codex-image plugin: - Run: claude plugin marketplace add KingGyuSuh/codex-image-in-cc - Run: claude plugin install codex-image@codex-image-in-cc - Verify: claude plugin list → entry codex-image@codex-image-in-cc with Status: ✓ enabled 5. Final test: - Ask me to generate an image: "generate an image of a glowing AI brain, dark background, cinematic style" - Verify you receive a SAVED: line with a path to a PNG file

The trick: three tools working together:

Component What It Does
Codex CLI (@openai/codex) OpenAI's official CLI. Holds the login token for your ChatGPT account
openai-mcp (chatgpt-pro-mcp) MCP server that bridges ChatGPT and Claude Code
codex-image plugin Claude Code skill that triggers image generation via Codex
Prerequisites: Active ChatGPT Plus or Pro subscription, Claude Code installed, Node.js and npm.

📦 Step 1 — Install Codex CLI

Codex CLI is OpenAI's tool that manages authentication to your ChatGPT account. Install it globally:

npm install -g @openai/codex

Verify everything installed correctly:

codex --version

Expected output: codex-cli 0.130.0 (or a newer version).

🔌 Step 2 — Install openai-mcp

openai-mcp is an MCP server that connects ChatGPT to Claude Code. On macOS, use pipx instead of pip3 — it creates an isolated environment and avoids conflicts with the system Python.

If pipx is not installed:

brew install pipx

Install openai-mcp:

pipx install git+https://github.com/robotlearning123/chatgpt-pro-mcp.git

Expected output:

installed package openai-mcp 0.0.1, installed using Python 3.x
These apps are now available: openai-mcp
Tool not found after installation? Run pipx ensurepath then open a new terminal window.

🔗 Step 3 — Register openai-mcp with Claude Code

This command connects the MCP server to Claude Code and configures auto-start:

openai-mcp setup

It automatically looks for the Codex token at ~/.codex/auth.json. If it doesn't exist — run login first:

codex login

A browser will open with OAuth for your ChatGPT account. After approval — come back and run openai-mcp setup.

A successful output looks like this:

✓ Found Codex CLI token (~/.codex/auth.json)
✓ ChatGPT Plus detected
✓ MCP server started on :9000
✓ Auto-start enabled (LaunchAgent)
✓ Claude Code → ~/.claude.json updated
✓ Restart Claude Code to activate tools
Important: After setup — you must restart Claude Code for the new tools to load.

After restarting, Claude Code will have access to tools: chat, deep_research, codex_task_create, list_models, and more.

🖼️ Step 4 — Install the codex-image Plugin

This plugin adds a dedicated image-generation skill to Claude Code via Codex CLI:

claude plugin marketplace add KingGyuSuh/codex-image-in-cc
claude plugin install codex-image@codex-image-in-cc

Verify the plugin is active:

claude plugin list

The output should include:

⯃ codex-image@codex-image-in-cc
  Version: 0.1.0
  Scope: user
  Status: ✓ enabled

🚀 Step 5 — Final Test: Generate an Image

Open Claude Code in your project directory and request an image in natural language, for example:

generate an image of a glowing AI brain, dark background, cinematic style

Claude Code detects the request, activates the codex-image skill, sends it to Codex CLI which runs gpt-image-1 — and the image is saved:

SAVED: /path/to/project/codex-images/20260509T151705Z-1.png

The file is created in the codex-images/ directory inside the current project.

Tip: You can request multiple images in one prompt, in different styles. Each image is saved with a unique timestamp.

🛠️ Common Issues & Fixes

Issue Fix
pip3 install fails with "externally-managed-environment" Use pipx instead — that's exactly what it's designed to solve
openai-mcp not found after installation Run pipx ensurepath then open a new terminal window
MCP tools not loading in Claude Code Must restart Claude Code after running openai-mcp setup
Auth error / "no token found" Run codex login — opens a browser with OAuth for your ChatGPT account
Image not saved Claude Code checks that the codex-images/ directory exists — if not, create it manually

Summary — What We Did

  • Installed Codex CLI — holds the connection to your ChatGPT account
  • Installed openai-mcp — MCP server bridging ChatGPT and Claude Code
  • Registered the server with Claude Code using openai-mcp setup
  • Added the codex-image plugin for image generation
  • Verified everything works — first image created and saved
The ChatGPT Plus/Pro subscription you're already paying for now works inside Claude Code too. No separate API key, no extra cost.