Generate
Quotes and spending caps
POST /v1/generations/quote prices a request before it runs; max_cost_usd refuses one that would cost more than you meant.
/v1/generations/quoteThe price of a request before it is sent, against the balance available. Nothing is held or started.Send the body you would send to the model's endpoint; a prompt is not needed. Nothing is held or started. The answer is the price, what the request would hold, and whether the balance covers it: the same rules as the request itself, so the price quoted is the price held and, for a success, the price charged.
curl https://frameport.ai/v1/generations/quote \
-H "Authorization: Bearer $FRAMEPORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-5",
"duration": 5,
"resolution": "720p"
}'{
"object": "quote",
"model": "seedance-2-5",
"type": "video",
"mode": "generate",
"price_usd": 1.35,
"reserved_usd": 1.35,
"breakdown": "5 s at 720p × $0.27/s",
"available_usd": 42.5,
"enough_balance": true
}Clip edits
An edit is priced on its clip's length: add seconds to the body for its exact price. Without it, price_usd is null and reserved_usd is the hold, the price of the longest clip the model takes.
{
"model": "fp-replace-1",
"seconds": 6.4
}max_cost_usd
Every request body takes max_cost_usd, the most it may cost in USD. A request that would cost more is refused with 400 max_cost_exceeded before anything is held, and the message says the price. For a clip edit it is compared to the hold.
{
"error": {
"code": "max_cost_exceeded",
"message": "max_cost_usd: this request costs $0.40, above $0.25. Nothing was charged.",
"request_id": "req_7Xc2LmQ9vT4nRk8Ws1Bd"
}
}