Operations
Each job runs an ordered list of operations against its
source. An operation has a type and a set of options. The SDK ships six
operation types:
| Operation | Does |
|---|---|
compress | Reduce file size for images, video, audio, and documents. |
convert | Change a file's format. |
thumbnail | Generate a preview image. |
merge | Combine several inputs into one output. |
archive | Bundle inputs into a ZIP or tarball. |
watermark | Apply a branding overlay to images and video. |
Do not generalise from the first operation page you read. Each operation
declares its own accepted MIME types, and they genuinely differ — merge
accepts five audio types while compress and convert accept six, because
merge does not take audio/mp4.
The per-operation lists on each page are correct for that page only.
getSchema() returns the authoritative set at runtime, per operation and per
media type, and is the thing to trust if you are deciding programmatically.
Options are media-type specific
The valid option keys for an operation depend on the input's media type: a
JPEG compress accepts different options than a video compress. The file-first
chain knows each input's media type and validates the options before any
upload — so a typo or an option that doesn't apply to the media type is caught
locally rather than coming back as a server 422.
- TypeScript
- PHP
- Python
- Rust
// Validated locally before the file is uploaded.
const result = await client
.compress('./photo.jpg', { quality: 80 })
.run({ maxWait: '5m' });
// Validated locally before the file is uploaded.
$result = $client
->compress('./photo.jpg', ['quality' => 80])
->run(new RunOptions(maxWait: '5m'));
Coming soon — the Python SDK docs land with its content ticket.
Coming soon — the Rust SDK docs land with its content ticket.
The authoritative option set
The contracts are the source of truth for which options each media type
accepts. To fetch the authoritative, per-MIME option list at runtime — for
building a dynamic UI, or to confirm what the API currently supports — call
getSchema() for the input's media type and operation.