Browse Docs
Archives (14)
Audio (38)
Documents (26)
Ebooks (7)
Fonts (13)
Images (62)
Video (10)
On This Page

Endpoint: Convert

Method + path

  • POST /convert

Auth

  • Recommended: X-Fast-Api-Key

Content type

Two input methods are supported:

File upload (multipart/form-data)

Upload a file directly. This is the standard method for most integrations.

URL input (application/json)

Submit a URL pointing to the file instead of uploading it. The server fetches the file and processes it identically to a file upload. Ideal for presigned cloud storage URLs (S3, GCS, Azure Blob) and automation workflows (n8n, Zapier, Make).

URL input is also available as a form field — include inputUrl in a multipart/form-data request instead of a file field.

Form fields (multipart/form-data)

FieldRequiredDescription
fileyes*Single uploaded file
inputUrlyes*HTTPS URL to fetch the file from (alternative to file)
targetFormatyesDesired output format (jpg, png, pdf, etc.)
sourceFormatyes*Source format of the file at the URL (e.g., heic, pdf). Required when using inputUrl
optionsnoJSON string for converter options
webhookUrlnoHTTPS URL to receive a webhook POST on job completion
webhookSecretnoShared secret for HMAC-SHA256 signature verification (16–256 characters). Required with webhookUrl
webhookEventsnoComma-separated event filter: succeeded, failed, or both (default: both)
outputUrlReserved for future use. Returns 400 if provided

* Provide exactly one of file or inputUrl — they are mutually exclusive. Sending both returns url_fetch.mutually_exclusive.

Notes:

  • Exactly one file per request.
  • targetFormat can also be provided via query string as fallback: POST /convert?targetFormat=jpg
  • Some converters use compound targetFormat values that differ from simple format names — e.g. bank-statement-excel (not excel), pdf-ocr (not pdf). Use GET /convert/conversions to discover the exact targetFormat values.

JSON body fields (application/json)

When using JSON body input, all fields are sent as a JSON object instead of form fields.

FieldRequiredDescription
inputUrlyesHTTPS URL to fetch the file from
targetFormatyesDesired output format (jpg, png, pdf, etc.)
sourceFormatyes*Source format of the file at the URL (e.g., heic, pdf). Required when using inputUrl
optionsnoConverter options object (not a JSON string — pass the object directly)
webhookUrlnoHTTPS URL to receive a webhook POST on job completion
webhookSecretno (required with webhookUrl)Shared secret for HMAC-SHA256 signature verification (16–256 characters)
webhookEventsnoComma-separated event filter: succeeded, failed, or both
outputUrlReserved for future use. Returns 400 if provided

Response

202 Accepted with JobAcceptedResponse

Example response (trimmed)

{
  "id": "019c56454f8b755996c45a4874a1f3f6",
  "status": "Queued",
  "creditCost": 1
}

Examples

File upload

cURL
# export API_KEY="your-api-key-here"
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.heic" \
  -F "targetFormat=jpg"

# with options JSON
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.jpg" \
  -F "targetFormat=webp" \
  -F 'options={"resize":{"enabled":true,"preset":"1080p"}}'
PowerShell
# $env:API_KEY = "your-api-key-here"
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{ file = Get-Item "photo.heic"; targetFormat = "jpg" }

# with options JSON
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{
    file = Get-Item "photo.jpg"
    targetFormat = "webp"
    options = '{"resize":{"enabled":true,"preset":"1080p"}}'
  }

Convert from URL (JSON body)

cURL
# Convert a file from a presigned S3 URL
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputUrl": "https://my-bucket.s3.amazonaws.com/photo.heic?X-Amz-Expires=3600&...",
    "sourceFormat": "heic",
    "targetFormat": "jpg"
  }'

# URL without a file extension — sourceFormat tells the server what to expect
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputUrl": "https://cdn.example.com/assets/abc123",
    "sourceFormat": "heic",
    "targetFormat": "png"
  }'

# with converter options
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputUrl": "https://cdn.example.com/photo.jpg",
    "targetFormat": "webp",
    "options": {"resize": {"enabled": true, "preset": "1080p"}}
  }'
PowerShell
# Convert a file from a presigned S3 URL
$body = @{
  inputUrl = "https://my-bucket.s3.amazonaws.com/photo.heic?X-Amz-Expires=3600&..."
  sourceFormat = "heic"
  targetFormat = "jpg"
} | ConvertTo-Json

Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -ContentType "application/json" -Body $body

# URL without a file extension
$body = @{
  inputUrl = "https://cdn.example.com/assets/abc123"
  sourceFormat = "heic"
  targetFormat = "png"
} | ConvertTo-Json

Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -ContentType "application/json" -Body $body

