Files
puter/src/backend/services
Daniel Salazar 5d2eaeb981 fix: billing holds that follow what AI calls cost, reserved godmode hosts, contained upload paths (#4671)
* fix(replicate): send input images as the bytes measured for billing

Each input image is fetched once, measured, and passed to Replicate as those bytes, which the client uploads to Replicate's file store. An input that can't be read as an image is refused with 400 instead of being billed as one megapixel.

* fix(ocr): hold the page limit for a PDF whose pages can't be counted

When the balance can't cover the page limit, the call holds the size-based estimate and asks Mistral for only that many leading pages. A pages selection still holds only the selected pages.

* fix(tts): bill gpt-4o-mini-tts by the tokens OpenAI reports

The model is streamed as server-sent events, decoded back into the audio stream callers get, and charged the input and audio tokens from the final event. The per-character rate on the text and instructions is the hold, and is charged when no usage arrives.

* fix(realtime): response holds include the conversation so far

Each response holds the fixed budget plus every token the previous response read and wrote, priced as uncached audio input. An unreported response is billed the same amount.

* fix(apps): reserve godmode app hosts and the puter.* launch params

apps.create and apps.update refuse an index_url on the host of a godmode app. The desktop drops puter.* params already in an index_url before adding its own. Dev Center inserts the payout email as text.

* fix(puter-js): fs.upload refuses paths outside the destination folder

A file or folder whose path resolves outside the destination, such as through .. segments, rejects the upload with invalid_upload_path before anything is written.

* docs: changelog and quota entries for the billing and upload changes

* fix(tts): skip a [DONE] line in the speech event stream

Also adds a gpt-4o-mini-tts integration case that checks the streamed audio and the billed tokens.

* fix(ocr): a document whose pages can't be counted reads only what the balance covers

Counted PDFs hold their page count. Anything else that can't be counted, such as a DOCX or an encrypted PDF, holds the provider's page limit, or as many leading pages as the balance covers, and Mistral is asked for only those pages. Drops the size-based page guess. The changelog keeps only the developer-facing upload error.
2026-11-17 15:46:17 -07:00
..
2026-11-02 23:48:35 -07:00
2026-11-02 23:48:35 -07:00