Generate an image
The endpoint you're here for. Sends your prompt to the model and returns the resulting image.
Two ways to call it
- JSON — text-only prompts. Send Content-Type: application/json with a body containing project_id and prompt. Optionally reference existing assets by ID.
- Multipart — attach reference images directly. Send Content-Type: multipart/form-data with one or more reference_file[] parts. Up to 14 references per generation (combined files + asset IDs). Files attached this way are also saved to your asset library under category upload so you can reuse them later — the IDs come back in the response as saved_asset_ids.
Aspect ratio and resolution
aspect_ratio controls the shape (1:1, 4:5, 9:16, 16:9, etc.); resolution controls pixel density (1K, 2K, 4K). Defaults: 4:5 shape, 1K resolution. The model is instructed to honor the picked ratio in addition to whatever you write in the prompt.
Cost
Charged in credits, by model and resolution. Nano Banana 2.1 bills the generate_* rows below; Nano Banana Pro bills generate_pro_* and GPT Image 2.5 (both variants, one price) bills generate_gpt_* — read them from GET /v1/pricing.
| Resolution | Credits |
|---|---|
| 1K | 60 |
| 2K | 85 |
| 4K | 170 |
References don't add cost. Failed calls don't deduct (the credit deduction runs only after the model returns and the row is saved).
Naming
Pass name to label the generation in your library (e.g. "Hero shot — linen suit"). If you don't, we'll auto-derive a short name from your prompt.
Request
- Base URL: https://nanostudiopro.com/api
- URL: https://nanostudiopro.com/api/v1/generations
- Auth: HTTP bearer
Request body
Response
Generation created
Example response
{
"name": "Linen suit hero"
}Changes
No recorded changes to this operation across all 3 revisions of this API.