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.
Estimate before you execute
Section titled “Estimate before you execute”Every execute endpoint has a matching estimate endpoint. Call it first to learn the cost and whether the workspace can afford it:
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. |
Workspace balance
Section titled “Workspace balance”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.
Cost is not enforced at submit
Section titled “Cost is not enforced at submit”Topping up
Section titled “Topping up”Creative Units are managed in the Layer app under Settings → Billing. There is no REST endpoint to purchase or transfer CUs.