Image generation API
An image generation API for many models
Root's API makes images with the 14 models in the table below, from one key and one credit balance, among them GPT Image, Nano Banana, Seedream, FLUX.2, Ideogram and Krea 2. Send a model id, a prompt and a project id to one endpoint, and the image is saved to that project. The cheapest image in the table below is $0.02 (Krea 2 Turbo).
Updated
First month free on the Beginner plan, with 650 credits to try any model.
Made in Root
Image models you can call
What to send for each model: its id, the resolution values it takes, whether it edits an image you send as image_url, and how many reference_urls it takes. The price is for one image at the size shown, in dollars. 100 credits is $1.
| Model | Send as model | resolution | Edits image_url | reference_urls | One image |
|---|---|---|---|---|---|
| Nano Banana Pro | gemini-3-pro-image | 1K, 2K | Yes | Up to 6 | $0.16 at 1K |
| Nano Banana | gemini-2.5-flash-image | — | Yes | Up to 6 | $0.05 |
| GPT Image 2 | gpt-image-2 | 1K, 2K, 4K | Yes | Up to 8 | $0.25 at 1K |
| GPT Image 2.5 Flare | gpt-image-2.5-flare | 1K, 2K, 4K | Yes | Up to 8 | $0.07 at 1K |
| GPT Image 2.5 Sunburst | gpt-image-2.5-sunburst | 1K, 2K, 4K | Yes | Up to 8 | $0.07 at 1K |
| Seedream 5.0 Pro | seedream-5-0-pro | 1K, 1.5K, 2K | Yes | Up to 10 | $0.06 at 1K |
| Seedream 5.0 Lite | seedream-5-0-lite | 2K, 3K, 4K | Yes | Up to 14 | $0.05 at 2K |
| Seedream 4.5 | seedream-4-5 | 2K, 4K | Yes | Up to 14 | $0.05 at 2K |
| Seedream 4.0 | seedream-4-0 | 1K, 2K, 4K | Yes | Up to 14 | $0.04 at 1K |
| FLUX.2 [max] | flux-2-max | 1K, 2K | Yes | Yes | $0.12 at 1K, 1:1 |
| FLUX.2 [pro] | flux-2-pro | 1K, 2K | Yes | Yes | $0.06 at 1K, 1:1 |
| Ideogram v3 | ideogram-v3 | — | No | Yes | $0.07 |
| Krea 2 Large | krea-2-large | — | No | Style images, by asset id | $0.07 |
| Krea 2 Turbo | krea-2-turbo | — | No | No | $0.02 |
A dash under resolution means the model makes one size, so leave resolution out. FLUX.2 prices are for a square image. Send aspect_ratio: with no shape, the price quoted and held is higher, $0.19 for FLUX.2 [max] at 1K. Krea 2 Turbo's $0.02 is with no aspect_ratio. With one, $0.04 is quoted and held, and the charge follows the size made. The reference_urls counts include the picture you edit.
Ask for an image
This asks Seedream 4.0 for a 16:9 image at 4K, the cheapest 4K image of these models, for $0.04:
curl https://root.film/api/v1/generations \
-H "Authorization: Bearer rfk_your_key" \
-H "Content-Type: application/json" \
-d '{"model":"seedream-4-0","project_id":"YOUR_PROJECT_ID",
"input":{"prompt":"a lighthouse on a black rock at night, waves breaking, beam cutting through the rain",
"resolution":"4K",
"aspect_ratio":"16:9"}}'- Make an API key in Root under Settings, then API, and choose a daily spending limit for it.
- The finished file is saved to the project you name, so your team sees it in the app too.
- Send an Idempotency-Key header and a retry never charges twice.
- Check the status with GET /api/v1/generations/{id}. When it has succeeded, output holds a link to the image: download it then.
Sizes and shapes
- Each model has its own sizes, listed in the table and by GET /api/v1/models. Send one as resolution: 4K and 4k both work.
- On a model with sizes in the table, a size it doesn't make is refused with a 400 that names the sizes it does make, never swapped for another. On a one-size model, resolution is ignored.
- These shapes work on every model in the table: aspect_ratio 1:1, 16:9, 9:16 or 4:3.
- On some models the shape changes the price. GET /api/v1/models says so in that model's price note.
Getting several images
- Each API request makes one image. For four takes of the same idea, send four requests.
- Send them at up to about 12 a minute for the whole workspace. Faster than that, the API answers 429 and says how long to wait.
- Send the same shot_id with each request, and the images land together on that shot as takes, ready to compare in the Root app.
- Give each request its own Idempotency-Key, and reuse a request's key only when you retry that request.
More on the image API
The API article in Root's docs, under Support, then Docs, then API, lists every field, status and error code. To ask for images in a chat instead, see the guide Can Claude generate images?
Related guides
Image API questions
Is there one image generation API for GPT Image, Nano Banana and Seedream?
Yes. Root's API runs all three with one key, along with the other models in the table above. A request names the model, the prompt and the project, and the endpoint is the same for every model. Images start at $0.02 with Krea 2 Turbo.
How much does an image cost by API?
The same as in the Root app. The cheapest in the table above is $0.02 an image, with Krea 2 Turbo. On some models, such as GPT Image 2, a larger size costs more; on others, such as Nano Banana Pro, every size is the same price. A picture you send to a GPT Image model adds to its price. GET /api/v1/models gives each model's price at each size, and failed runs are not charged.
Can one API request make more than one image?
No. One request makes one image. Send a request for each image you want, with the same shot_id so they land side by side as takes.
What image sizes can I ask for by API?
It depends on the model: the table above lists each one's resolution values. Seedream 4.0, Seedream 5.0 Lite, Seedream 4.5, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst and GPT Image 2 make 4K. Nano Banana, Ideogram v3, Krea 2 Large and Krea 2 Turbo make one size, so leave resolution out.
Can I edit an image through the image API?
Yes, with the 11 models marked Yes under Edits image_url in the table above. Send the picture to change as image_url, and say what to change in the prompt. Add reference_urls for anything the result has to match.
Can I send a style or reference picture by API?
Yes. A reference picture goes in reference_urls on the models marked in the table: up to 14 on Seedream 5.0 Lite, Seedream 4.5 and Seedream 4.0, and up to 6 on the Nano Banana models, counting the picture you edit. A style picture is uploaded first and sent in asset_ids with the role style. The GPT Image models and Krea 2 Large then take its look rather than its content. On the other models it is sent like a reference picture, so say in the prompt what to take from it: its colours, its light, its texture. Krea 2 Large takes style pictures only.
Can I try the image API for free?
For a month, yes. The first month of Root's Beginner plan is free and comes with 650 credits, enough for 325 Krea 2 Turbo images. After that the plan is $9 a month, and you can cancel whenever you like.
Try Root free for a month
The first month of the Beginner plan is free and comes with 650 credits to spend on any model. After that it's $9 a month, and you can cancel whenever you like.