diff --git a/packages/cli/src/commands/media-use/generate.ts b/packages/cli/src/commands/media-use/generate.ts index 1bb19cfc50..02223bc962 100644 --- a/packages/cli/src/commands/media-use/generate.ts +++ b/packages/cli/src/commands/media-use/generate.ts @@ -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", diff --git a/packages/cli/src/heygen/generate.test.ts b/packages/cli/src/heygen/generate.test.ts index 57fe4a573c..4ae54677c1 100644 --- a/packages/cli/src/heygen/generate.test.ts +++ b/packages/cli/src/heygen/generate.test.ts @@ -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")]; diff --git a/packages/cli/src/heygen/pricing.ts b/packages/cli/src/heygen/pricing.ts index ee08f7502b..af95ad08aa 100644 --- a/packages/cli/src/heygen/pricing.ts +++ b/packages/cli/src/heygen/pricing.ts @@ -30,7 +30,11 @@ const GPT_IMAGE: Record = { "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": { diff --git a/skills-manifest.json b/skills-manifest.json index b4d7f4da27..031864454a 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -18,7 +18,7 @@ "files": 13 }, "media-use": { - "hash": "f3e4cc75041371b3", + "hash": "44ef2d115fa8bebd", "files": 118 }, "remotion-to-hyperframes": { diff --git a/skills/media-use/references/heygen.md b/skills/media-use/references/heygen.md index 036840617b..53f00e83bb 100644 --- a/skills/media-use/references/heygen.md +++ b/skills/media-use/references/heygen.md @@ -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`).