Skip to main content
Browse Docs
On This Page
View Markdown~1.3k tokensDownload Markdown~1.3k tokens

Estimate endpoint

POST /estimate/{sourceFileExtension} estimates one file and one options payload without uploading the file.

Find valid options

Call GET /options/{format} before building an options payload. It returns the valid capability ids, default selections, and allowed option values for that source format.

GET /options/mp4
X-Fast-Api-Key: YOUR_API_KEY
{
  "format": "mp4",
  "job": "extract.mp4",
  "defaults": {
    "selectedCapabilities": ["video.audio", "video.frames", "video.metadata", "video.subtitles"],
    "includeManifest": true,
    "capabilityOptions": {
      "video.audio": {
        "audioFormat": "mp3"
      },
      "video.frames": {
        "frameMode": "every-n-seconds",
        "frameIntervalSeconds": 1,
        "maxExtractedFrames": 500
      }
    }
  },
  "capabilities": [
    {
      "id": "video.audio",
      "output": "audio",
      "defaultSelected": true,
      "options": [
        {
          "id": "audioFormat",
          "type": "enum",
          "defaultValue": "mp3",
          "allowedValues": ["mp3", "wav", "m4a", "original", "best"]
        }
      ]
    },
    {
      "id": "media.transcript",
      "output": "transcript",
      "defaultSelected": false,
      "options": [
        {
          "id": "transcription.mode",
          "type": "enum",
          "required": true,
          "defaultValue": "fast",
          "allowedValues": ["fast", "quality", "meeting-intelligence"]
        }
      ]
    }
  ]
}

Use capabilities[].id in options.extraction.selectedCapabilities. If a selected capability has options[], put each value under options.extraction.capabilityOptions[capability.id][option.id].

Request

POST /estimate/mp4
Content-Type: application/json
X-Fast-Api-Key: YOUR_API_KEY
{
  "fileSizeMb": 25,
  "durationMinutes": 3,
  "options": {
    "extraction": {
      "selectedCapabilities": ["video.audio", "video.metadata", "media.transcript"],
      "capabilityOptions": {
        "media.transcript": {
          "transcription.mode": "quality"
        }
      }
    }
  }
}

Path params

ParamRequiredNotes
sourceFileExtensionYesSource extension with or without the dot, such as mp4, pdf, docx, or zip.

Fields

FieldRequiredNotes
fileSizeBytes or fileSizeMbYesUsed for file-credit pricing and limits.
durationSeconds or durationMinutesYes for audio and videoThose formats price on duration.
pageCount, slideCount, sheetCount, documentUnitCountYes for documentsSend the metric that matches the source type: pageCount for PDF and Word, slideCount for PowerPoint, sheetCount for Excel.
frameCountYes for frame-billed imagesApplies to avif, avifs, gif, ico, png, tif, tiff, and webp, including single-frame files.
workflowNoextract by default; use transcribe for transcript-only estimates.
modeFor transcript-only mode overridefast, quality, or meeting-intelligence.
optionsNoSame extraction option object accepted by POST /extract.

Most formats price on the highest of two or more metrics — for example a PowerPoint deck costs the greater of 1 credit per 5 MB and 1 credit per 5 slides. The endpoint prices only from metrics you send, so it refuses to answer at all when one is missing rather than return the cheaper partial figure. Read the metric from the file before estimating; every value is available locally without uploading anything.

Response

{
  "job": "extract.mp4",
  "category": "video",
  "quotedCredits": 16,
  "lineItems": [
    {
      "kind": "base",
      "credits": 1
    },
    {
      "kind": "capability",
      "capabilityId": "media.transcript",
      "credits": 15,
      "mode": "quality",
      "unit": "minute"
    }
  ]
}

Credit quote

quotedCredits is the quoted credit cost for the file and option payload. lineItems breaks that quote into base extraction and selected priced add-ons.

Errors

StatusCodeMeaning
400estimate.unsupported_formatThe source extension is not supported.
400estimate.invalid_file_sizefileSizeBytes or fileSizeMb is missing, zero, or negative.
400estimate.duration_limit_exceededThe duration exceeds the limit for your plan.
422estimate.exact_metrics_requiredA metric this format prices on was not supplied.

estimate.exact_metrics_required names exactly what to send:

{
  "error": "estimate.exact_metrics_required",
  "format": "pptx",
  "job": "extract.pptx",
  "params": {
    "format": "pptx",
    "job": "extract.pptx",
    "missingMetrics": ["documentUnits"],
    "documentUnitKind": "slides",
    "fields": ["slideCount", "documentUnitCount"]
  }
}

Send any field from params.fields and retry. A 647 KB, 9-slide deck costs 2 credits (ceil(9 / 5) beats ceil(0.647 / 5)), so quoting it on file size alone would show 1 credit and then charge 2. The endpoint returns this error instead of a number it cannot stand behind.

Copied