Gpt Image Api logo

Gpt Image Api

Community
wilhelminavoss
gpt-image-api

Call the GPT Image 2 and GPT Image 2.5 (Flare, Sunburst) Images API correctly - /v1/images/generations and /v1/images/edits, pixel sizes and billing tiers, n, quality, url vs b64_json, JSON vs multipart references (up to 16), masks, timeouts, cost and error handling, with the OpenAI SDKs pointed at a compatible base URL. Use when writing, reviewing or debugging code that generates or edits images with gpt-image-2, gpt-image-2.5-flare or gpt-image-2.5-sunburst.

Overview

Publisherwilhelminavoss
Repositorygpt-image-2-image-capabilities
Skill namegpt-image-api
Stars
36
Forks
0
Bundled files
1
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.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Gpt Image Api 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/wilhelminavoss/gpt-image-2-image-capabilities/tree/main/skills/gpt-image-api
  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/wilhelminavoss/gpt-image-2-image-capabilities.git /tmp/gpt-image-2-image-capabilities
mkdir -p .claude/skills
cp -r /tmp/gpt-image-2-image-capabilities/skills/gpt-image-api .claude/skills/gpt-image-api
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gpt Image Api 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 Gpt Image Api 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 Gpt Image Api 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.

GPT Image 2 / 2.5 API

These facts describe the OpenAI-compatible Images surface at https://argolink.io/v1 (checked 2026-10-07). Other compatible endpoints are similar but can differ in sizes, quality values and price; check theirs.

Endpoints

CallBodyUse
POST /v1/images/generationsJSONtext to image
POST /v1/images/editsJSON with images: [{"image_url": …}], or multipart with repeated image[] filesimage to image, reference edits, masked edits

Auth: Authorization: Bearer <key>. Both calls return only when every image is finished: set the client timeout to 600 seconds or more and do not retry on a short timeout, or you may pay twice.

Fields

FieldValuesNotes
modelgpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburstsame fields for all three
prompttextrequired; also state the aspect ratio in words
sizeWIDTHxHEIGHT, e.g. 1024x1024, 2048x1152, 3840x2160pixels only: never 1K, 4K or 16:9; there is no aspect_ratio field
qualityauto, low, medium, highthe values documented on this endpoint
n1–7each returned image is billed; use the length of data as the real count
response_formaturl or b64_jsonURLs are temporary: download them right away
images / image[]1–16 referencesJSON links (HTTPS or data URLs) or multipart files; one format per request
maskmask.image_url in JSON, a mask file in multipartapplies to the first reference

Recommended sizes (python scripts/gptimage.py sizes): 1:1 1024x1024 / 1440x1440 / 2160x2160; 16:9 1024x576 / 2048x1152 / 3840x2160; 9:16 576x1024 / 1152x2048 / 2160x3840; 3:4, 4:3, 2:3, 3:2, 21:9 and 5:2 also have a row. The returned image can differ from the requested pixels; check it when exact size matters.

Billing

Per returned image, by the returned image's longest edge: up to 1024 px is 1K ($0.015), 1025–2048 is 2K ($0.015), above 2048 is 4K ($0.02). Quality does not change the price here. 2560x1440 is a valid request but bills as 4K. python scripts/gptimage.py cost --size 3840x2160 -n 3 prints the arithmetic.

SDK usage

Pass the key and base URL explicitly so an OPENAI_API_KEY meant for OpenAI is never sent to another host.

python
import base64, os
from openai import OpenAI

client = OpenAI(api_key=os.environ["GPT_IMAGE_API_KEY"], base_url="https://argolink.io/v1", timeout=600)
result = client.images.generate(model="gpt-image-2", prompt="A lighthouse at dusk, 16:9 composition",
                                size="2048x1152", quality="high", n=1, response_format="b64_json")
open("lighthouse.png", "wb").write(base64.b64decode(result.data[0].b64_json))

with open("room.png", "rb") as room, open("sofa.png", "rb") as sofa:
    edited = client.images.edit(model="gpt-image-2.5-sunburst", image=[room, sofa],   # sent as image[] parts
                                prompt="Put the sofa from the second image into the room in the first image",
                                size="1728x1152", response_format="b64_json")
ts
import OpenAI, { toFile } from "openai";
import { readFile } from "node:fs/promises";

const client = new OpenAI({ apiKey: process.env.GPT_IMAGE_API_KEY, baseURL: "https://argolink.io/v1", timeout: 600_000 });
const result = await client.images.generate({ model: "gpt-image-2", prompt: "A lighthouse at dusk, 16:9 composition",
  size: "2048x1152", quality: "high", response_format: "b64_json" });
const edit = await client.images.edit({ model: "gpt-image-2", prompt: "Make it winter",
  image: [await toFile(await readFile("lighthouse.png"), "lighthouse.png", { type: "image/png" })] });

If your TypeScript version of the SDK types size as a fixed list, add // @ts-expect-error on that line: the SDK sends extra values unchanged.

Errors and what to do

SymptomLikely causeAction
401missing or wrong keyfix the key; don't retry
Rejected, message names size1K, 16:9 or a malformed valuesend pixels from the table
Rejected, message names the imagesmore than 16, or JSON and multipart mixedsplit or pick one format
429, or 503 with Retry-Afterrate limit or no free capacitywait as told, then retry
Client timeoutthe image was still renderingraise the timeout to 600 s; don't blindly resend
Square result for a wide requestratio missing from the promptadd "16:9 composition" to the prompt
data shorter than nfewer images returnedbill and handle what came back

Script

scripts/gptimage.py wraps the SDK: generate, edit (--image up to 16 times, --mask), sizes and cost. Run it with GPT_IMAGE_API_KEY set; GPT_IMAGE_BASE_URL points it at another compatible endpoint.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Gpt Image Api AI skill do?

Call the GPT Image 2 and GPT Image 2.5 (Flare, Sunburst) Images API correctly - /v1/images/generations and /v1/images/edits, pixel sizes and billing tiers, n, quality, url vs b64_json, JSON vs multipart references (up to 16), masks, timeouts, cost and error handling, with the OpenAI SDKs pointed at a compatible base URL. Use when writing, reviewing or debugging code that generates or edits images with gpt-image-2, gpt-image-2.5-flare or gpt-image-2.5-sunburst.

Why use Gpt Image Api on TypingMind?

Because you install it once and use it with any model. Gpt Image Api 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 Gpt Image Api in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wilhelminavoss/gpt-image-2-image-capabilities/tree/main/skills/gpt-image-api. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Gpt Image Api?

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 Gpt Image Api?

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

Is the Gpt Image Api AI skill free?

Yes. It is published on GitHub by wilhelminavoss 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 👇