Skip to content

Inline prompt boost, resizable prompt/form, final job price - #21

Merged
dawidope merged 3 commits into
mainfrom
feat/inline-boost-prompt-resize-price
Aug 19, 2026
Merged

Inline prompt boost, resizable prompt/form, final job price#21
dawidope merged 3 commits into
mainfrom
feat/inline-boost-prompt-resize-price

Conversation

@dawidope

Copy link
Copy Markdown
Contributor

Three additions to the request form and the jobs list, plus what the live API actually does with each.

1. Inline prompt boost (enhance_prompt)

A Boost in request checkbox next to the prompt sends enhance_prompt with the generation request, so deAPI boosts the prompt as a pre-step of the job instead of rewriting the field first. The manual Boost button stays for the "rewrite it in the form, let me edit it" flow.

  • Only four endpoints accept the flag (/images/generations, /images/edits, /videos/generations, /videos/animations) — the checkbox appears only there.
  • Multipart sends 1, not "true" — Laravel's boolean rule rejects the string.
  • The choice is remembered per endpoint.
  • The boosted prompt comes back on the job status and opens from the row's ✨ boosted chip: original → boosted, with copy.

2. Prompt field / form sizing

  • The prompt textarea fills the form panel (twice the slack of secondary text fields) and can be dragged to a fixed height, remembered per field, with a reset control. Grabbing the resize corner pins the current height first — flex-grow otherwise overrides whatever the browser's native resize sets, and the drag does nothing.
  • A splitter under the form panel resizes the form against the jobs list (it was capped at 45vh), also persisted.

3. Final price

deAPI reports price {amount, is_estimated} once a request is terminal. It is persisted on the job and merged into the live row, so the badge shows the estimate while the job runs and the charged price after: one figure when they match, estimate struck through next to the final figure when they differ, and a ~ marker while a partner-model charge is still settling.

Billing: measured, not assumed

The /price endpoints do not accept enhance_prompt, so the boost fee is quoted separately at POST /prompts/enhancements/price (multipart, top-level {price}). The open question was whether that fee lands inside the job's price. Measured on the live API — balance before/after each request, with no-boost controls and repeats to beat background traffic on the account:

case job price balance delta boost quote residual
img, no boost (×2) 0.00190931 0.001909 −3.1e−07
img, boost, 3-char prompt 0.00190931 0.002335 0.000426 0.00042569
vid, boost, 33-char prompt 0.00245681 0.002888 0.000431 0.00043119
img, boost, 912-char prompt (min of 3) 0.00190931 0.002481 0.0005725 0.00057169
  • price.amount equals the /price quote exactly, in every run, boosted or not — it covers the inference only.
  • The boost is charged on top of it, and the amount charged equals what we quote (differences are within the ±1e−06 resolution of the 6-decimal balance).
  • The fee scales with prompt length and does not depend on how long the boosted output is.

So the estimate compared against the final price is the base quote, and the boost is reported next to it as +$X rather than folded in — folding it in would show a phantom difference on every boosted job. Dev/sandbox environments quote the boost at 0, and there the badge is hidden.

Not covered

Partner models (is_estimated: true, where the charge settles after inference — the UI marks those with ~), refund behaviour when a job fails after a successful boost, and the 422 path for a model with no booster guide.

🤖 Generated with Claude Code

dawidope and others added 3 commits August 19, 2026 14:57
Three additions to the request form and job list:

1. Inline prompt boost — a "Boost in request" checkbox next to the prompt
   sends `enhance_prompt` with the generation request, so deAPI boosts the
   prompt as a pre-step of the job instead of rewriting the field first (the
   manual Boost button stays). Only /images/generations, /images/edits,
   /videos/generations and /videos/animations accept the flag; the choice is
   remembered per endpoint. The boost is billed separately from the inference
   (the job's own `price` covers inference only), and the /price endpoints do
   not accept the flag — so the proxy strips it from every price payload and
   quotes the fee via /prompts/enhancements/price, reporting it alongside the
   estimate rather than inside it. The boosted prompt comes back on the job
   status and is shown in a new self-hiding PROMPT BOOST panel (original →
   boosted, with copy).

2. Prompt field sizing — the prompt textarea fills the form panel (twice the
   slack of secondary text fields) and can be dragged to a fixed height that is
   remembered per field, with a reset control. A splitter under the form panel
   resizes the whole form against the jobs list, also persisted.

3. Final price — deAPI reports `price` {amount, is_estimated} once a request is
   terminal. It is persisted on the job and merged into the live row, so the
   badge shows the estimate while the job runs and the charged price after: one
   figure when they match, estimate struck through next to the final figure when
   they differ, and a `~` marker while a partner-model charge is still settling.

Verified against the live API: enhance_prompt accepted end-to-end,
prompt_boosted/prompt_boost/price returned, boost quoted at /prompts/
enhancements/price and charged outside the job price.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Measured against the live API: the dev/sandbox environments quote the prompt
boost at 0, so the "+$0" badge and "+ boost $0" note carried no information.
Only report the fee when there is one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The job info column wrapped to three lines once a price, a boost fee and the
boosted chip sat next to the full request id. Now line one carries the endpoint,
the prices and the boosted chip on a single nowrap row, and the request id drops
to line two in front of the prompt preview (click it to copy). The status column
gets left padding — it had room to spare.

The prompt-boost panel no longer sits under every boosted job: the "boosted"
chip toggles it, so it costs no vertical space until asked for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dawidope
dawidope requested a review from szwagros August 19, 2026 13:43
@dawidope
dawidope merged commit 130bdad into main Aug 19, 2026
2 checks passed
@dawidope
dawidope deleted the feat/inline-boost-prompt-resize-price branch August 19, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants