mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-30 17:50:00 -06:00
* feat: enforce new metering + get rid of old methods * fix: make openrouter metering more robust
837 B
837 B
PuterAI Module
The PuterAI module provides AI capabilities to Puter through various services including:
- Text generation and chat completion
- Text-to-speech synthesis
- Image generation
- Document analysis
Metered Services
All AI services in this module are metered using Puter's MeteringService. This allows us to charge per unit usage, where a unit is defined by the specific service:
for example, most LLMs will charge per token, AWS Polly charges per character, and AWS Textract charges per page. the metering service tracks usage units, and relies on its centralized cost maps to determine if a user has enough credits to perform an operation, and to record usage after the operation is complete.
see MeteringService for more details on how metering works.