CQTAI
Nano Banana · Image

Synchronous call (Gemini protocol)NEW

📌 What is thisGenerate an image synchronously via the native Gemini generateContent protocol — a single request returns the base64 image, no polling.
💡 When to useUse when you want the result synchronously (no polling), or already use a Gemini SDK / generateContent client.
Synchronous callThis synchronous endpoint is offered in parallel with the async nano channel (POST /api/cqt/generator/nano). The public "Nano tier" is backed by Gemini image models; a single request returns the base64 image directly — no taskId, no polling. Besides Authorization: Bearer, x-goog-api-key is also accepted.

Endpoints

UsageMethodPath
Synchronous callPOST/v1beta/models/{model}:generateContent
🔗 ProtocolGemini generateContent protocol · a single request returns the result directly — no taskId, no polling

Request Parameters

ParamTypeRequiredDescription
{model}pathRequiredModel id in the URL path (tier mapping): gemini-2.5-flash-image (Nano, 10, 1K) / gemini-3-pro-image-preview (Nano Pro, 20, 1K/2K/4K) / gemini-3.1-flash-image-preview (Nano 2, 20, 1K/2K/4K)
contentsarrayRequiredNative Gemini contents: parts[] holds the text prompt; for image-to-image add an inlineData reference image (base64)
generationConfigobjectGeneration config: responseModalities (incl. "IMAGE"), imageConfig.imageSize (1K/2K/4K), aspectRatio, etc. Fields follow the official Google spec

Request Example

curl -X POST https://api.cqtai.com/v1beta/models/gemini-2.5-flash-image:generateContent \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "contents": [{"role":"user","parts":[{"text":"a cute cat on a windowsill, soft morning light"}]}],
    "generationConfig": {
      "responseModalities": ["TEXT","IMAGE"],
      "imageConfig": {"imageSize": "1K", "aspectRatio": "1:1"}
    }
  }'
# -> { "candidates": [{ "content": { "parts": [{ "inlineData": { "mimeType": "image/png", "data": "<base64>" } }] } }] }

Response Example

{
  "candidates": [
    {
      "content": {
        "parts": [
          { "inlineData": { "mimeType": "image/png", "data": "<base64 PNG,原样透传>" } }
        ]
      },
      "finishReason": "STOP"
    }
  ]
}

Billing & Credits

Nano (gemini-2.5-flash-image) 10/img; Nano Pro (gemini-3-pro-image-preview) 20/img; Nano 2 (gemini-3.1-flash-image-preview) 20/img. This channel charges once per request (not x count). (x your user rate). Auto-refunded on failure.