Codex Imagegen Via Chatgpt Oauth logo

Codex Imagegen Via Chatgpt Oauth

Community
madrobotnet
codex-imagegen-via-chatgpt-oauth

Use a separate Codex CLI instance logged in via ChatGPT / OpenAI Codex OAuth to generate an image with Codex's built-in imagegen skill, then verify the saved PNG from ~/.codex/generated_images.

Overview

Publishermadrobotnet
Repositoryhermes-codex-imagegen-skill
Skill namecodex-imagegen-via-chatgpt-oauth
Stars
29
Forks
1
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by madrobotnet on GitHub. Read the source before you install it.

Installation

Install the Codex Imagegen Via Chatgpt Oauth AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/madrobotnet/hermes-codex-imagegen-skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/madrobotnet/hermes-codex-imagegen-skill.git \
  .claude/skills/codex-imagegen-via-chatgpt-oauth
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Codex Imagegen Via Chatgpt Oauth in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Codex Imagegen Via Chatgpt Oauth on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Codex Imagegen Via Chatgpt Oauth is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Codex image generation via ChatGPT OAuth

Use this when Hermes' own image_generate tool is unavailable because FAL or the Nous Tool Gateway is not configured, but the machine has a working Codex CLI session authenticated through ChatGPT / OpenAI Codex OAuth.

What this is

This is a workaround through a separate Codex process.

It does not rewire Hermes' native image_generate tool to use Codex or the OpenAI Images API directly.

Preconditions

  1. codex is installed and on PATH
  2. codex login status returns a live ChatGPT login, for example Logged in using ChatGPT
  3. You accept that generated files land under ~/.codex/generated_images/<session_id>/...

Required checks

Run these first:

bash
which codex && codex --version
codex login status
codex exec --help | head -n 40

Why:

  • confirms Codex is really installed
  • confirms OAuth is actually live
  • confirms the local CLI supports exec, --skip-git-repo-check, and sandbox flags

Core workflow

1. Create a temp workspace

bash
TMP=$(mktemp -d /tmp/codex-image-XXXXXX)

2. Run Codex non-interactively

Use --skip-git-repo-check because image generation does not need a repository. Use --ephemeral so you do not leave extra Codex session state behind. Use -o "$TMP/last.txt" so the final assistant message is saved locally too.

bash
codex exec \
  --skip-git-repo-check \
  --ephemeral \
  --sandbox workspace-write \
  -C "$TMP" \
  -o "$TMP/last.txt" \
  'You are testing whether image generation is available. Generate an image of "<user request>". If possible, save the resulting image to a file or leave a URL. If that is not possible, explain exactly why. In your final answer, respond in the user\'s language and include the success or failure status plus the output path or URL.'

3. Capture the session id from stdout

Codex prints a line like:

text
session id: 019db2a7-8461-7251-9281-46a7606caade

Keep that id.

4. Verify the actual PNG outside Codex

Do not rely only on Codex's self-report. Verify from Hermes side by searching ~/.codex/generated_images/.

Preferred:

text
search_files(target='files', path='~/.codex/generated_images/<session_id>', pattern='*')

Broad fallback if the session id was missed:

text
search_files(target='files', path='~/.codex/generated_images', pattern='*.png', limit=20)

5. Optionally inspect the image

Use vision_analyze to quickly check whether the output actually matches the prompt before presenting it.

Recommended Hermes tool sequence

  1. terminal — verify Codex install and login, then run codex exec
  2. search_files — confirm the generated file exists
  3. vision_analyze — sanity-check prompt fit

Known pitfall

Codex may show sandbox or bubblewrap errors like:

text
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted

This can happen after the image was already generated, when Codex tries to inspect files inside its own sandbox.

Do not treat that message as proof of generation failure.

Instead:

  • verify the real output from Hermes side
  • search ~/.codex/generated_images/
  • trust actual file existence over Codex's post-generation introspection errors

Good prompt wrapper

Use a wrapper that forces Codex to explicitly report success or failure and leave a path or URL:

text
Generate an image of "<scene>". If possible, save the resulting image to a file or leave a URL. If that is not possible, explain exactly why. In your final answer, respond in the user's language and include the success or failure status plus the output path or URL.

Example used successfully

User request:

text
A view of Sangam-dong, Seoul at 7 PM

Observed file pattern:

text
~/.codex/generated_images/<session_id>/ig_<hash>.png

If the image must live in the current project

Codex normally writes into ~/.codex/generated_images/.... If the result should become a real project asset, copy it into the workspace after verification.

Example:

bash
cp ~/.codex/generated_images/<session_id>/ig_<hash>.png ./public/images/

Do not leave a project-referenced asset only inside ~/.codex/generated_images/.

Verification checklist

  • Codex installed
  • ChatGPT login active
  • codex exec exits successfully
  • PNG exists under ~/.codex/generated_images
  • optional: visual inspection says the image roughly matches the request

When not to use

Do not use this workflow when:

  • the user expects this to change Hermes' native image backend
  • Codex is not logged in
  • the output must land in a deterministic path without a follow-up copy step
  • the task requires a repeatable official API workflow rather than a tool-side workaround

Frequently asked questions

What does the Codex Imagegen Via Chatgpt Oauth AI skill do?

Use a separate Codex CLI instance logged in via ChatGPT / OpenAI Codex OAuth to generate an image with Codex's built-in imagegen skill, then verify the saved PNG from ~/.codex/generated_images.

Why use Codex Imagegen Via Chatgpt Oauth on TypingMind?

Because you install it once and use it with any model. Codex Imagegen Via Chatgpt Oauth is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Codex Imagegen Via Chatgpt Oauth in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/madrobotnet/hermes-codex-imagegen-skill/tree/main. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Codex Imagegen Via Chatgpt Oauth?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Codex Imagegen Via Chatgpt Oauth?

As many as you like. As long as a model supports skills, you can use Codex Imagegen Via Chatgpt Oauth with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Codex Imagegen Via Chatgpt Oauth AI skill free?

Yes. It is published on GitHub by madrobotnet under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