fix(cli): price GPT Image 2.6 and every GPT Image reference picture (#7307)

* fix(cli): price GPT Image 2.6 and every GPT Image reference picture

The media-use image estimate priced every non-default model as GPT Image 2.5 and
charged references at $0.0082 after the first. fal bills every reference picture,
the first one too, at about $0.0125, and the price book now does the same. GPT
Image 2.6 and 2.6-flare take 2.5's prices; nano-banana-2.1 gets its own; any
other model is not priced ahead instead of guessed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(cli): drop the new pricing comments to keep the comment share flat

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
James Russo
2026-11-06 21:59:59 +00:00
committed by GitHub
co-authored by Claude Opus 5.5
parent d2b170ce58
commit ab50e9c148
5 changed files with 52 additions and 16 deletions
@@ -127,7 +127,11 @@ export default defineCommand({
type: "string",
description: "Aspect ratio, e.g. 9:16 (image, video without a first frame, avatar)",
},
model: { type: "string", description: "image: nano-banana-2 (default) or gpt-image-2.5" },
model: {
type: "string",
description:
"image: nano-banana-2 (default), nano-banana-2.1, gpt-image-2.5, gpt-image-2.6 or gpt-image-2.6-flare",
},
bpm: { type: "string", description: "music: tempo, 60–180" },
vocals: {
type: "boolean",
+22 -1
View File
@@ -764,11 +764,32 @@ describe("generate", () => {
aspect: "1:1",
references: ["a", "b"],
}).usd,
).toBe(0.07);
).toBe(0.09);
expect(priceOf({ type: "voice", out: "a.mp3" }).usd).toBeNull();
expect(creditsOf(priceOf({ type: "voice", out: "a.mp3", script: "今天聊黄金" }))).toBe(1);
});
it("prices every reference picture of a GPT Image edit, on each GPT Image model", () => {
const edit = (model: string, references: string[]) =>
creditsOf(priceOf({ type: "image", out: "a.png", model, aspect: "16:9", references }));
for (const model of ["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]) {
expect(edit(model, [])).toBe(40);
expect(edit(model, ["a"])).toBe(53);
expect(
edit(
model,
Array.from({ length: 16 }, (_, i) => `r${i}`),
),
).toBe(240);
}
expect(
creditsOf(
priceOf({ type: "image", out: "a.png", model: "nano-banana-2.1", references: ["a", "b"] }),
),
).toBe(37);
expect(priceOf({ type: "image", out: "a.png", model: "some-new-model" }).credits).toBeNull();
});
it("prices only a request the real call would accept", () => {
// --plan runs the same checks as the real call, so it never prices a request the call would refuse.
const [plate, voice] = [join(project, "plate.png"), join(project, "voice.m4a")];
+15 -4
View File
@@ -30,7 +30,11 @@ const GPT_IMAGE: Record<string, number> = {
"4:3": 0.03612,
"3:4": 0.03612,
};
const GPT_REFERENCE = 0.0125;
const GPT_MODELS = new Set(["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]);
const NANO_IMAGE = 0.067;
const NANO_2_1_IMAGE = 0.0336;
const NANO_2_1_REFERENCE = 0.00168;
const VIDEO_768P_PER_S = 0.018;
// A reference shot (pictures, voice or guide clip) bills more, and its guide clip's seconds bill too: measured
// 2026-10-23 from the wallet, 5 s with a picture $0.25, 10 s $0.50, 5 s with a 1 s guide $0.30, with a 3 s guide $0.40.
@@ -57,12 +61,19 @@ export function priceOf(r: GenerateRequest): Price {
switch (r.type) {
case "image": {
const refs = r.references?.length ?? 0;
if ((r.model ?? "nano-banana-2") === "nano-banana-2")
return at(NANO_IMAGE, "nano-banana-2, $0.067 an image");
const model = r.model ?? "nano-banana-2";
if (model === "nano-banana-2") return at(NANO_IMAGE, "nano-banana-2, $0.067 an image");
if (model === "nano-banana-2.1")
return at(
NANO_2_1_IMAGE + refs * NANO_2_1_REFERENCE,
"nano-banana-2.1, $0.0336 an image and $0.00168 a reference",
);
if (!GPT_MODELS.has(model))
return { usd: null, list: null, credits: null, basis: `${model}, not priced ahead` };
const each = GPT_IMAGE[r.aspect ?? "16:9"] ?? GPT_IMAGE["16:9"]!;
return at(
each + Math.max(0, refs - 1) * 0.0082,
`gpt-image-2.5 at ${r.aspect ?? "16:9"}, $0.0082 a reference after the first`,
each + refs * GPT_REFERENCE,
`${model} at ${r.aspect ?? "16:9"}, about $0.0125 a reference`,
);
}
case "video": {
+1 -1
View File
@@ -18,7 +18,7 @@
"files": 13
},
"media-use": {
"hash": "f3e4cc75041371b3",
"hash": "44ef2d115fa8bebd",
"files": 118
},
"remotion-to-hyperframes": {
+9 -9
View File
@@ -46,15 +46,15 @@ npx hyperframes media-use generate --type music --prompt "warm lo-fi, soft keys"
The file lands at `--out` and the media ledger records it as generated, with the route, model, job, prompt and the files it was made from. Pictures and shots carry no text or logos: ask for clean plates and draw words in HyperFrames.
| Type | Model | Price |
| ------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image | nano-banana-2 (default), or gpt-image-2.5 with `--model` | $0.067 an image; gpt-image-2.5 $0.036–0.053 by aspect, plus $0.0082 a reference after the first |
| video | heygen-video-1, 768p | $0.02 a second from a prompt or first frame; $0.05 a second with a reference picture, voice or guide clip, and the guide's seconds count too (1080p costs about twice) |
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
| avatar | talking photo | $4.83 a minute of speech |
| cutout | HeyGen background removal | not priced ahead |
| music | lyria-3-pro | $0.08 a track |
| voice | the voice's engine | charged per character, not priced ahead |
| Type | Model | Price |
| ------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image | nano-banana-2 (default), or nano-banana-2.1, gpt-image-2.5, gpt-image-2.6 or gpt-image-2.6-flare with `--model` | $0.067 an image; nano-banana-2.1 $0.034 plus $0.0017 a reference; gpt-image $0.036–0.053 by aspect, plus about $0.0125 for every reference |
| video | heygen-video-1, 768p | $0.02 a second from a prompt or first frame; $0.05 a second with a reference picture, voice or guide clip, and the guide's seconds count too (1080p costs about twice) |
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
| avatar | talking photo | $4.83 a minute of speech |
| cutout | HeyGen background removal | not priced ahead |
| music | lyria-3-pro | $0.08 a track |
| voice | the voice's engine | charged per character, not priced ahead |
`--plan`'s `usd` is what an API key is charged (HeyGen rounds up to units of $1/60); its `credits` is what a HyperFrames plan charges, on the plan's own rates: a video shot's seconds and guide seconds, plus each picture past the first two. Without `--voice`, generate lists voice ids to pick from on the sign-in alone; a cloned voice from `heygen voice clone create` (`operations.md`).