codex-image
/codex-image
Generuje obrazy przez API backendu Codex OpenAI z narzędziem gpt-image-2, pobierając token automatycznie z sesji chatgpt.com.
- Autor
- openminis ↗
- Repozytorium
- minisskills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 3
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 3 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/codex_image.py, scripts/codex_image_edit.py, scripts/get_auth.py
Co robi i kiedy
Generuje obrazy przez API backendu Codex OpenAI z narzędziem gpt-image-2, pobierając token automatycznie z sesji chatgpt.com.
Wyzwalacze z opisu
Oryginalny opis (EN)
Generate images using OpenAI's Codex backend API with gpt-image-2 tool. Use when the user asks to generate images via Codex, ChatGPT image generation, or gpt-image-2. Triggers on "codex image", "codex generate", "gpt-image", "chatgpt generate image". Token is auto-fetched from chatgpt.com session — no manual token setup needed.
Jak działa
- Requirements
- Auth Token Resolution (in order)
- Usage
- Auth Script (standalone)
- Workflow
- Notes
Podgląd SKILL.md
---
name: codex-image
description: Generate images using OpenAI's Codex backend API with gpt-image-2 tool. Use when the user asks to generate images via Codex, ChatGPT image generation, or gpt-image-2. Triggers on "codex image", "codex generate", "gpt-image", "chatgpt generate image". Token is auto-fetched from chatgpt.com session — no manual token setup needed.
---
# Codex Image Generation
Generate images via `chatgpt.com/backend-api/codex/responses` using the `image_generation` tool (gpt-image-2).
## Requirements
- A ChatGPT account (token is fetched automatically via browser session)
- No manual token setup needed — the skill handles auth automatically
## Auth Token Resolution (in order)
1. `--token` argument (CLI only)
2. `CODEX_IMAGE_TOKEN` environment variable
3. `--token-file` argument (CLI only)
4. `~/.chatgpt_auth.json` cache (valid for 8 hours)
5. **Auto login flow** — fetches from `https://chatgpt.com/api/auth/session` via `minis-browser-use`:
- If already logged in → token extracted and saved to cache immediately
- If not logged in → opens `chatgpt.com/auth/login` in the browser, then polls every 10s in a new tab for up to 5 minutes
- On success → saves token to `~/.chatgpt_auth.json` (chmod 600, token + timestamp only)
- **Token is never printed to stdout or logs** — it stays in the cache file only
## Usage
### Text-to-image
```bash
python3 scripts/codex_image.py "a cute rabbit on a light background" \
--output rabbit.png \
--model gpt-5.4 \
--effort low
```
### Image-to-image / reference image
```bash
python3 scripts/codex_image_edit.py "turn this person into a cinematic iOS AI assistant portrait" \
--image reference.jpg \
--output portrait.png \
--model gpt-5.4 \
--effort low
```
`codex_image_edit.py` encodes the local reference image as a base64 data URL and sends it as multimodal input (`input_text` + `input_image`) to the same Codex responses endpoint, then asks the `image_generation` tool to create a new image from the reference.
### Parameters
| Parameter | Default | Description |
|-----------|---------|-------------|
| `prompt` | (required) | Image description or edit instruction |
| `--image` | (edit only, required) | Local reference image path for image-to-image generation |
| `--output` | `codex_image.png` / `codex_image_edit.png` | Output file path |
| `--model` | `gpt-5.4` | Codex model |
| `--effort` | `low` | Reasoning effort: low/medium/high |
| `--token` | - | Access token directly (skips auto auth; text-to-image script only) |
| `--token-file` | - | File containing token (skips auto auth; text-to-image script only) |
### Output
JSON with `success`, `path`, `size`, `revised_prompt` on success.
## Auth Script (standalone)
```bash
python3 scripts/get_auth.py
```
Returns JSON `{"success": true, "source": "cache|session|login"}` — **the token itself is never printed to stdout**. It is written only to `~/.chatgpt_auth.json` (chmod 600, token + timestamp only, no PII). This prevents the token from appearing in shell logs, conversation context, or screenshots.
## Workflow
1. **Token**: auto-resolved via `get_auth.py`:
- Already cached → use directly
- Already logged in (browser session) → extract immediately
- Not logged in → `minis-open` pops the ChatGPT login page to the user in foreground, then polls every 10s (up to 5 min) until login is detected
2. Construct the prompt from the user's request.
3. Run `scripts/codex_image.py` with appropriate arguments.
4. Send the generated image to the user.
## Notes
- Token is cached in `~/.chatgpt_auth.json` for 8 hours (chmod 600, token + timestamp only — no PII stored).
- **Token is never printed to stdout or conversation context** — always read from cache file internally.
- The endpoint requires `stream: true`; the script handles SSE parsing internally.
- Token is a ChatGPT session token, not an OpenAI API key. It expires and is refreshed automatically on next use.
- Image generation uses `gpt-image-2` under the hood with auto quality/size.
- Token usage is split: main `usage` tracks text tokens, `tool_usage.image_gen` tracks image tokens separately.
- This uses an internal/unofficial API endpoint. Availability may change.
Pliki w paczce (4)
- SKILL.md 4 KB
- scripts/codex_image.py 9 KB
- scripts/codex_image_edit.py 5 KB
- scripts/get_auth.py 8 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · openminis/minisskills | 100 | MIT |
| mishagavura/claude-code-image-generation | 100 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki 83ffa2647133 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100generate-image
Generuje obrazy modelem OpenAI GPT Image 2 przez Codex CLI w ramach subskrypcji ChatGPT Plus, bez klucza API i kosztów za obraz, z promptów tekstowych. - 84generate-image
Generuje obrazy, ikony, logo i banery przez gpt-image-2 w Codex CLI, na istniejącym logowaniu ChatGPT bez klucza API. - 100gpt-image-skill
Generuje i edytuje obrazy przez OpenAI GPT Image API (gpt-image-2, gpt-image-1), gdy użytkownik wyraźnie wskazuje OpenAI lub GPT jako dostawcę. - 100gpt-image-skill
Generuje lub edytuje obrazy, gdy użytkownik wskazuje OpenAI, GPT Image lub model gpt-image, a bez wskazanego dostawcy działa domyślny skill obrazów. - 100codex-image2
Konfiguruje własną usługę obrazów zgodną z OpenAI na lokalnej stronie ustawień oraz generuje i edytuje obrazy, preferując gpt-image-2.5, a w razie braku gpt-image-2, także wsadowo. - 100gpt-image-2-api
Generuje i edytuje obrazy modelem gpt-image-2 przez zgodne z OpenAI API zewnętrznego dostawcy, konfigurowane w pliku .env (OPENAI_API_KEY i OPENAI_BASE_URL).