POST/v1/imagine

NanoBanana — Google Gemini Image Generation

NanoBanana is LinkrAPI's credits-based image generation provider powered by Google AI Studio (Gemini Flash Image). Unlike the Midjourney integration, NanoBanana does not require a Discord account — just credit balance and your lkr_nb_xxx API key.

💡 Same endpoint, different key. NanoBanana uses the same POST /v1/imagine endpoint as Midjourney. The routing is automatic: send your lkr_nb_xxx Global NanoBanana Key instead of a hold key, and the request is routed to Google Gemini.

Authentication

NanoBanana uses a Global NanoBanana API Key — separate from your hold keys. This key starts with lkr_nb_ and applies to your whole account, not a specific hold.

Find, generate, and copy your key on the Settings page. Pass it as a Bearer token:

Authorization: Bearer lkr_nb_your_key_here

Credits & Pricing

NanoBanana generation is charged in credits. The cost depends on your image count setting, which you configure once in the Settings page (nanobanana_image_count). It is not a per-request API parameter.

image_count SettingOutputCredits per Request
1 (Single)1 image, direct URL4 credits
4 (Grid)2×2 grid image, single URL16 credits
💰 Credit rate: 100 credits = $1.00 USD. Deposit credits on the Billing page.

Supported Aspect Ratios

NanoBanana supports the following aspect ratios. Include them in your prompt with --ar as you would for Midjourney — LinkrAPI parses the flag and passes the correct ratio to Google Gemini.

RatioDescription
1:1Square — default, good for portraits and icons
16:9Landscape widescreen — YouTube thumbnails, banners
9:16Portrait vertical — mobile, TikTok, Instagram Stories
3:4Portrait classic — great for prints and posters
4:3Landscape classic — presentation slides, older displays
ℹ️ Unsupported or unrecognized aspect ratios default to 1:1.
⚠️ Prompt Flag Stripping
NanoBanana automatically strips the following Midjourney-specific flags from your prompt before sending it to Google Gemini:

--ar--aspect--fast--relax--turbo--seed--sameseed

Other flags like --v, --style, and --chaos are passed as plain text to the model description — they won't affect Gemini's output, but they won't cause errors either. For best results with NanoBanana, write plain descriptive prompts without Midjourney-specific flags.

Example Request

cURL
curl -X POST https://linkrapi.com/api/v1/imagine \
  -H "Authorization: Bearer lkr_nb_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a futuristic city at sunset --ar 16:9",
    "webhook_url": "https://your-server.com/webhook"
  }'

Response (Submit)

200 OK — Task Submitted
{
  "status": "SUCCESS",
  "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Task submitted successfully"
}
status
string
"SUCCESS" — the task was accepted and is queued.
task_id
string
Use this with GET /v1/fetch/{task_id} to poll for results.
message
string
Human-readable status message.

Response (Completed Fetch)

GET /v1/fetch/{task_id} — Completed
{
  "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "action": "imagine",
  "status": "completed",
  "progress": 100,
  "prompt": "a futuristic city at sunset --ar 16:9",
  "image_url": "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_1.png",
  "images": [
    "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_1.png",
    "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_2.png",
    "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_3.png",
    "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_4.png"
  ],
  "grid_url": "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_grid.png",
  "cdn_url": "https://cdn.linkrapi.com/uploads/img/a1b2c3d4_1.png",
  "components": null,
  "error": null,
  "created_at": "2026-07-04T10:30:00"
}
status
string
"completed" when the image is ready.
image_url
string
URL of the first generated image (or only image in 1-image mode).
images
array
Array of individual image URLs. For 4-image mode: 4 URLs (_1.png to _4.png). For 1-image mode: 1 URL.
grid_url
string
URL of the 2×2 composite grid image. Null in 1-image mode.
cdn_url
string
Alias for image_url. Kept for backwards compatibility.
components
null
Always null for NanoBanana. Upscale and variation actions are not supported.
⚠️ No /v1/action Support
NanoBanana tasks do not support POST /v1/action. The components field in the fetch response will always be null. If you need upscale or variation actions, use the Midjourney integration with a hold key instead.

Status Codes

200Task submitted successfully. Poll /v1/fetch/{task_id} for the result.
400Invalid request — prompt is empty, missing, or image_count setting is invalid.
401Invalid or missing NanoBanana API key (must start with lkr_nb_).
402Insufficient credits. Response includes required vs. available credit balance.
💡 Typical Workflow
1. Call POST /v1/imagine with your lkr_nb_xxx key → get task_id
2. Poll GET /v1/fetch/{task_id} every 5 seconds
3. When status is completed, use the image_url

NanoBanana generation is typically faster than Midjourney: 10–30 seconds in most cases. You can also pass a webhook_url to receive an instant POST callback instead of polling.