{"record":{"id":"0add94a69aaa1a4d","repo":"HeyPuter/puter","slug":"insufficient-funds-0add94","errorCode":"insufficient_funds","errorMessage":"Insufficient funds","messagePattern":"Insufficient funds","errorType":"http","errorClass":"HttpError","httpStatus":402,"severity":"error","filePath":"src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts","lineNumber":194,"sourceCode":"                },\n            );\n        }\n\n        const format = response_format || 'mp3';\n        const contentType =\n            RESPONSE_CONTENT_TYPES[format] || RESPONSE_CONTENT_TYPES.mp3;\n\n        const actor = Context.get('actor')!;\n        const usageType = `openai:${model}:character`;\n        const ucentsPerChar = OPENAI_TTS_COSTS[model] ?? 0;\n        const totalCost = ucentsPerChar * text.length;\n\n        const usageAllowed = await this.meteringService.hasEnoughCredits(\n            actor,\n            totalCost,\n        );\n        if (!usageAllowed) {\n            throw new HttpError(402, 'Insufficient funds', {\n                legacyCode: 'insufficient_funds',\n            });\n        }\n\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const payload: any = {\n            model,\n            voice,\n            input: text,\n        };\n\n        if (instructions) {\n            payload.instructions = instructions;\n        }\n\n        if (response_format) {\n            payload.response_format = response_format;\n        }","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts#L176-L212","documentation":"Error \"Insufficient funds\" thrown in HeyPuter/puter.","triggerScenarios":"Thrown at src/backend/drivers/ai-tts/providers/openai/OpenAITTSProvider.ts:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add credits to the account before retrying the TTS request.","Reduce usage or upgrade the plan to restore sufficient funds."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}