Endpoint: Cost Estimate
Method + path
GET /convert/estimate/{from}/{to}
Auth
Requires X-Fast-Api-Key header.
Path params
from: source format (e.g.heic,pdf,wav)to: target format (e.g.jpg,png,mp3)
Query params
All optional. Provide the relevant parameter for the converter's costing strategy to receive an estimatedCredits value.
| Param | Type | Used by |
|---|---|---|
fileSizeBytes | long | PerMegabyte strategy |
fileSizeMb | double | PerMegabyte strategy (convenience alias) |
pageCount | int | PerPage strategy |
durationMinutes | double | PerMinute strategy |
variant | string | Cost variant key (e.g. quality, meeting-intelligence). When a converter has cost variants, this selects which cost tier to use. Omit to use the default variant. |
If both fileSizeBytes and fileSizeMb are provided, fileSizeBytes takes precedence.
Important: If the required input for the strategy is omitted,
estimatedCreditsreturns the base cost — this is the minimum cost, not a calculated estimate. For example, a 200-page PDF-to-JPG conversion costs 20 credits, but omittingpageCountreturnsestimatedCredits: 1. Always provide the relevant input parameter for an accurate estimate.
The costing formula and limits are always returned so clients can calculate or display the rate.
Response
200 OK with CostEstimateResponse.
Example response (PerMegabyte strategy — no inputs)
When no size input is provided, estimatedCredits returns the base cost (minimum).
{
"job": "image.heic-to-jpg",
"category": "images",
"estimatedCredits": 1,
"costing": {
"strategy": "PerMegabyte",
"baseCost": 1,
"increment": 5,
"incrementUnit": "mb",
"displaySuffix": "per 5 MB",
"costVariants": null
},
"inputs": {
"fileSizeBytes": null,
"fileSizeMb": null,
"pageCount": null,
"durationMinutes": null
},
"limits": {
"maxFileSizeBytes": 1073741824,
"maxPages": null,
"maxDurationMinutes": null
}
}
Example response (PerPage with input)
{
"job": "document.pdf-to-jpg",
"category": "documents",
"estimatedCredits": 10,
"costing": {
"strategy": "PerPage",
"baseCost": 1,
"increment": 5,
"incrementUnit": "pages",
"displaySuffix": "per 5 pages",
"costVariants": null
},
"inputs": {
"fileSizeBytes": null,
"fileSizeMb": null,
"pageCount": 50,
"durationMinutes": null
},
"limits": {
"maxFileSizeBytes": 1073741824,
"maxPages": 2000,
"maxDurationMinutes": null
}
}
Example response (PerPage without input — minimum only)
Caution: This response shows
estimatedCredits: 1becausepageCountwas omitted — this is not the cost of converting a multi-page PDF. PasspageCountfor an accurate estimate.
{
"job": "document.pdf-to-jpg",
"category": "documents",
"estimatedCredits": 1,
"costing": {
"strategy": "PerPage",
"baseCost": 1,
"increment": 5,
"incrementUnit": "pages",
"displaySuffix": "per 5 pages",
"costVariants": null
},
"inputs": {
"fileSizeBytes": null,
"fileSizeMb": null,
"pageCount": null,
"durationMinutes": null
},
"limits": {
"maxFileSizeBytes": 1073741824,
"maxPages": 2000,
"maxDurationMinutes": null
}
}
Example response (PerMinute with cost variants)
Converters with cost variants include a costVariants object in the costing response. Use the variant query parameter to select a non-default cost tier.
{
"job": "audio.audio-to-txt",
"category": "audio",
"estimatedCredits": 50,
"costing": {
"strategy": "PerMinute",
"baseCost": 2,
"increment": 1,
"incrementUnit": "minutes",
"displaySuffix": "per minute",
"costVariants": {
"optionKey": "transcription.mode",
"label": "Transcription mode",
"default": "fast",
"variants": {
"fast": { "cost": 2, "label": "Fast" },
"quality": { "cost": 5, "label": "Quality" },
"meeting-intelligence": { "cost": 8, "label": "Meeting Intelligence" }
}
}
},
"inputs": {
"fileSizeBytes": null,
"fileSizeMb": null,
"pageCount": null,
"durationMinutes": 10.0
},
"limits": {
"maxFileSizeBytes": 1073741824,
"maxPages": null,
"maxDurationMinutes": 300
}
}
Examples
# PerMegabyte (no inputs — returns base cost)
curl -sS "https://api.tools.fast/convert/estimate/heic/jpg"
# PerMegabyte with file size (bytes)
curl -sS "https://api.tools.fast/convert/estimate/heic/jpg?fileSizeBytes=52428800"
# PerMegabyte with file size (MB convenience alias)
curl -sS "https://api.tools.fast/convert/estimate/heic/jpg?fileSizeMb=50"
# PerPage with page count
curl -sS "https://api.tools.fast/convert/estimate/pdf/jpg?pageCount=50"
# PerMinute with duration
curl -sS "https://api.tools.fast/convert/estimate/wav/mp3?durationMinutes=12.5"
# PerMinute with cost variant (quality mode = 5 credits/min)
curl -sS "https://api.tools.fast/convert/estimate/mp3/txt?durationMinutes=10&variant=quality"
# Unsupported pair (returns 400)
curl -sS "https://api.tools.fast/convert/estimate/heic/mp3"# PerMegabyte (no inputs — returns base cost)
Invoke-RestMethod "https://api.tools.fast/convert/estimate/heic/jpg"
# PerMegabyte with file size (bytes)
Invoke-RestMethod "https://api.tools.fast/convert/estimate/heic/jpg?fileSizeBytes=52428800"
# PerMegabyte with file size (MB convenience alias)
Invoke-RestMethod "https://api.tools.fast/convert/estimate/heic/jpg?fileSizeMb=50"
# PerPage with page count
Invoke-RestMethod "https://api.tools.fast/convert/estimate/pdf/jpg?pageCount=50"
# PerMinute with duration
Invoke-RestMethod "https://api.tools.fast/convert/estimate/wav/mp3?durationMinutes=12.5"
# PerMinute with cost variant (quality mode = 5 credits/min)
Invoke-RestMethod "https://api.tools.fast/convert/estimate/mp3/txt?durationMinutes=10&variant=quality"
# Unsupported pair (returns 400)
Invoke-RestMethod "https://api.tools.fast/convert/estimate/heic/mp3"Error responses
400 Bad Request if the format pair is not supported:
{
"error": "estimate.unsupported_format_pair",
"detail": "Conversion from 'heic' to 'mp3' is not supported.",
"sourceFormat": "heic",
"targetFormat": "mp3",
"supportedTargets": ["avif", "jpg", "png", "webp"]
}
400 Bad Request if an invalid cost variant is specified:
{
"error": "estimate.invalid_variant",
"detail": "Cost variant 'bogus' not found for option 'transcription.mode'. Valid: fast, quality, meeting-intelligence"
}