Skip to content

Commit ab50e9c

Browse files
jrusso1020claude
andauthored
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) <[email protected]> * chore(cli): drop the new pricing comments to keep the comment share flat Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent d2b170c commit ab50e9c

5 files changed

Lines changed: 52 additions & 16 deletions

File tree

‎packages/cli/src/commands/media-use/generate.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ export default defineCommand({
127127
type: "string",
128128
description: "Aspect ratio, e.g. 9:16 (image, video without a first frame, avatar)",
129129
},
130-
model: { type: "string", description: "image: nano-banana-2 (default) or gpt-image-2.5" },
130+
model: {
131+
type: "string",
132+
description:
133+
"image: nano-banana-2 (default), nano-banana-2.1, gpt-image-2.5, gpt-image-2.6 or gpt-image-2.6-flare",
134+
},
131135
bpm: { type: "string", description: "music: tempo, 60–180" },
132136
vocals: {
133137
type: "boolean",

‎packages/cli/src/heygen/generate.test.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,32 @@ describe("generate", () => {
764764
aspect: "1:1",
765765
references: ["a", "b"],
766766
}).usd,
767-
).toBe(0.07);
767+
).toBe(0.09);
768768
expect(priceOf({ type: "voice", out: "a.mp3" }).usd).toBeNull();
769769
expect(creditsOf(priceOf({ type: "voice", out: "a.mp3", script: "今天聊黄金" }))).toBe(1);
770770
});
771771

772+
it("prices every reference picture of a GPT Image edit, on each GPT Image model", () => {
773+
const edit = (model: string, references: string[]) =>
774+
creditsOf(priceOf({ type: "image", out: "a.png", model, aspect: "16:9", references }));
775+
for (const model of ["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]) {
776+
expect(edit(model, [])).toBe(40);
777+
expect(edit(model, ["a"])).toBe(53);
778+
expect(
779+
edit(
780+
model,
781+
Array.from({ length: 16 }, (_, i) => `r${i}`),
782+
),
783+
).toBe(240);
784+
}
785+
expect(
786+
creditsOf(
787+
priceOf({ type: "image", out: "a.png", model: "nano-banana-2.1", references: ["a", "b"] }),
788+
),
789+
).toBe(37);
790+
expect(priceOf({ type: "image", out: "a.png", model: "some-new-model" }).credits).toBeNull();
791+
});
792+
772793
it("prices only a request the real call would accept", () => {
773794
// --plan runs the same checks as the real call, so it never prices a request the call would refuse.
774795
const [plate, voice] = [join(project, "plate.png"), join(project, "voice.m4a")];

‎packages/cli/src/heygen/pricing.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ const GPT_IMAGE: Record<string, number> = {
3030
"4:3": 0.03612,
3131
"3:4": 0.03612,
3232
};
33+
const GPT_REFERENCE = 0.0125;
34+
const GPT_MODELS = new Set(["gpt-image-2.5", "gpt-image-2.6", "gpt-image-2.6-flare"]);
3335
const NANO_IMAGE = 0.067;
36+
const NANO_2_1_IMAGE = 0.0336;
37+
const NANO_2_1_REFERENCE = 0.00168;
3438
const VIDEO_768P_PER_S = 0.018;
3539
// A reference shot (pictures, voice or guide clip) bills more, and its guide clip's seconds bill too: measured
3640
// 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 {
5761
switch (r.type) {
5862
case "image": {
5963
const refs = r.references?.length ?? 0;
60-
if ((r.model ?? "nano-banana-2") === "nano-banana-2")
61-
return at(NANO_IMAGE, "nano-banana-2, $0.067 an image");
64+
const model = r.model ?? "nano-banana-2";
65+
if (model === "nano-banana-2") return at(NANO_IMAGE, "nano-banana-2, $0.067 an image");
66+
if (model === "nano-banana-2.1")
67+
return at(
68+
NANO_2_1_IMAGE + refs * NANO_2_1_REFERENCE,
69+
"nano-banana-2.1, $0.0336 an image and $0.00168 a reference",
70+
);
71+
if (!GPT_MODELS.has(model))
72+
return { usd: null, list: null, credits: null, basis: `${model}, not priced ahead` };
6273
const each = GPT_IMAGE[r.aspect ?? "16:9"] ?? GPT_IMAGE["16:9"]!;
6374
return at(
64-
each + Math.max(0, refs - 1) * 0.0082,
65-
`gpt-image-2.5 at ${r.aspect ?? "16:9"}, $0.0082 a reference after the first`,
75+
each + refs * GPT_REFERENCE,
76+
`${model} at ${r.aspect ?? "16:9"}, about $0.0125 a reference`,
6677
);
6778
}
6879
case "video": {

‎skills-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"files": 13
1919
},
2020
"media-use": {
21-
"hash": "f3e4cc75041371b3",
21+
"hash": "44ef2d115fa8bebd",
2222
"files": 118
2323
},
2424
"remotion-to-hyperframes": {

‎skills/media-use/references/heygen.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ npx hyperframes media-use generate --type music --prompt "warm lo-fi, soft keys"
4646

4747
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.
4848

49-
| Type | Model | Price |
50-
| ------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51-
| 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 |
52-
| 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) |
53-
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
54-
| avatar | talking photo | $4.83 a minute of speech |
55-
| cutout | HeyGen background removal | not priced ahead |
56-
| music | lyria-3-pro | $0.08 a track |
57-
| voice | the voice's engine | charged per character, not priced ahead |
49+
| Type | Model | Price |
50+
| ------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51+
| 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 |
52+
| 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) |
53+
| lipsync | HeyGen lipsync, speed | 7 credits a second of the video on a plan |
54+
| avatar | talking photo | $4.83 a minute of speech |
55+
| cutout | HeyGen background removal | not priced ahead |
56+
| music | lyria-3-pro | $0.08 a track |
57+
| voice | the voice's engine | charged per character, not priced ahead |
5858

5959
`--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`).
6060

0 commit comments

Comments
 (0)