Image generation API
Google Nano Banana 2.1 API
Sharper layouts and subject consistency, with more precise edits.
Pay as you go, no subscription.
- Image to image
- Editing

Quickstart
Three steps from zero to a finished file.
- 1
- 2
Send one request
POST your input to the endpoint. You get a job ID back right away.
- 3
Collect the result
Poll the status URL or pass a webhook. The finished file arrives as a link.
Or let your AI coding tool do it
Copy this prompt into Claude Code, Cursor or Codex. It reads our docs and writes the code.
Add the Pixel Dojo Google Nano Banana 2.1 API to this project. Read https://pixeldojo.ai/llm/nano-banana-2-1.txt for the endpoint, inputs and prices, and https://pixeldojo.ai/llm.txt for auth, job status and webhooks. Read the key from the PIXELDOJO_API_KEY environment variable. Write one function that submits a job, waits for it to finish and returns the file URL, with errors handled.
https://pixeldojo.ai/api/v1/models/nano-banana-2-1/runcurl -X POST "https://pixeldojo.ai/api/v1/models/nano-banana-2-1/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a watercolor fox at dawn",
"resolution": "1K"
}'Want the file in one call? Add ?wait=60 to the URL. The request waits for the job and returns the result.
Pricing
You pay per result. Every setting is in the table.
| Setting | Per image |
|---|---|
| 1K | $0.063 |
| 2K | $0.094 |
| 4K | $0.188 |
Pay as you go
Top up from $5. No subscription and no minimum.
Failed runs cost nothing
If a run fails, you get the money back on its own.
Know the price first
Add
?dry_run=trueto any request to get its price. Nothing is charged.
Try it
Run a real request and see the exact input and output your code will handle. It is charged like any API call.
Made with this API
Real outputs. Open one to see the request that made it.
A cinematic side-profile portrait of an astronaut standing on a rocky alien beach at sunset, salt spray in the air, twin suns glowing on the horizon, helmet visor catching warm orange light, weathered patches on the spacesuit. Anamorphic lens, soft rim light, sharp focus on the visor.
Wide-angle real estate photograph of a mid-century modern living room, a walnut credenza, a camel leather sofa and a round wool rug, floor-to-ceiling windows looking onto a garden, warm afternoon light filling the room. Straight verticals, bright and inviting listing photo.
Top-down flat lay of amber glass skincare bottles, a jar of capsules, dried lavender and a smooth river stone on natural linen, soft daylight, a calm sage and cream palette with clean negative space. Editorial wellness brand photograph.
Aerial photograph of a Mediterranean coastal village, whitewashed houses with blue doors cascading down a cliff to a turquoise harbor, small wooden fishing boats at anchor, golden afternoon light. Travel magazine cover, crisp and saturated.
Candid portrait of three co-founders, two women and one man in smart casual clothes, laughing together around a standing desk in a startup office with exposed brick and warm wood, big windows letting in soft natural light. Editorial business photography.
Studio portrait of a golden retriever sitting upright, head slightly tilted, sharp focused amber eyes with a bright catch light, soft beauty dish lighting on glossy fur, neutral grey backdrop. Professional pet photography, magazine cover quality.
Reference
Every input the endpoint takes, and what comes back.
Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
promptrequiredstringText description of the image to generate | string | Text description of the image to generate | - |
aspect_ratioenum · default 1:1Image aspect ratio1:12:33:23:44:3+5 more | enum | Image aspect ratio1:12:33:23:44:3+5 more | 1:1 |
resolutionenum · default 1KOutput resolution tier1K2K4K | enum | Output resolution tier1K2K4K | 1K |
reference_imagesarrayHTTPS URLs of one or more reference images for style, composition, or guidance. Multiple images supported.items: urlmax items: 14 | array | HTTPS URLs of one or more reference images for style, composition, or guidance. Multiple images supported.items: urlmax items: 14 | - |
What comes back
When you submit (202)
{
"jobId": "job_abc123...",
"status": "pending",
"statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123...",
"priceUsd": 0.0625,
"creditCost": 1,
"creditsRemaining": 95,
"expiresAt": "2026-12-07T18:28:32Z"
}When it finishes
{
"jobId": "job_abc123...",
"status": "completed",
"output": {
"images": [
"https://temp.pixeldojo.ai/pixeldojotemp/1705930123-456789.png"
]
},
"creditCost": 1,
"expiresAt": "2026-12-07T18:28:32Z"
}priceUsd is what the run cost, in dollars. expiresAt is when the job record is deleted, 24 hours on. The output links last one hour, so download the file soon.
Use saved characters (@Name)
Write @Name in the prompt to use a character, product, outfit, location, prop or style saved in the account's Character Studio, for example "@Mara on a beach at sunset". Its photos are added to reference_images automatically, after any images you send yourself, so your own image numbering is unchanged. List saved names with GET /api/v1/characters and save new ones with POST /api/v1/characters. An @word that names nothing saved stays plain text.
Aspect ratios
Other endpoints for this model
Image editing and generation can use different model IDs.
Built for AI agents
Hand these to a coding assistant and it can write the integration for you.
Questions
How much does the Google Nano Banana 2.1 API cost?
From $0.063 an image. The table above has the price for every setting, and each job's response shows what it cost.
Do I need a subscription?
No. Top up from $5 and pay only for what you run.
Can I see the price before I run something?
Yes. Add ?dry_run=true to the request. You get its price back. Nothing is charged and no job starts.
Do I pay for a run that fails?
No. If a run fails, you get the money back on its own.
How long do output links last?
One hour. Download the file in that time, or call the save endpoint to keep it in your library.
Can an AI assistant use this model?
Yes. Connect Claude, ChatGPT or any agent to our MCP server at https://pixeldojo.ai/mcp. Or give it the docs file for this model.
More image APIs
Same key, same request shape. Switch models by changing one word in the URL.
Start building
Get an API key
One key works for every model.
See usage
Requests, spend and logs.
Top up
Add money to your balance, from $5.