You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,6 +400,17 @@ await foreach (var message in session.ReadEventsAsync())
400
400
401
401
</details>
402
402
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
+
403
414
<!-- EXAMPLES:START -->
404
415
### Chat Client Five Random Words Streaming
405
416
```csharp
@@ -694,6 +705,8 @@ using var client = new GeminiClient(apiKey);
694
705
695
706
try
696
707
{
708
+
// This example uses native image output and therefore requires
709
+
// a Paid Tier Gemini API project and API key.
697
710
// First generate an image to edit
698
711
varoriginal=awaitclient.GenerateImageAsync(
699
712
prompt: "A plain white background",
@@ -866,6 +879,8 @@ using var client = new GeminiClient(apiKey);
866
879
867
880
try
868
881
{
882
+
// Native image output models such as gemini-2.5-flash-image currently
883
+
// require a Paid Tier Gemini API project and API key.
869
884
varresult=awaitclient.GenerateImageAsync(
870
885
prompt: "A simple red circle on a white background",
871
886
imageSize: "1K");
@@ -882,6 +897,8 @@ using var client = new GeminiClient(apiKey);
882
897
883
898
try
884
899
{
900
+
// Native image output models such as gemini-2.5-flash-image currently
901
+
// require a Paid Tier Gemini API project and API key.
885
902
varresult=awaitclient.GenerateImageAsync(
886
903
prompt: "A landscape with mountains",
887
904
imageSize: "1K",
@@ -899,6 +916,8 @@ using var client = new GeminiClient(apiKey);
899
916
900
917
try
901
918
{
919
+
// This example uses native image output and therefore requires
920
+
// a Paid Tier Gemini API project and API key.
902
921
// First generate a reference image
903
922
varreference=awaitclient.GenerateImageAsync(
904
923
prompt: "A simple red square",
@@ -940,6 +959,8 @@ using var client = new GeminiClient(apiKey);
940
959
941
960
try
942
961
{
962
+
// This example first creates a source image, so it also requires
963
+
// a Paid Tier Gemini API project and API key.
943
964
varimage=awaitclient.GenerateImageAsync(
944
965
prompt: "A still landscape with mountains and a lake",
945
966
imageSize: "1K");
@@ -964,6 +985,8 @@ using var client = new GeminiClient(apiKey);
964
985
965
986
try
966
987
{
988
+
// This example first creates source images, so it also requires
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
+
usingGoogle.Gemini;
48
+
49
+
usingvarclient=newGeminiClient(apiKey);
50
+
51
+
// The API key must come from a Paid Tier AI Studio project for native image output.
52
+
varresult=awaitclient.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)
Copy file name to clipboardExpand all lines: docs/index.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,6 +400,17 @@ await foreach (var message in session.ReadEventsAsync())
400
400
401
401
</details>
402
402
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
+
403
414
<!-- EXAMPLES:START -->
404
415
### Chat Client Five Random Words Streaming
405
416
```csharp
@@ -694,6 +705,8 @@ using var client = new GeminiClient(apiKey);
694
705
695
706
try
696
707
{
708
+
// This example uses native image output and therefore requires
709
+
// a Paid Tier Gemini API project and API key.
697
710
// First generate an image to edit
698
711
varoriginal=awaitclient.GenerateImageAsync(
699
712
prompt: "A plain white background",
@@ -866,6 +879,8 @@ using var client = new GeminiClient(apiKey);
866
879
867
880
try
868
881
{
882
+
// Native image output models such as gemini-2.5-flash-image currently
883
+
// require a Paid Tier Gemini API project and API key.
869
884
varresult=awaitclient.GenerateImageAsync(
870
885
prompt: "A simple red circle on a white background",
871
886
imageSize: "1K");
@@ -882,6 +897,8 @@ using var client = new GeminiClient(apiKey);
882
897
883
898
try
884
899
{
900
+
// Native image output models such as gemini-2.5-flash-image currently
901
+
// require a Paid Tier Gemini API project and API key.
885
902
varresult=awaitclient.GenerateImageAsync(
886
903
prompt: "A landscape with mountains",
887
904
imageSize: "1K",
@@ -899,6 +916,8 @@ using var client = new GeminiClient(apiKey);
899
916
900
917
try
901
918
{
919
+
// This example uses native image output and therefore requires
920
+
// a Paid Tier Gemini API project and API key.
902
921
// First generate a reference image
903
922
varreference=awaitclient.GenerateImageAsync(
904
923
prompt: "A simple red square",
@@ -940,6 +959,8 @@ using var client = new GeminiClient(apiKey);
940
959
941
960
try
942
961
{
962
+
// This example first creates a source image, so it also requires
963
+
// a Paid Tier Gemini API project and API key.
943
964
varimage=awaitclient.GenerateImageAsync(
944
965
prompt: "A still landscape with mountains and a lake",
945
966
imageSize: "1K");
@@ -964,6 +985,8 @@ using var client = new GeminiClient(apiKey);
964
985
965
986
try
966
987
{
988
+
// This example first creates source images, so it also requires
0 commit comments