Convert from URL (multipart form)

You can also pass inputUrl as a form field instead of uploading a file:

cURL
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "inputUrl=https://cdn.example.com/photo.heic" \
  -F "sourceFormat=heic" \
  -F "targetFormat=jpg"
PowerShell
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{
    inputUrl = "https://cdn.example.com/photo.heic"
    sourceFormat = "heic"
    targetFormat = "jpg"
  }

Audio transcription with options

Transcription converters accept a transcription options object to control mode and output formats. See Options Reference for all settings.

cURL
# Transcribe audio to text (quality mode with SRT subtitles)
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@meeting.mp3" \
  -F "targetFormat=txt" \
  -F 'options={"transcription":{"mode":"quality","includeSrt":true}}'
PowerShell
# Transcribe audio to text (quality mode with SRT subtitles)
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{
    file = Get-Item "meeting.mp3"
    targetFormat = "txt"
    options = '{"transcription":{"mode":"quality","includeSrt":true}}'
  }

With webhook notification

cURL
# Convert with webhook — no polling needed
curl -sS -X POST "https://api.tools.fast/convert" \
  -H "X-Fast-Api-Key: $API_KEY" \
  -F "file=@photo.heic" \
  -F "targetFormat=jpg" \
  -F "webhookUrl=https://example.com/webhooks/fast" \
  -F "webhookSecret=whsec_your_secret_here"
PowerShell
# Convert with webhook — no polling needed
Invoke-RestMethod -Method Post "https://api.tools.fast/convert" `
  -Headers @{ "X-Fast-Api-Key" = $env:API_KEY } `
  -Form @{
    file = Get-Item "photo.heic"
    targetFormat = "jpg"
    webhookUrl = "https://example.com/webhooks/fast"
    webhookSecret = "whsec_your_secret_here"
  }

See Webhooks for payload schema, signature verification, and retry policy.

URL input notes

  • sourceFormat required: URL input requires sourceFormat so the server can validate the conversion pair and enforce per-converter size limits before downloading. Omitting it returns url_fetch.missing_source_format.
  • Pre-download validation: The sourceFormattargetFormat pair is validated before fetching. Invalid pairs return convert.unsupported_format_pair instantly (no download occurs).
  • Per-converter size limits: The download cap uses the converter's configured file size limit for your tier, not a generic cap.
  • SSRF protection: Private IPs (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), bare IPs, and cloud metadata endpoints (169.254.169.254) are blocked.
  • HTTPS required: URLs must use HTTPS.
  • Redirects: Up to 3 redirects are followed. Each hop is re-validated against SSRF rules.
  • isRetryable: URL fetch errors include an isRetryable boolean indicating whether the request can be retried (e.g. true for DNS failures and timeouts, false for invalid URLs and private IPs).
  • outputUrl reserved: The outputUrl field is reserved for future server-side upload support and currently returns 400 if provided.

Errors

See Errors for the full error reference with JSON examples.

StatusCodesCause
400request.invalid_content_type, request.no_files, request.empty_file, request.multiple_files, request.invalid_extension, convert.missing_target_format, convert.unsupported_format_pair, convert.unsupported_source_format, convert.invalid_optionsBad request payload
400url_fetch.missing_source_format, url_fetch.invalid_url, url_fetch.invalid_scheme, url_fetch.private_ip, url_fetch.too_large, url_fetch.timeout, url_fetch.http_error, url_fetch.url_expired, url_fetch.redirect_loop, url_fetch.redirect_denied, url_fetch.invalid_content, url_fetch.mutually_exclusive, url_fetch.output_url_reserved, url_fetch.dns_failure, url_fetch.no_filename, url_fetch.domain_circuit_open, url_fetch.disabledURL fetch error
401api_key.invalid_or_ip_not_allowedInvalid API key or IP not allowlisted
402entitlements.insufficient_creditsNot enough credits
403url_fetch.guest_not_allowedURL input requires a signed-in account
413request.file_too_largeFile exceeds size limit
429rate_limited, queue.limit_exceeded, url_fetch.rate_limitedThrottled

Example — unsupported format pair:

{
  "error": "convert.unsupported_format_pair",
  "detail": "Conversion from 'jpg' to 'mp3' is not supported.",
  "sourceFormat": "jpg",
  "targetFormat": "mp3",
  "supportedTargets": ["avif", "ico", "pdf", "png", "webp"]
}

Example — SSRF blocked (private IP):

{
  "error": "url_fetch.private_ip",
  "detail": "URL resolves to a private or reserved IP address.",
  "isRetryable": false
}
Copied.