convert_file
Convert a file from a URL
End-to-end conversion of a remote file: fetches 'source_url' (with SSRF protection), uploads it to FileConvert, and starts a conversion from 'source_format' to 'target_format' (named by extension, e.g. png → webp, docx → pdf). Returns the conversion 'job_id' and the uploaded 'file_id'. Poll progress with get_job_status(job_id); when the status is Completed, call get_download_url(job_id) for the result. Conversions consume account credits. For a file you hold locally, use upload_file + start_conversion instead.
输入参数source_url必填format_typesource_formattarget_formatformat_type_idsource_format_idtarget_format_idadditional_arguments
get_balance
Show remaining credits
Returns the credit balance of the signed-in account, plus where to get more. Every conversion costs credits; call this when a conversion fails with 'no credits' or when the user asks how many conversions they have left.
无需输入参数。
get_download_url
Get a download URL for a converted file
Returns the download URL of a converted file. Pass 'job_id' (conversion uid) to resolve the converted file of a finished conversion, or 'file_id' to download a known file uid directly. The URL needs no authentication (the unguessable file id is the capability), so it can be handed to the user or another system as-is. It stops working when the file's retention ends — about one hour after conversion by default — so download or share it promptly.
输入参数job_idfile_id
get_job_status
Get conversion job status
Returns the current status of a conversion job. Statuses: Pending → Processing → Completed or Failed (Failed includes the reason). Poll every 2–3 seconds after convert_file / start_conversion; when Completed, call get_download_url. Also returns the full conversion object, which includes the converted file uid once the job has finished.
输入参数job_id必填
get_upload_url
Get file upload instructions
Returns instructions for uploading an agent-local file into FileConvert. FileConvert does NOT use presigned upload URLs; instead you upload the file bytes directly to the gateway as a multipart/form-data POST. The response gives the exact URL, HTTP method, form field name and required Authorization header. After uploading you receive a file object whose 'uid' can be passed to a conversion. If your file is reachable over http(s), prefer convert_file(source_url, target_format) which fetches and uploads it for you. Works without a token (the upload itself needs one).
输入参数filename必填
list_formats
List supported file formats
Returns the file formats FileConvert can read and write, along with the format-type categories (image, video, document, audio, …). Use this first to discover valid 'format_type', 'source_format' and 'target_format' identifiers before calling convert_file. Each format includes its numeric id, name, file extension and description. Optionally pass 'format_type' to filter to a single category. Works without a token.
输入参数format_type
start_conversion
Convert an already uploaded file
Starts a conversion of a file that is already in FileConvert (a 'file_id' from upload_file or from an earlier job) from 'source_format' to 'target_format' (named by extension). Returns the 'job_id' to poll with get_job_status. Conversions consume account credits.
输入参数file_id必填format_typesource_formattarget_formatformat_type_idsource_format_idtarget_format_idadditional_arguments
upload_file
Upload a file you hold locally
Uploads file bytes (base64) into FileConvert and returns a 'file_id'. Use this when the file is not reachable by URL, then call start_conversion(file_id, source_format, target_format). For files reachable over http(s), convert_file is a single call instead.
输入参数filename必填content_base64必填