HeyPuter/puter · error · HttpError

bad_request

bad_request

Error message

Text exceeds maximum length of 15,000 characters

What it means

Error "Text exceeds maximum length of 15,000 characters" thrown in HeyPuter/puter.

Source

Thrown at src/backend/drivers/ai-tts/providers/xai/XAITTSProvider.ts:120

            language,
            response_format,
            output_format,
            test_mode,
        } = args;

        if (test_mode) {
            return { url: SAMPLE_AUDIO_URL, content_type: 'audio' };
        }

        if (typeof text !== 'string' || !text.trim()) {
            throw new HttpError(400, 'Missing required field: text', {
                legacyCode: 'field_required',
                fields: { key: 'text' },
            });
        }

        if (text.length > 15000) {
            throw new HttpError(
                400,
                'Text exceeds maximum length of 15,000 characters',
                { legacyCode: 'bad_request' },
            );
        }

        const voice = voiceArg || DEFAULT_VOICE;

        const actor = Context.get('actor')!;
        const ucentsPerChar = XAI_TTS_COSTS['xai-tts'] ?? 0;
        const totalCost = ucentsPerChar * text.length;

        const usageAllowed = await this.meteringService.hasEnoughCredits(
            actor,
            totalCost,
        );
        if (!usageAllowed) {
            throw new HttpError(402, 'Insufficient funds', {

View on GitHub (pinned to 908ec23eda)

Solutions

  1. Split the text into chunks of 15,000 characters or fewer and synthesize each chunk separately.
  2. Shorten the input text to fit the xAI TTS limit.

When it happens

Trigger: Thrown at src/backend/drivers/ai-tts/providers/xai/XAITTSProvider.ts:120 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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