Credits and pricing
What things cost, estimating before you spend, and reading your balance and history.
Generations, workflow runs, app runs and clip jobs spend your workspace's credits, the same credits the app uses. API requests cost nothing extra.
Prices
GET /pricingreturns the price book: what every model and action costs, in credits. It needs no key.GET /modelsreturns each model with itspricing.- Prices can change. The price book has a
priceVersion. Send thatpriceVersionwith a workflow or app run, and if prices have gone up since, the run is refused with409 PRICE_CHANGEDand its new estimate, rather than charged more than you expected.
Estimate before you generate
POST /generations/estimate prices a generation without starting it or charging anything. Send the body you'd send to create it, plus its kind: image, video, music, speech, sound-effect or background-removal. It needs models:list.
curl https://api.remagica.com/api/v1/generations/estimate \
-H "x-api-key: $REMAGICA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "video",
"model": "bytedance/seedance-2.0",
"prompt": "A paper boat drifting down a rainy street",
"duration": 5
}'{
"credits": 120,
"breakdown": {
"model": "bytedance/seedance-2.0",
"priceVersion": 14,
"meters": [
{ "credits": 120, "rate": "video", "tier": "720p", "unit": "second", "units": 5 }
]
}
}The values above are examples. Each meter is one part of the price: what it counts (unit), how many (units) and what that part costs. The estimate validates the body the way creating it would, so a 400 here means the create would fail too. The credits it returns are what the generation charges at today's prices.
Workflow and app runs come with their own estimates: GET /apps/{appId} includes what a run costs, and a run reports creditsEstimated and creditsSpent.
Balance and history
These need usage:read.
GET /credits: thebalanceyou can spend now, creditsexpiringSoon, and anydebt.GET /credits/history: the ledger of grants, charges and refunds. Filter byapiKeyIdto see what one key spent.GET /credits/api-keys: every key that has spent credits, including deleted ones.GET /credit-usage: usage by model, project and day.
Failures and cancels
A generation that fails or is cancelled gives its credits back (creditsRefunded: true) when its provider didn't bill anything: it was refused before it ran, failed in a way its provider doesn't charge for, or was cancelled before it started. When the provider did bill it, or may still, the credits stay and the generation's error says why:
- you cancelled it while the provider was already rendering it (
stopRequested: true): it finishes and is charged; - the provider charges for the failure, as fal may for a request its safety filter blocked after it ran;
- the provider didn't finish in time and may still charge for it, or the answer to our request was lost after it was sent (we never send it twice);
- the model finished but saving what it made kept failing.
Clip jobs are held and charged for the length we measure from the upload itself, never for more than was held. Tools priced by the length of a video or audio you give them measure it first, and refuse one that is longer than the tool's priced maximum or whose length can't be read.
Running out
When the workspace can't pay for a request, it's refused with 402 OUT_OF_CREDITS (data.code is 1101) and nothing runs. A workspace owner or admin can add credits in Settings → Billing. Members can also hit a per-member credit limit an admin has set.