חיבור ChatGPT Plus/Pro ל-Claude Code — ייצור תמונות עם gpt-image-1 ישירות מהטרמינל, בלי API key ובלי תשלום נוסף
יש לך מנוי ChatGPT Plus או Pro? אתה יכול לייצר תמונות עם המודל החדש של OpenAI ישירות מתוך Claude Code — בלי לשלם על API key נפרד.
רוצה לדלג ישר לעשייה? העתק את הפרומפט הזה והדבק אותו ב-Claude Code — הוא יטפל בכל ההתקנות צעד אחר צעד:
הטריק: שלושה כלים עובדים יחד:
| רכיב | מה הוא עושה |
|---|---|
Codex CLI (@openai/codex) |
ה-CLI הרשמי של OpenAI. מחזיק את טוקן הכניסה לחשבון ChatGPT שלך |
openai-mcp (chatgpt-pro-mcp) |
שרת MCP שמגשר בין ChatGPT ל-Claude Code |
פלאגין codex-image |
סקיל ל-Claude Code שמפעיל יצירת תמונות דרך Codex |
Codex CLI הוא הכלי של OpenAI שמנהל את הזיהוי לחשבון ChatGPT. מתקינים גלובלית:
npm install -g @openai/codex
בודקים שהכל עלה תקין:
codex --version
פלט צפוי: codex-cli 0.130.0 (או גרסה עדכנית יותר).
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 ואז פתחו טרמינל חדש.
הפקודה הזו מחברת את שרת ה-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
אחרי ההפעלה מחדש, Claude Code יקבל גישה לכלים: chat, deep_research,
codex_task_create, list_models ועוד.
הפלאגין הזה מוסיף ל-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
פותחים 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/ בתוך הפרויקט הנוכחי.
| בעיה | פתרון |
|---|---|
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/ קיימת — אם לא, צרו אותה ידנית |
openai-mcp setupמנוי ChatGPT Plus/Pro שכבר שילמתם עליו עובד כעת גם בתוך Claude Code. בלי API key נפרד, בלי תשלום נוסף.
Connect ChatGPT Plus/Pro to Claude Code — generate images with gpt-image-1 directly from the terminal, no API key, no extra cost
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:
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 |
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).
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
pipx ensurepath then open a new
terminal window.
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
After restarting, Claude Code will have access to tools: chat, deep_research,
codex_task_create, list_models, and more.
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
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.
| 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
|
openai-mcp setupThe ChatGPT Plus/Pro subscription you're already paying for now works inside Claude Code too. No separate API key, no extra cost.