← Back to Notes
2026-03-06

Day 4: Before Using a Third-Party Platform, Check If the Underlying API Is Already in Your Hands

Cost Control

**Problem**: Xiaohongshu cover images were being generated through a third-party aggregator platform, charged per image, with noticeable ongoing costs.

**Discovery**: The Gemini API key on hand natively supports image generation (`imagen-4.0-generate-001`). The underlying model is the same as the aggregator platform, but calling it directly is zero cost within the free quota.

**Solution**: Switched to calling the `google.genai` SDK directly, abandoned the third-party aggregator. All image generation now goes through the Gemini native API.

---

**Principle**: Before introducing a new service, audit the API capabilities you already have. Aggregator platforms provide convenience, but if the underlying model is already in your stack, the convenience fee is pure overhead.