Skip to main content
Glama

GPT Image Studio

English · 中文 · 日本語 · 한국어 · Русский

A workbench for OpenAI's gpt-image-2.5 using your own API key. Ask your AI agent for an image in a single sentence, then watch it appear in a local web gallery with its cost and your remaining balance.

GPT Image Studio — gallery

Ask your agent, watch it appear:

An AI agent generating an image while the web gallery shows it live

Features

  • Generate from any AI agent. Ask Claude Code, Codex or another agent that can run commands for "a 2K 16:9 image of …". It calls the official API, saves the file locally and tells you what the image cost.

  • Live web gallery. While an agent is generating, a "generating…" card with a timer appears on the page, and the result replaces it when it's ready. You can also generate directly from the page.

  • All the parameters. gpt-image-2.5 sunburst / flare; 1K / 2K / 4K at any aspect ratio, up to 3840×2160; quality from low to xhigh / max; up to 16 reference images; mask inpainting.

  • Cost tracking. The studio calculates each image's cost from its token usage and shows daily, monthly and lifetime totals. It subtracts subsequent spending from the last balance you synced or entered.

  • Gallery tools. Favorites, filters by status (completed / generating / failed), search, one-click reuse of settings, and "use as reference" to keep iterating on a result. Deleted items go to a .trash folder instead of being erased.

  • Use it anywhere. The same page can be hosted on GitHub Pages. On a computer that runs the local service it connects to that service automatically; anywhere else it runs in browser mode, where your key and images stay in that browser.

  • Sync your OpenAI balance. Tell your AI “sync my balance” (or “同步余额”). For periodic updates, you can also use the optional browser extension.

  • 5 languages. English, 中文, 日本語, 한국어 and Русский. The language follows your browser and can be switched in the page.

  • Relay services supported. Works with OpenAI-compatible relays (one-api, new-api …), including image-URL responses, per-image pricing and reading the relay's real balance. See Relay services.

  • Zero dependencies. You only need Python 3.9 or later. Nothing to pip install.

Local outfit and pose libraries

Open Outfits & poses below the prompt box in the local studio. For first-time setup, see Download the libraries.

1. Pick an outfit. Filter for short summer dresses and select SUM-0039 to see the coral dress, woven bag and sandals together. Click Add as reference.

Summer dress grid with the coral outfit SUM-0039 selected and its accessories visible in the preview

2. Try a different camera angle. These three previews show the same raised-leg pose, P024, from the front, from the side and from above. Add the high-angle view as image 2.

Three captures of pose P024 with the front, side and high-angle buttons selected in turn

3. Tell the AI how to use each image. The composer numbers references as you add them. Here image 1 supplies the outfit and image 2 supplies the pose and camera angle for a 9:16 street-style photo.

Two numbered references in the composer with a prompt combining the coral dress and the high-angle pose

The outfit and pose artwork in these screenshots is credited to @giaaibusi.

Download the libraries

New in v0.5.0. The first time you open the local workbench, a banner offers 1,407 outfits and 288 pose groups with 1,439 angle images. After the download choice has been visible for 20 seconds, the studio starts fetching the missing libraries from their upstream GitHub repositories. Both together take about 820 MB to download. Allow 1.7 GB of free space during setup.

  • Choose Skip download to save that choice, or Stop download while it runs. To install later, open Outfits & poses → Download now. Retry keeps completed libraries and fetches the unfinished library again.

  • The default folder is ~/Pictures/gpt-image-libraries. Set GPT_IMAGE_LIBRARY_DIR before startup to choose another drive, or GPT_IMAGE_AUTO_DOWNLOAD=0 to skip automatic downloads in advance. A standalone GitHub Pages session uses browser mode. To install libraries, launch the local service.

  • In the composer, choose an outfit, or a pose and camera angle, then Add as reference. References are numbered in attachment order, including your own uploads. Browsing uses local files. Generating sends the selected originals to your configured image API.

  • Already have classified files? Create reference-libraries.local.json next to config.json, with outfits.root and/or poses.root. Configured libraries take precedence. Outfits use category/subcategory/ID.webp. Poses use type/category/pose group/angle_ID.png. The optional thumbnails folder mirrors those paths using WebP for outfits and JPG for poses. Configuration example.

