Files
hyperframes/packages
James RussoandClaude Opus 5.5 0ba8941235 feat(cli): label GPT image prices as estimates and show the charged credits (#7351)
* feat(cli): label GPT image prices as estimates and show the charged credits

GPT Image generations on a HyperFrames plan are moving to fal's reported
vendor cost, so the pre-run figure is an estimate. The --plan basis for
gpt-image-2.5, 2.6 and 2.6-flare now reads "about N credits (charged at
vendor cost)". Nano Banana is unchanged.

When the /v3/images job carries charged.amount, generate reports it as
charged_credits and records it in the media ledger's provenance. Without
it, nothing new is printed. --max-credits is unchanged.

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

* feat(cli): keep 10% headroom under --max-credits for vendor-priced images

gpt-image-2.5, 2.6 and 2.6-flare are charged at the vendor's cost, so
--max-credits now refuses one when its estimate plus 10%, rounded up to a
whole credit, is over the limit. A 16:9 gpt-image-2.5 image (about 40
credits) is refused at --max-credits 40 and passes at 44. Other models keep
the plain estimate check. The refusal and the --max-credits help say so, and
the help notes this is not a hard ceiling.

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

* fix(cli): count only HyperFrames-credit charges, and keep headroom under the run's limit

Review fixes for the vendor-cost image work:
- charged_credits is reported only when the job's charged.pool is
  hyperframes_credits. A charge to api_credits or any other pool is in
  that pool's own unit, so an API-key caller no longer sees it as HF
  credits.
- runJob logs that charged amount, not the estimate, on a job's completion
  row in heygen-jobs.jsonl, so later credit-limit checks see the real total.
  Without a HyperFrames-credit charge the estimate is kept.
- The run's credit limit (.hyperframes/credit-limit.json) uses the same 10%
  headroom rule as --max-credits for gpt-image-2.5, 2.6 and 2.6-flare,
  through one shared limitCheck helper, with the same refusal wording.

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

* docs(media-use): say the credit limit is not a hard ceiling for GPT Image

A GPT Image call is admitted at its estimate plus 10% but charged the
vendor's cost, so it can still go past a run's credit limit. The media-use
skill, its HeyGen reference, the --max-credits help and the limit doc
strings now say so, and that a finished call's reported charge counts
toward the limit afterwards. Other models keep the "refuses what would go
past it" wording. No logic change.

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

* fix(cli): hold a running GPT Image call at its headroom under the project limit

A reserved or still-running vendor-priced call was logged at its plain
estimate, so two concurrent calls could each pass the 10% headroom check
and together go over. Log the headroom amount until HeyGen reports the
charge.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-10 07:41:52 +00:00
..
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00
2026-11-09 18:13:13 -08:00