The AI Studio API (generativelanguage.googleapis.com) enforces a hard 10 RPM quota on preview models regardless of billing tier. Switching to Cloud TTS API (texttospeech.googleapis.com) with the same Gemini models uses a separate, production-grade quota that scales on paid plans. Changes: - Replace genai.Client + generate_content(AUDIO) with texttospeech.TextToSpeechClient - Style prompt now goes to SynthesisInput.prompt (dedicated field, not prepended text) - Speed goes to AudioConfig.speaking_rate (no longer encoded in prompt text) - Cloud TTS returns MP3 directly — remove PCM→MP3 lameenc conversion - config: update pro model from gemini-2.5-pro-preview-tts → gemini-2.5-pro-tts (GA) - Service account already has roles/aiplatform.user (granted today) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| authz.py | ||
| config.py | ||
| database.py | ||
| dependencies.py | ||
| logging.py | ||
| redis.py | ||
| secrets_config.py | ||
| security.py | ||
| seed.py | ||