HeyPuter/puter · error · HttpError

unauthorized

unauthorized

Error message

Authentication required

What it means

Error "Authentication required" thrown in HeyPuter/puter.

Source

Thrown at src/backend/drivers/ai-video/creditCap.ts:68

 * cost as slop above the budget. This is the video analogue of the `max_tokens`
 * clamp in `ChatCompletionDriver`: shorten the output to fit the wallet, and
 * only reject outright when even the shortest supported clip is unaffordable.
 *
 * Returns the duration the caller must actually request upstream — callers MUST
 * use the returned value both for the upstream call and for metering, or the
 * cap buys nothing.
 */
export async function capSecondsToRemainingCredits({
    metering,
    actor,
    perSecondMicroCents,
    requestedSeconds,
    allowedSeconds,
    minSeconds,
    modelId,
}: ICapSecondsParams): Promise<number> {
    if (!actor) {
        throw new HttpError(401, 'Authentication required', {
            legacyCode: 'unauthorized',
        });
    }

    // Unpriced or free output — nothing to clamp against.
    if (!Number.isFinite(perSecondMicroCents) || perSecondMicroCents <= 0) {
        return requestedSeconds;
    }

    const remaining = await metering.getRemainingUsage(actor);
    const affordableSeconds = Math.floor(remaining / perSecondMicroCents);

    const ladder = (allowedSeconds ?? [])
        .filter((s) => Number.isFinite(s) && s > 0)
        .sort((a, b) => a - b);

    const usd = (microCents: number) => (microCents / 1e8).toFixed(2);
    const insufficient = (shortest: number) =>

View on GitHub (pinned to 908ec23eda)

Solutions

  1. Authenticate the request with a valid user or app token.
  2. Ensure the caller is signed in before invoking the video generation driver.

When it happens

Trigger: Thrown at src/backend/drivers/ai-video/creditCap.ts:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of HeyPuter/puter@908ec23eda (2026-08-12). Data as JSON: /api/errors/40564de172562886. Report an issue: GitHub.