Gemini Flash — fast Google multimodal model with long context. Best value for volume tasks.
Key strengths
- Very low cost
- Long context
- Multimodal input
- Fast first token
Use cases
- Bulk classification
- Long-doc RAG
- Video input
- High QPS
Google's google/gemini-2.5-flash-image is a state-of-the-art text-to-image generation model. It produces highly detailed, photorealistic and stylized imagery from natural-language prompts, with strong instruction following and accurate text rendering inside generated images.
Compatible with the OpenAI `/images/generations` endpoint shape, supporting prompt, size, seed, negative prompt, and resolution controls. Excellent for creative workflows, marketing assets, product visualization, and concept art at scale.
google/gemini-2.5-flash-image is fully OpenAI-compatible — drop in your existing OpenAI Python or Node SDK and switch `baseURL` to `https://api.tokenlx.ai`. TokenLX transparently routes your requests to the optimal provider endpoint while preserving streaming, function-calling, and structured-output semantics.
Performance
Compare different providers across TokenLX · All locations.
Effective Pricing
Actual cost per million tokens across providers over the past 7 days.
Recent activity
Total usage per day on TokenLX (last 30 days).
Sample code & API
TokenLX normalizes requests and responses across providers. Use any OpenAI SDK or our native SDK.
# ─── 文生图示例 ───
import requests
response = requests.post(
"https://api.tokenlx.ai/v1/aigc/image/generations",
headers={"Authorization": "Bearer sk-tokenlx-..."},
json={
"model": "gemini-2.5-flash-image",
"prompt": "一幅水墨画风格的山水画",
"aspectRatio": "16:9",
"resolution": "2K",
},
)
data = response.json()
print(data["data"][0])
# ─── 图像编辑示例 ───
edit_response = requests.post(
"https://api.tokenlx.ai/v1/aigc/image/generations",
headers={"Authorization": "Bearer sk-tokenlx-..."},
json={
"model": "gemini-2.5-flash-image",
"prompt": "把背景替换为星空",
"images": [
{"file_uri": "https://example.com/photo.jpg", "mime_type": "image/jpeg"},
],
"aspectRatio": "1:1",
"resolution": "2K",
},
)
print(edit_response.json()["data"][0])Replace sk-aihubrouter-… with your key from the dashboard.
Parameter Reference
{
"data": ["url1", "url2"]
}| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name |
| prompt | string | Yes | Generation prompt |
| aspectRatio | string | No | Aspect ratio 1:12:33:23:44:34:55:49:1616:921:91:44:11:88:1 |
| resolution | string | No | Resolution (default 1K). gemini-3.1-flash-image also supports 512 (0.5K) 5121K2K4K |
| temperature | float | No | Sampling temperature (default 0.3) |
| topP | float | No | Top-P sampling (default 0.8) |
| maxOutTokens | int | No | Max output tokens |
| enableGoogleSearch | bool | No | Enable Google Search grounding |
| enableWebSearch | bool | No | Enable webSearch grounding |
| enableImageSearch | bool | No | Enable imageSearch grounding |
| thinkingLevel | string | No | Thinking level: minimal (default, low latency) / high (better quality) minimalhigh |
| includeThoughts | bool | No | Include thinking process in response |
| images | array | Editing | Input images for editing (required when editing). Each item has file_uri and optional mime_type. Supports multiple images |
| images[].file_uri | string | Editing | Image URL or base64 data URI |
| images[].mime_type | string | No | MIME type, defaults to image/png |
modelstringYespromptstringYesaspectRatiostringNo1:12:33:23:44:34:55:49:1616:921:91:44:11:88:1resolutionstringNo5121K2K4KtemperaturefloatNotopPfloatNomaxOutTokensintNoenableGoogleSearchboolNoenableWebSearchboolNoenableImageSearchboolNothinkingLevelstringNominimalhighincludeThoughtsboolNoimagesarrayEditingimages[].file_uristringEditingimages[].mime_typestringNo