Imagen API
Imagen is Google's text-to-image model line. Generate images with Imagen 4 through Puter.js — no API keys, no Google Cloud or Vertex AI setup, no backend.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.txt2img("A futuristic city skyline at sunset, cinematic lighting", {
model: "google/imagen-4.0"
}).then(image => {
document.body.appendChild(image);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.txt2img("A futuristic city skyline at sunset, cinematic lighting", {
model: "google/imagen-4.0"
}).then(image => {
document.body.appendChild(image);
});
</script>
</body>
</html>
The Imagen API for Google Text-to-Image
High-Quality Text-to-Image
Imagen 4 produces sharp, detailed images with strong prompt adherence and accurate text rendering.
Fast / Standard / Ultra
Choose the tier that fits — Fast for speed and volume, Ultra for maximum fidelity up to 2K.
Aspect Ratios
Generate across nine aspect ratios, from square to widescreen and portrait.
No Vertex Setup
Skip the Gemini-API-vs-Vertex-AI decision and GCP onboarding — Puter handles access for you.
Up to 4 Images
Request multiple images per call to give users variations to choose from.
No Keys, User-Pays
No Google Cloud account or API key — your users cover their own usage, free for you to ship.
Imagen Models Compared
Every Imagen model available through Puter.js, with per-image cost and output resolution. Click a model for full specs and examples.
| Model | Cost / Image | Resolution | Released |
|---|---|---|---|
Imagen 4 Ultra
google/imagen-4.0-ultra |
$0.0602 | 1MP | Aug 2025 |
Imagen 4
google/imagen-4.0 |
$0.04 | 1MP | Aug 2025 |
Imagen 4 Preview
google/imagen-4.0-preview |
$0.04 | 1MP | May 2025 |
Imagen 4 Fast
google/imagen-4.0-fast |
$0.02 | 1MP | Aug 2025 |
Use Imagen in Seconds
Add Imagen to your app with just a few lines of code.
No API keys, no backend, no configuration required.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.txt2img("A futuristic city skyline at sunset, cinematic lighting", {
model: "google/imagen-4.0"
}).then(image => {
document.body.appendChild(image);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.txt2img("A futuristic city skyline at sunset, cinematic lighting", {
model: "google/imagen-4.0"
}).then(image => {
document.body.appendChild(image);
});
</script>
</body>
</html>
Frequently Asked Questions
The Imagen API lets you generate images from text prompts using Google's Imagen 4 text-to-image models, available in Fast, Standard, and Ultra tiers — including Imagen 4 — through Puter.js, with no API keys and no backend.
Yes, it is free for you as the developer when you use it through Puter.js. With the User-Pays model, each of your users covers their own usage through their Puter account, so you can ship Imagen-powered apps at no cost to you.
Start with Imagen 4 as your default. Lighter or faster variants trade some quality for speed and cost — compare them in the table above and pick the one that fits your use case.
Many Imagen models support image editing and image-to-image generation alongside text-to-image. See the Puter.js documentation for what each model supports.
Imagen 4 costs about $0.04 per image at the API level. Through Puter.js it is free for you as the developer — your users cover their own usage under the User-Pays model, with no per-image billing or keys to manage.
No. Puter.js handles authentication and infrastructure for you, so you can use the Imagen API without any API key, an Google account, a server, or any configuration.
Yes — the Imagen API through Puter.js works with any JavaScript framework, Node.js, or plain HTML. Just include the library and start building.
Related Resources
Learn how to use Imagen and other models with Puter.js.