Skip to content

Commit 472a31e

Browse files
docs: add google/gemini-3-1-flash-lite-image (#272)
1 parent 30ab0f1 commit 472a31e

5 files changed

Lines changed: 299 additions & 1 deletion

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
* [Nano Banana Pro (Gemini 3 Pro Image)](api-references/image-models/google/gemini-3-pro-image-preview.md)
263263
* [Nano Banana Pro Edit (Gemini 3 Pro Image Edit)](api-references/image-models/google/gemini-3-pro-image-preview-edit.md)
264264
* [Nano Banana 2 (Gemini 3.1 Flash Image)](api-references/image-models/google/gemini-3.1-flash-image.md)
265+
* [Nano Banana 2 Lite](api-references/image-models/Google/gemini-3.1-flash-lite-image.md)
265266
* [Kling AI](api-references/image-models/kling-ai/README.md)
266267
* [Image o1](api-references/image-models/kling-ai/image-o1.md)
267268
* [OpenAI](api-references/image-models/OpenAI/README.md)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Google
2+
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/v1/images/generations": {
14+
"post": {
15+
"operationId": "_v1_images_generations",
16+
"requestBody": {
17+
"required": true,
18+
"content": {
19+
"application/json": {
20+
"schema": {
21+
"type": "object",
22+
"properties": {
23+
"model": {
24+
"type": "string",
25+
"enum": [
26+
"google/gemini-3-1-flash-lite-image"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
32+
},
33+
"image_urls": {
34+
"type": "array",
35+
"items": {
36+
"type": "string",
37+
"format": "uri"
38+
},
39+
"maxItems": 5,
40+
"description": "List of URLs or local Base64 encoded images to edit."
41+
},
42+
"aspect_ratio": {
43+
"type": "string",
44+
"enum": [
45+
"1:1",
46+
"9:16",
47+
"16:9",
48+
"3:4",
49+
"4:3"
50+
],
51+
"description": "The aspect ratio of the generated image. It is taken from this parameter or from the provided reference image. If the parameter is not set and no reference image is provided, the default value is 16:9."
52+
},
53+
"resolution": {
54+
"type": "string",
55+
"enum": [
56+
"1K",
57+
"2K",
58+
"4K"
59+
],
60+
"default": "1K",
61+
"description": "The resolution of the output image."
62+
},
63+
"enable_web_search": {
64+
"type": "boolean",
65+
"default": false,
66+
"description": "Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image."
67+
}
68+
},
69+
"required": [
70+
"model",
71+
"prompt"
72+
],
73+
"title": "google/gemini-3-1-flash-lite-image"
74+
}
75+
}
76+
}
77+
},
78+
"responses": {
79+
"200": {
80+
"content": {
81+
"application/json": {
82+
"schema": {
83+
"type": "object",
84+
"properties": {
85+
"data": {
86+
"type": "array",
87+
"nullable": true,
88+
"items": {
89+
"type": "object",
90+
"properties": {
91+
"url": {
92+
"type": "string",
93+
"nullable": true,
94+
"description": "The URL where the file can be downloaded from.",
95+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
96+
},
97+
"b64_json": {
98+
"type": "string",
99+
"nullable": true,
100+
"description": "The base64-encoded JSON of the generated image.",
101+
"example": null
102+
}
103+
}
104+
},
105+
"description": "The list of generated images."
106+
},
107+
"meta": {
108+
"type": "object",
109+
"nullable": true,
110+
"properties": {
111+
"usage": {
112+
"type": "object",
113+
"nullable": true,
114+
"properties": {
115+
"credits_used": {
116+
"type": "number",
117+
"description": "The number of tokens consumed during generation.",
118+
"example": 120000
119+
},
120+
"usd_spent": {
121+
"type": "number",
122+
"description": "The total amount of money spent by the user in USD.",
123+
"example": 0.06
124+
}
125+
},
126+
"required": [
127+
"credits_used",
128+
"usd_spent"
129+
]
130+
}
131+
},
132+
"description": "Additional details about the generation."
133+
}
134+
}
135+
}
136+
}
137+
},
138+
"description": "Successful response."
139+
}
140+
},
141+
"x-hideTryItPanel": true,
142+
"x-codeSamples": [
143+
{
144+
"lang": "cURL",
145+
"source": "curl --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\"model\": \"google/gemini-3-1-flash-lite-image\", \"prompt\": \"Describe what you want the model to generate.\"}'"
146+
},
147+
{
148+
"lang": "JavaScript",
149+
"source": "const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"google/gemini-3-1-flash-lite-image\",\n \"prompt\": \"Describe what you want the model to generate.\"\n}),\n});\n\nconsole.log(await response.json());"
150+
},
151+
{
152+
"lang": "Python",
153+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n \"Content-Type\": \"application/json\",\n },\n json={'model': 'google/gemini-3-1-flash-lite-image', 'prompt': 'Describe what you want the model to generate.'},\n)\n\nprint(response.json())"
154+
}
155+
]
156+
}
157+
}
158+
},
159+
"components": {
160+
"securitySchemes": {
161+
"access-token": {
162+
"scheme": "bearer",
163+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
164+
"type": "http",
165+
"description": "Bearer key"
166+
}
167+
}
168+
}
169+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Nano Banana 2 Lite
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `google/gemini-3-1-flash-lite-image`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/google/gemini-3-1-flash-lite-image" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
Nano Banana 2 Lite is a cost-efficient text-to-image model from Google, a lighter and cheaper variant of Nano Banana 2 for high-volume image generation.
20+
21+
{% hint style="success" %}
22+
[Create AI/ML API Key](https://aimlapi.com/app/keys)
23+
{% endhint %}
24+
25+
<details>
26+
27+
<summary>How to make the first API call</summary>
28+
29+
**1️⃣ Required setup (don’t skip this)**\
30+
**Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\
31+
**Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI.
32+
33+
**2️ Copy the code example**\
34+
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
35+
36+
**3️ Update the snippet for your use case**\
37+
**Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\
38+
**Select a model:** set the `model` field to the model you want to call.\
39+
**Provide input:** fill in the request input field(s) shown in the example.
40+
41+
**4️ (Optional) Tune the request**\
42+
See the API schema below for optional generation settings.
43+
44+
**5️ Run your code**\
45+
Run the updated code in your development environment.
46+
47+
{% hint style="success" %}
48+
For a detailed walkthrough, use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
49+
{% endhint %}
50+
51+
</details>
52+
53+
## API Schema
54+
55+
{% openapi-operation spec="gemini-3-1-flash-lite-image" path="/v1/images/generations" method="post" %}
56+
[OpenAPI gemini-3-1-flash-lite-image](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Google/gemini-3.1-flash-lite-image.json)
57+
{% endopenapi-operation %}
58+
59+
## Code Example
60+
61+
{% tabs %}
62+
{% tab title="Python" %}
63+
{% code overflow="wrap" %}
64+
```python
65+
import requests
66+
67+
response = requests.post(
68+
"https://api.aimlapi.com/v1/images/generations",
69+
headers={
70+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
71+
"Content-Type": "application/json",
72+
},
73+
json={'model': 'google/gemini-3-1-flash-lite-image', 'prompt': 'Describe what you want the model to generate.'},
74+
)
75+
76+
print(response.json())
77+
```
78+
{% endcode %}
79+
{% endtab %}
80+
81+
{% tab title="JavaScript" %}
82+
{% code overflow="wrap" %}
83+
```javascript
84+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
85+
method: 'POST',
86+
headers: {
87+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
88+
'Content-Type': 'application/json',
89+
},
90+
body: JSON.stringify({
91+
"model": "google/gemini-3-1-flash-lite-image",
92+
"prompt": "Describe what you want the model to generate."
93+
}),
94+
});
95+
96+
console.log(await response.json());
97+
```
98+
{% endcode %}
99+
{% endtab %}
100+
{% endtabs %}
101+
102+
<details>
103+
104+
<summary>Response</summary>
105+
106+
{% code overflow="wrap" %}
107+
```json
108+
{
109+
"data": [
110+
{
111+
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
112+
"b64_json": null
113+
}
114+
],
115+
"meta": {
116+
"usage": {
117+
"credits_used": 120000,
118+
"usd_spent": 0.06
119+
}
120+
},
121+
"model": "google/gemini-3-1-flash-lite-image"
122+
}
123+
```
124+
{% endcode %}
125+
126+
</details>

0 commit comments

Comments
 (0)