Skip to content

Creative Units & billing

Creative Units (CUs) are Layer’s usage currency. Every generation consumes CUs; the amount depends on the model, output size, and options. Balance is held per workspace.

Every execute endpoint has a matching estimate endpoint. Call it first to learn the cost and whether the workspace can afford it:

Terminal window
curl -X POST https://api.app.layer.ai/api/v1/workspaces/$WORKSPACE_ID/inferences/estimate \
-H "Authorization: Bearer $LAYER_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "model_id": "MODEL_ID", "parameters": { "prompt": "a mossy stone golem", "width": 1024, "height": 1024 } }'

An estimate returns:

Field Meaning
estimated_price_creative_units Expected cost of the run.
workspace_balance_creative_units Current available balance.
estimated_remaining_balance_creative_units Balance after the run.
has_sufficient_creative_units Whether the workspace can afford it.

GET /v1/workspaces/{id} returns the balance as three numbers:

Field Meaning
balance_creative_units Total CUs in the workspace.
reserved_creative_units CUs held by in-progress runs.
available_creative_units Usable now (balance − reserved). Can go negative.

When you start a priced run, Layer places a reservation against the balance (it expires after ~1 hour if the run doesn’t complete), which is why reserved rises while a run is in flight. On completion, the run reports the actual amount charged as actual_price_creative_units.

Creative Units are managed in the Layer app under Settings → Billing. There is no REST endpoint to purchase or transfer CUs.