Gpt Image Api 标志

Gpt Image Api

社区
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.

概览

发布者wilhelminavoss
代码仓库gpt-image-2-image-capabilities
技能名称gpt-image-api
星标数
36
复刻数
0
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 wilhelminavoss 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Gpt Image Api AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/wilhelminavoss/gpt-image-2-image-capabilities/tree/main/skills/gpt-image-api
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Gpt Image Api,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Gpt Image Api。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Gpt Image Api 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Gpt Image Api AI 技能有什么作用?

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.

为什么在 TypingMind 中使用 Gpt Image Api?

因为您只需安装一次,就能搭配任何模型使用。Gpt Image Api 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Gpt Image Api?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/wilhelminavoss/gpt-image-2-image-capabilities/tree/main/skills/gpt-image-api。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Gpt Image Api?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Gpt Image Api 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Gpt Image Api 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Gpt Image Api AI 技能免费吗?

是的。wilhelminavoss 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