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ファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    wilhelminavossがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Gpt Image Api」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

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

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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を有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGpt Image Apiを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Gpt Image Apiは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じ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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

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を読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Gpt Image Apiを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Gpt Image Apiで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGpt Image Apiを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Gpt Image Api」は無料ですか?

はい。wilhelminavossがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