mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6884] [Feature]: ChatGPT - Codex OAuth as an Image Generation connection #3862
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3862
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @prisoner310 on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6884
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Marinara Engine already supports many image generation providers, but ChatGPT subscribers who already use Codex currently cannot reuse their existing
codex loginsession for image generation inside Marinara.This means a user may already have access to both ChatGPT/Codex models and high-quality image generation through their subscription, but still needs to configure a separate image provider or an OpenAI Platform API key and billing account for Marinara.
For roleplay workflows in particular, being able to use the existing ChatGPT/Codex subscription for both lightweight agent tasks and image generation would make it much easier to set up a capable LLM + image generation environment.
Proposed solution
Add ChatGPT / Codex Image as a dedicated Image Generation connection.
The connection would reuse the existing local ChatGPT OAuth session created by:
instead of requiring an OpenAI Platform API key or separate API billing.
I have a working prototype in a personal fork that currently supports the standard Marinara image workflows, including:
The prototype currently uses the Codex GPT Image model exposed through the ChatGPT OAuth image endpoint.
I also verified with a real ChatGPT account that the current OAuth image endpoint accepts at least 16 distinct reference images in a single edit request. Marinara workflows can still retain their own smaller reference limits where appropriate.
The implementation is intentionally kept separate from the existing OpenAI Platform image provider and from the normal ChatGPT text connection, so the different authentication and billing paths remain explicit.
Alternatives considered
OpenAI Platform Image API
Marinara already supports OpenAI image generation through the Platform API.
That works well, but it requires a separate API key and usage-based Platform billing. It does not reuse an existing ChatGPT/Codex subscription.
Calling Codex as an external process
Another possibility would be launching Codex itself for every image request.
The prototype does not do this. It reuses Marinara's existing Codex ChatGPT authentication handling and talks to the image endpoint directly, which avoids spawning a separate Codex process for each generation.
Additional context
Issue #6453 previously included a broader prototype feature named E22 — ChatGPT image generation and provider-aware references. That umbrella issue was closed after the discussion moved toward reviewing features individually, with an invitation to open focused Issues/PRs for each feature.
I could not find a dedicated follow-up Issue for ChatGPT image generation, so I am opening this as a focused proposal rather than treating #6453 as an accepted or rejected design.
My prototype takes a somewhat narrower approach than the E22 description: it exposes ChatGPT/Codex image generation as a dedicated Image Generation connection and reuses Marinara's existing Codex OAuth helper, while leaving the existing ChatGPT text connection and OpenAI Platform image provider separate.
Relevant prototype links:
personal/codex-image)I have tested the prototype on Windows with a real ChatGPT/Codex account. It includes regression coverage for the provider adapter and related Marinara image workflows, and I have manually tested generation, reference editing, transparent sprites, Character Sheets, aspect-ratio handling, and multi-reference requests.
One important caveat is that the ChatGPT/Codex image route is tied to current Codex/ChatGPT backend behavior rather than the normal public OpenAI Platform Image API. I therefore wanted to open a Feature Request before preparing an upstream PR, to check whether this integration approach is something the project would be interested in supporting and maintaining.
If this direction is of interest, I'm happy for the prototype to be reused or adapted as part of an upstream implementation, and I can help with cleanup, testing, or further details as useful. I'm not attached to the exact implementation in my fork.
Template check
@SpicyMarinara commented on GitHub (Sep 30, 2026):
Wait, that is not true. I've been using my Codex sub for image generation this entire time, lmao. You just create an API key like you normally would, and it automatically detects that you have an active Codex connected to your account and doesn't charge you for generations.
@prisoner310 commented on GitHub (Sep 30, 2026):
Thanks for the reply! I tested this just to make sure I wasn't misunderstanding the current behavior.
I created a normal OpenAI API key on the same account without adding any Platform credits, configured it as the regular OpenAI image connection in Marinara, and ran Test Image.
The request failed with:
So at least on my account, the normal API-key image route does not appear to use my ChatGPT/Codex subscription allowance automatically.
The
codex loginOAuth route in my prototype does work without Platform credits, which is why I treated the two paths separately.If your API-key connection is genuinely using the subscription allowance without Platform credits, I'd be very interested in knowing which provider/model/connection setup you're using, because I may be missing a different supported path.
@SpicyMarinara commented on GitHub (Sep 30, 2026):
My Connection setup is:
And that's it. I only pay for occasional Astra usage via API, but not for any generated images.
@prisoner310 commented on GitHub (Sep 30, 2026):
Thanks again for sharing the exact setup!
I tried the same configuration on my side. Test Connection succeeds, Marinara can also load the model list normally, so the API key itself appears to be valid.
However, when I run Test Image, the actual generation request reaches OpenAI and then fails with:
So in my case, authentication and model discovery work, but image generation is still being checked against the Platform API credit balance rather than my ChatGPT/Codex subscription.
There may simply be some difference between our OpenAI account or billing setups. I haven't used the Platform API before and currently have no API credits on the account.
No need to spend time digging into it on my behalf — I mainly wanted to report what I'm seeing, since it seems the behavior isn't identical across our accounts.
@SpicyMarinara commented on GitHub (Sep 30, 2026):
Hm, I'll look into it.
@SpicyMarinara commented on GitHub (Oct 2, 2026):
This is now on
staging(#6952) as the ChatGPT (Codex login) image service, built from your prototype with the same endpoint and request shape. Thank you for the thorough testing and write-up, @prisoner310! It'll reachmainwith the next release.@prisoner310 commented on GitHub (Oct 2, 2026):
Thank you so much for taking the time to look into this and for adapting it for upstream!
I'm really glad the prototype and testing were useful. I appreciate you turning it into something that fits Marinara properly, and I'm looking forward to using the official version in the next release.
Thanks again!
@prisoner310 commented on GitHub (Oct 3, 2026):
One small thing I noticed while testing the staging implementation:
When the ChatGPT / Codex Image connection has
gpt-image-2explicitly set as the model, Transparent sprite background takes Marinara's chroma-key fallback path instead of requesting native transparency.Interestingly, leaving the model field blank avoids that behavior and native transparency works correctly. Image generation still succeeds, since the ChatGPT/Codex image path falls back to its default model internally.
I also tested arbitrary model strings such as
chatgpt-image-latest, and the image request still succeeds, so the model field does not appear to control the actual backend model in the way a normal provider model selector would.This may be related to the behavior reported on the Codex side here:
https://github.com/openai/codex/issues/28723
That issue reports the OAuth-backed Codex image path normalizing explicit image settings to
gpt-image-2-codex/auto.So this doesn't seem urgent from a usability standpoint — leaving the model field blank appears to be a simple workaround — but I wanted to document the behavior I found while testing staging.
@SpicyMarinara commented on GitHub (Oct 4, 2026):
Native transparent sprite background is a hoax, I have no idea why they claim to support it when all the images returned that way don't actually have transparent backgrounds. That's why we're generating them on bright backgrounds that our cleanup automatically removes later on.