Skip to content

Commit 7d5cda2

Browse files
committed
docs: clarify Gemini free tier image generation requirements
1 parent c53295f commit 7d5cda2

16 files changed

Lines changed: 135 additions & 1 deletion

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,17 @@ await foreach (var message in session.ReadEventsAsync())
400400

401401
</details>
402402

403+
### Free Tier and Image Generation
404+
405+
Gemini API access is model-specific. A Free Tier key can use many text and multimodal Gemini models, but native image output models are currently different.
406+
407+
- `GenerateImageAsync`, `EditImageAsync`, and `GenerateImageWithReferencesAsync` default to `gemini-2.5-flash-image`.
408+
- Google's Gemini API pricing page currently lists `gemini-2.5-flash-image` and `imagen-*` models as Paid Tier only.
409+
- There is no SDK flag that enables free native image generation. To use the image helpers in this SDK, create your API key from a Paid Tier Google AI Studio project with billing enabled.
410+
- Google AI Studio itself can still be free to use, but using a paid API key for paid features is billed by Google.
411+
412+
For setup details, see the `Free Tier and Image Generation` guide in the docs and Google's official docs for [pricing](https://ai.google.dev/gemini-api/docs/pricing), [billing](https://ai.google.dev/gemini-api/docs/billing), [rate limits](https://ai.google.dev/gemini-api/docs/rate-limits), and [available regions](https://ai.google.dev/gemini-api/docs/available-regions).
413+
403414
<!-- EXAMPLES:START -->
404415
### Chat Client Five Random Words Streaming
405416
```csharp
@@ -694,6 +705,8 @@ using var client = new GeminiClient(apiKey);
694705

695706
try
696707
{
708+
// This example uses native image output and therefore requires
709+
// a Paid Tier Gemini API project and API key.
697710
// First generate an image to edit
698711
var original = await client.GenerateImageAsync(
699712
prompt: "A plain white background",
@@ -866,6 +879,8 @@ using var client = new GeminiClient(apiKey);
866879

867880
try
868881
{
882+
// Native image output models such as gemini-2.5-flash-image currently
883+
// require a Paid Tier Gemini API project and API key.
869884
var result = await client.GenerateImageAsync(
870885
prompt: "A simple red circle on a white background",
871886
imageSize: "1K");
@@ -882,6 +897,8 @@ using var client = new GeminiClient(apiKey);
882897

883898
try
884899
{
900+
// Native image output models such as gemini-2.5-flash-image currently
901+
// require a Paid Tier Gemini API project and API key.
885902
var result = await client.GenerateImageAsync(
886903
prompt: "A landscape with mountains",
887904
imageSize: "1K",
@@ -899,6 +916,8 @@ using var client = new GeminiClient(apiKey);
899916

900917
try
901918
{
919+
// This example uses native image output and therefore requires
920+
// a Paid Tier Gemini API project and API key.
902921
// First generate a reference image
903922
var reference = await client.GenerateImageAsync(
904923
prompt: "A simple red square",
@@ -940,6 +959,8 @@ using var client = new GeminiClient(apiKey);
940959

941960
try
942961
{
962+
// This example first creates a source image, so it also requires
963+
// a Paid Tier Gemini API project and API key.
943964
var image = await client.GenerateImageAsync(
944965
prompt: "A still landscape with mountains and a lake",
945966
imageSize: "1K");
@@ -964,6 +985,8 @@ using var client = new GeminiClient(apiKey);
964985

965986
try
966987
{
988+
// This example first creates source images, so it also requires
989+
// a Paid Tier Gemini API project and API key.
967990
var startFrame = await client.GenerateImageAsync(
968991
prompt: "A red circle on a white background",
969992
imageSize: "1K");

docs/examples/edit-image-simple-edit.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// This example uses native image output and therefore requires
13+
// a Paid Tier Gemini API project and API key.
1214
// First generate an image to edit
1315
var original = await client.GenerateImageAsync(
1416
prompt: "A plain white background",

docs/examples/generate-image-simple-prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// Native image output models such as gemini-2.5-flash-image currently
13+
// require a Paid Tier Gemini API project and API key.
1214
var result = await client.GenerateImageAsync(
1315
prompt: "A simple red circle on a white background",
1416
imageSize: "1K");

docs/examples/generate-image-with-aspect-ratio.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// Native image output models such as gemini-2.5-flash-image currently
13+
// require a Paid Tier Gemini API project and API key.
1214
var result = await client.GenerateImageAsync(
1315
prompt: "A landscape with mountains",
1416
imageSize: "1K",

docs/examples/generate-image-with-references-single-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// This example uses native image output and therefore requires
13+
// a Paid Tier Gemini API project and API key.
1214
// First generate a reference image
1315
var reference = await client.GenerateImageAsync(
1416
prompt: "A simple red square",

docs/examples/generate-video-from-image-simple-animation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// This example first creates a source image, so it also requires
13+
// a Paid Tier Gemini API project and API key.
1214
var image = await client.GenerateImageAsync(
1315
prompt: "A still landscape with mountains and a lake",
1416
imageSize: "1K");

docs/examples/interpolate-frames-two-images.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using var client = new GeminiClient(apiKey);
99

1010
try
1111
{
12+
// This example first creates source images, so it also requires
13+
// a Paid Tier Gemini API project and API key.
1214
var startFrame = await client.GenerateImageAsync(
1315
prompt: "A red circle on a white background",
1416
imageSize: "1K");
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Free Tier and Image Generation
2+
3+
This SDK works with both Free Tier and Paid Tier Gemini API projects, but Google enables features per model, not per SDK method.
4+
5+
## Free Tier vs Paid Tier
6+
7+
- Free Tier is available only for selected Gemini API models and comes with lower quota limits.
8+
- Paid Tier requires upgrading a Google AI Studio project to billing.
9+
- Google currently documents Paid Tier setup as linking billing in AI Studio and, for many accounts, adding a minimum prepaid balance.
10+
11+
## Native Image Generation Is Not Currently Free Tier
12+
13+
The image helper methods in this SDK default to native image output models:
14+
15+
- `GenerateImageAsync()`
16+
- `EditImageAsync()`
17+
- `GenerateImageWithReferencesAsync()`
18+
19+
By default they use `gemini-2.5-flash-image`.
20+
21+
Google's Gemini API pricing page currently marks these native image generation options as not available on the Free Tier:
22+
23+
- `gemini-2.5-flash-image`
24+
- `imagen-*` models such as `imagen-4.0-generate-001`
25+
26+
That means there is currently no SDK-side switch that "turns on" free native image generation. If your project stays on the Gemini API Free Tier, these image output helpers should be treated as Paid Tier features.
27+
28+
## What You Need For Image Generation In This SDK
29+
30+
To call `GenerateImageAsync()`, `EditImageAsync()`, or `GenerateImageWithReferencesAsync()` successfully, make sure you have:
31+
32+
1. A Google AI Studio project in a supported region.
33+
2. Billing enabled for that project.
34+
3. A valid paid billing state for that project, such as a positive prepaid balance when Google requires prepay for your account.
35+
4. An API key created from that Paid Tier project.
36+
5. A model that supports native image output, such as `gemini-2.5-flash-image`.
37+
38+
## Common Confusion
39+
40+
- Google AI Studio usage can be free even though some Gemini API models are Paid Tier only.
41+
- A Free Tier key can still use multimodal models that accept image input, such as vision-style prompts with `gemini-2.5-flash`.
42+
- Accepting image input is not the same as returning generated image output.
43+
44+
## Example
45+
46+
```csharp
47+
using Google.Gemini;
48+
49+
using var client = new GeminiClient(apiKey);
50+
51+
// The API key must come from a Paid Tier AI Studio project for native image output.
52+
var result = await client.GenerateImageAsync(
53+
prompt: "A watercolor fox reading a map",
54+
imageSize: "1K");
55+
```
56+
57+
## Official Google References
58+
59+
- [Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing)
60+
- [Gemini API billing](https://ai.google.dev/gemini-api/docs/billing)
61+
- [Gemini API rate limits](https://ai.google.dev/gemini-api/docs/rate-limits)
62+
- [Available regions for Google AI Studio and Gemini API](https://ai.google.dev/gemini-api/docs/available-regions)
63+
- [Gemini image generation docs](https://ai.google.dev/gemini-api/docs/image-generation)

docs/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,17 @@ await foreach (var message in session.ReadEventsAsync())
400400

401401
</details>
402402

403+
### Free Tier and Image Generation
404+
405+
Gemini API access is model-specific. A Free Tier key can use many text and multimodal Gemini models, but native image output models are currently different.
406+
407+
- `GenerateImageAsync`, `EditImageAsync`, and `GenerateImageWithReferencesAsync` default to `gemini-2.5-flash-image`.
408+
- Google's Gemini API pricing page currently lists `gemini-2.5-flash-image` and `imagen-*` models as Paid Tier only.
409+
- There is no SDK flag that enables free native image generation. To use the image helpers in this SDK, create your API key from a Paid Tier Google AI Studio project with billing enabled.
410+
- Google AI Studio itself can still be free to use, but using a paid API key for paid features is billed by Google.
411+
412+
For setup details, see the `Free Tier and Image Generation` guide in the docs and Google's official docs for [pricing](https://ai.google.dev/gemini-api/docs/pricing), [billing](https://ai.google.dev/gemini-api/docs/billing), [rate limits](https://ai.google.dev/gemini-api/docs/rate-limits), and [available regions](https://ai.google.dev/gemini-api/docs/available-regions).
413+
403414
<!-- EXAMPLES:START -->
404415
### Chat Client Five Random Words Streaming
405416
```csharp
@@ -694,6 +705,8 @@ using var client = new GeminiClient(apiKey);
694705