Each download comes from a pinned upstream revision, is checked before installation and keeps its source license. The studio's MIT license covers the studio code. The outfit source sets separate terms for repackaging the images. The pose source designates its images and original data for non-commercial use only and credits @giaaibusi. Outfit source and asset terms · Pose source and terms.

Related MCP server: mcp-server-openai-image-generator

Install

git clone https://github.com/konglingbukong/gpt-image-studio ~/.claude/skills/gpt-image
  1. Run start.bat (Windows) or sh start.sh (macOS / Linux). Your browser opens http://127.0.0.1:8765.

  2. Go to Settings → API, enter your OpenAI API key, and click "Test connection" (free).

  3. Ask Claude Code for an image.

You can also provide the key through the OPENAI_API_KEY environment variable, or in config.json (see config.example.json; config.json is git-ignored).

Just the web page (nothing to install)

Open https://konglingbukong.github.io/gpt-image-studio/ and enter your key in Settings. The page runs in browser mode: your key and images stay in your browser, and the browser talks to OpenAI directly with no third-party server in between.

Other agents (Codex, Cursor, Gemini, Antigravity, WorkBuddy …)

Pick whichever of these your agent supports:

① MCP (supported by most agents). Register scripts/mcp_server.py to enable generate_image, check_connection, get_spending and sync_balance. Replace <path> with the folder you cloned:

  • Claude Code: claude mcp add gpt-image -- python <path>/scripts/mcp_server.py

  • Codex (~/.codex/config.toml):

    [mcp_servers.gpt-image]
    command = "python"
    args = ["<path>/scripts/mcp_server.py"]
  • Cursor / Gemini CLI / other JSON-configured clients (mcpServers):

    { "mcpServers": { "gpt-image": { "command": "python", "args": ["<path>/scripts/mcp_server.py"] } } }

Try it. Set your OpenAI project key in the studio and sign in to the API dashboard in a browser your AI can access, such as Edge or Chrome. Tell the AI “sync my balance”. It reads API credit balance for the selected organization, verifies the organization against your key and reports the USD amount and time. If your browser asks for permission or sign-in, complete that prompt in the browser. Open the official billing page.

The sync runs when you ask. It works with the local workbench closed and appears the next time you open it. Between syncs, the workbench subtracts spending from the last recorded amount. Use an MCP client with access to your signed-in browser for this workflow. After updating an existing installation, reconnect the MCP server once to load the new tool.

② Skill folder. Agents that support the SKILL.md format (Codex, WorkBuddy …) can use this folder as a skill: drop it into their skills directory.

③ Instructions file. Any other agent that can run shell commands can follow AGENTS.md.

Whichever route you choose, images land in the same folder and show up live in the web workbench.

Verified: Claude Code, Codex (including the ChatGPT desktop app), WorkBuddy, Antigravity and DeepSeek Harness (dsh). The full list, per-agent setup notes, interface contracts and the steps for adding a new agent are in docs/INTEGRATIONS.md. If your agent isn't supported yet, open an "Integration request" issue, or wire it up yourself following CONTRIBUTING.md and send a PR.

Relay services (OpenAI-compatible proxies)

Many people reach gpt-image through a relay / proxy service instead of OpenAI directly (one-api, new-api and similar). These work too:

  • Setup: put the relay's address in Settings → API → API URL (usually ending in /v1) and the relay's key in API Key. If the relay names the model differently (e.g. gpt-image-2.5), type that name in the model menu.

  • Image URLs: relays that return an image link instead of base64 data are handled; the image is downloaded and saved like any other.

  • Strict relays: if a relay rejects official-only parameters (moderation, output_format, background), turn on Send basic parameters only. The error message suggests this when it happens.

  • Per-image pricing: most relays bill per image. Set Pricing → Per-image price and costs are calculated from it instead of tokens.

  • Real balance: if the relay supports the one-api / new-api billing endpoints, the actual remaining credit is read from the relay automatically, with no calibration needed.

  • Connection test: works with relays that only implement GET /models.

