Date: 2026-05-09
Source: Harnoor (explicit, durable rule)
Confidence: explicit · durable
ANY file generated by a paid AI service (ElevenLabs audio, gpt-image-1 images, gpt-5/Bedrock long-form text, Veo 3 video, future PDF/Word generators, etc.) is a one-shot expense. Once it's saved to S3, never pay to regenerate it.
def gen_or_fetch(s3_key: str, generator_fn):
"""Generate-once, cache-on-S3 pattern. Use everywhere."""
s3 = boto3.client("s3")
try:
s3.head_object(Bucket=BUCKET, Key=s3_key)
return f"https://{BUCKET}.s3.{REGION}.amazonaws.com/{s3_key}" # already exists, skip
except s3.exceptions.ClientError as e:
if e.response["Error"]["Code"] != "404":
raise
# Doesn't exist — generate, upload, return URL
bytes_blob = generator_fn()
s3.put_object(Bucket=BUCKET, Key=s3_key, Body=bytes_blob, ContentType=mime, ACL="public-read")
return f"https://{BUCKET}.s3.{REGION}.amazonaws.com/{s3_key}"
S3 key naming convention to enable cache hits:
manifest/summon/harnoor/2026-05-09/episode.mp3 ← deterministic per user per daymanifest/echo/img/oracle.png ← stable name, generated once forevergen-cache/{sha256(prompt)}.png ← any generator, dedupe identical prompts| Type | Service | Cost-per-gen | Cache-on-S3 mandate |
|---|---|---|---|
| Audio narration | ElevenLabs | $0.10–0.50/file | YES |
| Cartoon images | OpenAI gpt-image-1 | $0.10–0.20 | YES |
| AI video clips | Veo 3 / Sora | $0.10–1.00/sec | YES |
| Long-form text essays | Claude Sonnet/Opus | $0.01–0.10 | YES |
| PDFs (reports, advisor memos) | local Python (cheap) but still cache | $0 | YES (cheap to gen but slow to render) |
| Word/.docx | local Python | $0 | YES |
| Charts / SVGs | local | $0 | OPTIONAL |
lambda_innerverse_nightly.py already does it for Childhood + Summon — confirm Dreams/Oracle/Childhood/Timelines all check before regenAll three working. Pick by use-case:
| Tier | Provider | Best for | Cost/img | Quality | Status |
|---|---|---|---|---|---|
| A — Daily volume | OpenAI gpt-image-1 (medium) | Lambda nightly content, share cards, app heroes — auto-recharge handles cost | $0.04 | ★★★★ | ✅ live |
| B — Top quality | Google Imagen 4 (imagen-4.0-generate-001) | Marketing assets, Product Hunt launch, premium gallery / hero-of-hero shots | $0.04 | ★★★★★ | ✅ live (paid tier active 2026-05-10) |
| C — Bedrock fallback | AWS Bedrock Nova Canvas | If OpenAI/Gemini both unavailable | $0.04 | ★★★½ | ⚠️ LEGACY-inactive (1 console click to revive) |
Default routing: OpenAI for daily/volume (Tier A) since it has auto-recharge and works. Switch to Imagen 4 for any "this must be amazing" hero shot. Bedrock only as fallback.
Routing rule:
CLI wrappers:
python F:/TITAN/scripts/gen_glyphs_inline.py (script ready) or direct openai.images.generate(model="gpt-image-1")F:/TITAN/scripts/bedrock_image.py (built, awaits Bedrock model-access re-enable)F:/TITAN/scripts/gemini_image.py (built, awaits Gemini billing)| Tier | Provider | Best for | Cost/clip | Quality | Status |
|---|---|---|---|---|---|
| A — Default | Google Veo 3 (veo-3.0-generate-001, :predictLongRunning) | Hero clips for MIRROR / VISION / SUMMON / OMEN / ECHO daily content + marketing | ~$0.50–1.50 (4–8 sec) | ★★★★★ (with synced audio, cinematic) | ✅ live (paid tier active 2026-05-10) |
| B — Fallback | AWS Bedrock Nova Reel v1.1 | If Gemini quota exhausted | ~$0.75 | ★★★ (no audio, 1280x720) | ⚠️ LEGACY (1 console click to revive) |
Daily-content video budget: at Veo 3 ~$1/clip × 5 apps × 30 days = ~$150/mo for full Manifest+Mirror video pipeline. Decide per-app whether the cinematic upgrade is worth it.
CLI wrapper: F:/TITAN/scripts/gemini_video.py (built; needs model name confirmed as veo-3.0-generate-001 and method :predictLongRunning).
Imagen 4 (1024x1024) → 1080 KB PNG saved ✅
Veo 3 (4 sec, 16:9) → 1172 KB MP4 in ~30 sec ✅
Nano Banana → returns no image (likely content-filter quirk on test prompt; secondary)
gemini-2.5-flash text → free tier, working