695706
try
696707
{
708+
// This example uses native image output and therefore requires
709+
// a Paid Tier Gemini API project and API key.
697710
// First generate an image to edit
698711
var original = await client.GenerateImageAsync(
699712
prompt: "A plain white background",
@@ -866,6 +879,8 @@ using var client = new GeminiClient(apiKey);
866879

867880
try
868881
{
882+
// Native image output models such as gemini-2.5-flash-image currently
883+
// require a Paid Tier Gemini API project and API key.
869884
var result = await client.GenerateImageAsync(
870885
prompt: "A simple red circle on a white background",
871886
imageSize: "1K");
@@ -882,6 +897,8 @@ using var client = new GeminiClient(apiKey);
882897

883898
try
884899
{
900+
// Native image output models such as gemini-2.5-flash-image currently
901+
// require a Paid Tier Gemini API project and API key.
885902
var result = await client.GenerateImageAsync(
886903
prompt: "A landscape with mountains",
887904
imageSize: "1K",
@@ -899,6 +916,8 @@ using var client = new GeminiClient(apiKey);
899916

900917
try
901918
{
919+
// This example uses native image output and therefore requires
920+
// a Paid Tier Gemini API project and API key.
902921
// First generate a reference image
903922
var reference = await client.GenerateImageAsync(
904923
prompt: "A simple red square",
@@ -940,6 +959,8 @@ using var client = new GeminiClient(apiKey);
940959

941960
try
942961
{
962+
// This example first creates a source image, so it also requires
963+
// a Paid Tier Gemini API project and API key.
943964
var image = await client.GenerateImageAsync(
944965
prompt: "A still landscape with mountains and a lake",
945966
imageSize: "1K");
@@ -964,6 +985,8 @@ using var client = new GeminiClient(apiKey);
964985

965986
try
966987
{
988+
// This example first creates source images, so it also requires
989+
// a Paid Tier Gemini API project and API key.
967990
var startFrame = await client.GenerateImageAsync(
968991
prompt: "A red circle on a white background",
969992
imageSize: "1K");

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ site_name: Google.Gemini .NET Documentation
22
nav:
33
- Overview: index.md
44
- Guides:
5+
- Free Tier and Image Generation: guides/free-tier-and-image-generation.md
56
- Live API (Real-time Voice/Video): guides/live-api.md
67
- Microsoft.Extensions.AI: guides/meai.md
78
# EXAMPLES:START
@@ -113,4 +114,4 @@ markdown_extensions:
113114
custom_checkbox: true
114115
- pymdownx.tilde
115116
- pymdownx.tabbed:
116-
alternate_style: true
117+
alternate_style: true

0 commit comments

Comments
 (0)