Command-line equivalents in config.json: "api_url", "api_key", "model", "minimal_params": true, "rates": {"per_image": 0.04}, "balance_source": "auto" | "relay" | "manual".

Command line

python scripts/gen.py --prompt-file prompt.txt --size "2K 16:9" --quality high --name cover
python scripts/gen.py --prompt "an orange cat" --size 1024x1024 --quality low
python scripts/gen.py --prompt-file p.txt --ref face.png --ref outfit.png --size "4K 9:16"
python scripts/gen.py --check          # test key + network, free
python scripts/gen.py ... --json       # one JSON line, for scripts and integrations

All parameters are documented in SKILL.md. Command-line messages are in English by default; set "lang": "zh" in config.json for Chinese.

Personal preferences

Create rules.local.md in the skill folder and write down your own preferences, such as default specs and prompt habits. Agents read it before generating. It is git-ignored.

Security

  • The local service listens on 127.0.0.1 only and checks both Host and Origin. It accepts requests only from the local page and from the sites listed in allowed_origins in config.json, so other web pages can't use it to spend your money.

  • Your key is only ever sent to the API URL you configure (OpenAI by default).

Pricing note

Costs are calculated from the rates in config.json, in USD per 1M tokens. The defaults are gpt-image-2.5 prices at the time of writing: text input 5, image input 8, image output 30. If OpenAI changes its prices, update them under Settings → Pricing. The balance shown is an estimate; your OpenAI dashboard is the source of truth.

Credits

The UI layout is inspired by CookSleep/gpt_image_playground (MIT). The code was written independently.

License

The studio code is licensed under MIT. Downloaded images retain their upstream asset terms.

Available Tools

4 tools
check_connectionA

Check that the API key and network work (free).

NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden. It discloses one useful trait (free, i.e. no cost/credit consumed) and that it exercises both auth and network paths, but says nothing about failure modes, latency, or what a result looks like.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no waste. It is efficient, though the terseness comes partly at the expense of the behavioral detail noted above.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No annotations and no output schema, so the description must explain the result of the check; it does not. An agent knows what the tool tests and that it is free, but not what success or failure looks like on return.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so per the rubric the baseline is 4. Nothing is missing because there is nothing to describe.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb-plus-resource: checks that the API key and network work. An agent can immediately tell this is a connectivity/auth smoke test. No sibling differentiation is offered, but the siblings (generate_image, get_spending) are far enough away that confusion is unlikely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The parenthetical '(free)' implies a use case — validate before invoking paid tools — but the description never states when to call this versus proceeding directly to generate_image or get_spending. Usage is implied rather than specified.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageA

Generate an image with OpenAI gpt-image-2.5 using the user's own API key; saves it locally and returns the file paths and cost. Without a requested spec use 2K 16:9 + high (about $0.06). 4K, xhigh, max or several images cost more — tell the user the rough cost first. Always tell the user what each run cost.

