remagicaDocs home
API referenceGenerations

Estimate a generation's cost

POST
/generations/estimate

Needs a key withmodels:list

What a generation would cost, in credits, if you sent it now: send the body you'd send to POST /generations/images (or /videos, /music, /speech, /sound-effects, /background-removals) with kind saying which. It's priced exactly as that request is charged, from today's price book, and validated against the model the same way. Nothing is started or charged.

Requires scope models:list.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Request Body

application/json
  1. body

An image request.

aspectRatio?string

Output aspect ratio. auto lets the model decide (with references, usually the first reference's).

Value in"auto""21:9""16:9""3:2""4:3""5:4""1:1""4:5""3:4""2:3""9:16"
background?string

transparent for a cut-out PNG. Only models whose params list it (GPT Image 2).

Value in"auto""transparent""opaque"
count?integer

How many images to make.

Range1 <= value <= 4
Default1
imageSearch?boolean

Let the model look up pictures on Google Image Search. Only models whose params list it (Nano Banana 2).

prompt*string
Length1 <= length <= 20000
promptExpansion?boolean

Let the model expand the prompt itself (FLUX, Ideogram's Magic Prompt). Only models whose params list it.

quality?string

Rendering quality. Only models whose params list it.

Value in"auto""low""medium""high""xhigh""max"
references?array<>

Reference images. With any, the model edits or composes from them.

Itemsitems <= 30
Default[]
resolution?string
Value in"1K""2K""4K"
seed?integer
Range0 <= value <= 2147483647
thinkingLevel?string

Let the model think before drawing. Only models whose params list it (Nano Banana 2).

Value in"minimal""medium""high"
webSearch?boolean

Let the model search the web for current facts. Only models whose params list it (Nano Banana).

activeReferences?

References picked from the References catalogue (GET /references, the built-ins by slug, your own by id, Library Elements as library:<itemId>, a brand kit by id): each adds a line to the prompt and, for models that take reference images, one image after your own references while the model has room.

from?

The generation this request carries on from (its file was sent here as a reference, frame or source), kept as metadata.from so the result can show what it was made from.

model*string

Model id from GET /models.

Length1 <= length <= 200
thumbnail?

Thumbnail Studio's brief, kept as metadata.thumbnail; with it, a finished image also gets an export output at the format's exact size.

visibility?string

private (the default): your workspace only. public: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key).

Value in"private""public"
kind*unknown

Response Body

What the request would cost.

application/json
  1. response

What a generation would cost.

breakdown*
credits*integer

Credits the request would be charged if it were sent now: exactly what POST /generations/{kind} sets aside.

Range0 <= value
Example Request
curl -X POST 'https://api.remagica.com/api/v1/generations/estimate' \  -H 'Content-Type: application/json' \  -d '{  "prompt": "A lighthouse on a cliff at dusk, cinematic",  "model": "google/nano-banana-pro",  "kind": "image"}'
Example Response
{  "breakdown": {    "meters": [      {        "credits": 12,        "rate": "string",        "tier": "string",        "unit": "string",        "units": 1      }    ],    "model": "google/nano-banana-pro",    "priceVersion": 3  },  "credits": 12}