Image generation
Turn a text description (prompt) into images with Google image models (the Nano Banana / Gemini Image family). The endpoint is compatible with the OpenAI Images API — just point the openai SDK at the Geraikita base URL, using the same gk- key and GeraiPoints balance.
Endpoint
https://ai.geraikita.com/v1/images/generations| Header | Value |
|---|---|
| Authorization | Bearer gk-... (or x-api-key: gk-...) |
| Content-Type | application/json |
One request = one prompt, producing 1–4 images. Streaming is not supported — the response is sent in one piece once the images are done.
Body parameters
| Parameter | Type | Description |
|---|---|---|
model | stringrequired | Image model ID, e.g. gemini-3.1-flash-image or gemini-3-pro-image — the full list is in the pricing table below. |
prompt | stringrequired | Description of the image you want, up to 4000 characters. |
n | integeroptional | Number of images, 1–4. Default 1. Each successful image is billed separately. |
size | stringoptional | One of auto | 1024x1024 | 1536x1024 | 1024x1536 | 1792x1024 | 1024x1792. Default auto: the model picks the ratio, usually 16:9 landscape (about 1376×768). Size is only an aspect-ratio hint — the final resolution is up to the model. |
response_format | stringoptional | url (default) for an image link, or b64_json for base64 image data directly in the response. |
Other fields (e.g. quality or style) are ignored.
Examples
curl https://ai.geraikita.com/v1/images/generations \
--max-time 300 \
-H "Authorization: Bearer gk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image",
"prompt": "Promo poster for a palm sugar iced coffee on a wooden table, warm morning light, big \"20% OFF\" text at the top, flat illustration style",
"n": 1,
"size": "1024x1024"
}'Example response
data holds one object per successful image — url or b64_json depending on response_format. If some images fail, there can be fewer objects than n.
{
"created": 1793464057,
"data": [
{ "url": "https://api.geraikita.com/cdn/ai-gambar/2026/11/xxxxxxxxxxxx.jpg" }
]
}Response headers: X-Geraikita-Images = number of successful images, X-Geraikita-GP-Charged = GeraiPoints charged for that request.
Pricing
Image models are billed per successfully generated image — not per token. Current prices (subject to change) are in the table below and on the pricing page.
| Model id | Name | Per image |
|---|---|---|
| gemini-3.1-flash-image | Nano Banana 2 (Gemini 3.1 Flash Image) | 100 GP / image |
| gemini-3-pro-image | Nano Banana Pro (Gemini 3 Pro Image) | 100 GP / image |
- Failed images are not charged, and neither are rejected requests (invalid parameters or content policy violations).
- Your GeraiPoints balance must cover
n× the per-image price before the request is processed; otherwise the response is402. - Image models are not included in the Unlimited plan, Bansos (free tier), or any other free quota — they are always deducted from your GeraiPoints balance.
- Each image is recorded as one row in the dashboard usage history, labeled Image.
Error codes
Errors follow the OpenAI shape: an error object with message, type, param, and code.
| Status | type / code | Meaning |
|---|---|---|
| 400 | invalid_request_error | Invalid parameter (e.g. n outside 1–4, unknown size, empty or too long prompt). Not charged. |
| 400 | content_policy_violation | The prompt violates the content policy (see below). Not charged. |
| 401 | — | API key missing or invalid. |
| 402 | insufficient_quota | Not enough GeraiPoints for the number of images requested — please top up. |
| 403 | — | This model is not allowed for that API key — add it to the key’s model list in the dashboard. |
| 404 | model_not_found | Unknown model, or not an image model. |
| 429 | rate_limit_exceeded | Too many requests — the limit is 10 requests/minute per key. Wait as indicated by the Retry-After header. |
| 502 | image_generation_failed | Image generation failed on the server side. Not charged — please try again. |
{
"error": {
"message": "...",
"type": "...",
"param": "...",
"code": "..."
}
}Calling an image model through /v1/chat/completions returns 400 pointing you to this endpoint — use /v1/images/generations.
Prompt tips
- Prompts can be written in English, Indonesian, or other languages.
- The model can render text inside the image — put the exact text in quotes, e.g.
the words "20% OFF". - Describe the subject, setting, style (photo, flat illustration, 3D, watercolor), lighting, and composition — the more specific, the closer the result.
- Pick a
sizefor the use case:1024x1024for feeds,1024x1792for stories/portrait,1792x1024for landscape banners. - Need several variations? Use
nup to 4 in one request — remember each successful image is billed.
Content policy
The following requests are rejected:
- Sexual or explicit content.
- Content that exploits or endangers children.
- Sadistic violence or gore.
- Real political figures or real public figures.
Rejections return 400 with code content_policy_violation and are not charged.
Image links & storage
data[].url is public — anyone holding the link can open the image — and is not guaranteed to stay available forever. Download and keep a copy in your own storage right after generation, or request b64_json to receive the image data directly in the response.