NameRequiredDescriptionDefault
nNonumber of images
maskNoabsolute path of a mask PNG (transparent = repaint); requires reference images
nameNoshort file name prefiximg
sizeNoe.g. "2K 16:9", "4K 9:16", "1K 1:1", "2560x1440" or "auto"2K 16:9
modelNogpt-image-2.5-sunburst
promptYesprompt (positive description of the image)
qualityNohigh
moderationNoauto
reference_imagesNoabsolute local paths of reference images, up to 16

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the API-key requirement, local persistence, the returned values (file paths and cost), and a cost-scalation warning for 4K/xhigh/max/multi-image runs. It leaves out failure behavior, rate limits, and moderation effects, keeping it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with the capability and output first, the default second, and the cost-disclosure obligation last. Every sentence carries information the agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter generation tool with no output schema, the description covers the essentials: what is produced, where it goes, what it costs, and the default spec. Gaps remain around mask/reference-image prerequisites and model selection, which an agent would have to infer from the schema alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, and the description adds meaning only for size and quality by naming the default combo and which settings raise cost. Mask, reference_images, name, model enum, and n receive nothing beyond the schema, so the description is additive but partial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (generate), resource (image), backing model (gpt-image-2.5), auth model (user's own API key), and side effects (saves locally, returns paths and cost). This is clearly distinguishable from the sibling tools check_connection and get_spending.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete default (2K 16:9 + high, ~$0.06) when no spec is requested and instructs the agent to quote cost before doing anything expensive. It does not discuss alternatives or when-not-to-call, but the siblings are unrelated utilities, so the practical guidance is nearly complete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_spendingA

Get spending today / this month / total and the estimated remaining balance.

NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does disclose the returned data (today/month/total spending and an estimated remaining balance), which implies a read-only operation, but it says nothing about freshness of data, currency, or whether the balance figure is an estimate derived from a budget — none of which is knowable elsewhere.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence with zero waste; the primary action and the returned figures are front-loaded. Nothing could be removed without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no parameters, no output schema, and no annotations, the description is the only source of information — and it does name the values returned. It stops short of clarifying units, currency, or the period boundary semantics, which leaves a small gap for an agent interpreting 'estimated remaining balance'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, and the description correctly indicates that all figures are returned together rather than selected via an argument. Baseline 4 applies for a no-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Get') and resource ('spending') plus the scopes covered (today / this month / total, plus estimated remaining balance). Sibling tools (generate_image, check_connection) are unrelated domains, so differentiation is not needed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this retrieves spending figures, but the description never says when to call it, what preconditions exist, or how the scopes relate (e.g., whether one call returns all three). No alternatives are named, though none of the siblings overlap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sync_balanceA

When the user says '同步余额' or 'sync my balance', start with {}. Follow the returned browser instructions, then call again with all four fields. Report success only when the result says synced.

NameRequiredDescriptionDefault
amount_usdNoUSD value displayed next to API credit balance or Credit balance.
billing_urlNoActual URL of the signed-in billing page you read.
observed_atNoUnix time in seconds at the moment the amount was read (Date.now()/1000).
organization_idNoOrganization ID from General settings for that same organization.

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose valuable behavior: a two-phase flow starting with an empty object, intermediate browser instructions, and a success gate ('report success only when the result says synced'). It does not disclose side effects, permissions, reversibility, or what data is transmitted — significant gaps for what appears to be a state-changing operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the trigger condition and sequenced in execution order. Dense and largely waste-free, though 'start with {}' is terse to the point of being cryptic.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The two-call protocol and success condition are covered, and there is no output schema to explain. But for a 4-parameter, unannotated tool with no safety metadata, the description omits what the sync actually does, what happens on failure, and whether re-invocation is idempotent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so per-field meaning is handled there. The description adds real value beyond the schema by clarifying that the first call takes no arguments and the second requires all four fields — notable because the schema declares zero required parameters, so without this the agent would not know all four are expected.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The verb 'sync' and resource 'balance' are named and the trigger phrases distinguish it from siblings like get_spending, but the description never says what is being synced to where or why. The three sentences describe a call protocol rather than the operation's purpose, leaving the actual effect ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit invocation triggers ('同步余额' or 'sync my balance'), which is stronger than most definitions. However, it never says when NOT to use it or contrasts it with get_spending, which an agent could plausibly pick for a balance-related request.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev0.6.0
    • Addedsync_balance
  2. 3 tool updatesv0.1.0
    • First observedcheck_connection
    • First observedgenerate_image
    • First observedget_spending

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation4/5

generate_image is clearly distinct from the account and cost utilities. check_connection, get_spending, and sync_balance all touch account/cost state, but their descriptions provide enough boundaries; sync_balance and get_spending could still be confused at first glance.

Naming Consistency5/5

All four tools use a consistent snake_case verb_noun pattern: sync_balance, check_connection, generate_image, get_spending. The convention is predictable and easy to scan.

Tool Count5/5

Four tools is well-scoped for a focused image-generation studio: generate, verify connectivity, inspect spending, and sync balance. Each tool has a clear role without unnecessary surface area.

Completeness4/5

The core lifecycle is covered: connection check, image generation, cost reporting, and balance syncing. Minor gaps exist around managing or listing previously generated images, but the returned file paths let agents work around that.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers