MenuImage generation

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

POSThttps://ai.geraikita.com/v1/images/generations
HeaderValue
AuthorizationBearer gk-... (or x-api-key: gk-...)
Content-Typeapplication/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

ParameterTypeDescription
modelstringrequiredImage model ID, e.g. gemini-3.1-flash-image or gemini-3-pro-image — the full list is in the pricing table below.
promptstringrequiredDescription of the image you want, up to 4000 characters.
nintegeroptionalNumber of images, 1–4. Default 1. Each successful image is billed separately.
sizestringoptionalOne 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_formatstringoptionalurl (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

Processing usually takes 15–45 seconds per request, and can take up to about 4 minutes when the backup route is used. Set a client timeout of at least 300 seconds so the request is not cut off before the images are done.
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.

200 OK · application/json
{
  "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 idNamePer image
gemini-3.1-flash-imageNano Banana 2 (Gemini 3.1 Flash Image)100 GP / image
gemini-3-pro-imageNano 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 is 402.
  • 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.

Statustype / codeMeaning
400invalid_request_errorInvalid parameter (e.g. n outside 1–4, unknown size, empty or too long prompt). Not charged.
400content_policy_violationThe prompt violates the content policy (see below). Not charged.
401—API key missing or invalid.
402insufficient_quotaNot 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.
404model_not_foundUnknown model, or not an image model.
429rate_limit_exceededToo many requests — the limit is 10 requests/minute per key. Wait as indicated by the Retry-After header.
502image_generation_failedImage generation failed on the server side. Not charged — please try again.
Error example
{
  "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 size for the use case: 1024x1024 for feeds, 1024x1792 for stories/portrait, 1792x1024 for landscape banners.
  • Need several variations? Use n up 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

The URL in 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.