curl --json: submit a Wan 3.0 video to Sume in one flag
curl 7.82 and later has --json, which sets the body and the JSON headers for you. A Wan 3.0 submit with an Idempotency-Key, then a status poll with jq.

curl --json '<body>' is shorthand for sending the data with Content-Type: application/json and Accept: application/json, and it keeps the body byte-for-byte like --data-binary. It arrived in curl 7.82.0. On curl 8.7.1 it replaced a three-flag submit with one. The sample below posted to a local stand-in server that answers 202; the same call works against https://api.sume.com.
Sume wants exactly one credential header, so pass x-api-key and leave Authorization off.
Submit
A five-second Wan 3.0 clip at 480p costs $0.3125 on Sume (provider list $0.05 a second, x 1.25). The Idempotency-Key makes a retry of this exact call return the same job.
curl -s https://api.sume.com/v1/videos \
-H "x-api-key: $SUME_API_KEY" \
-H 'Idempotency-Key: kite-json-1' \
--json '{"model":"wan-3.0","prompt":"a red kite","duration":5,"resolution":"480p"}'What comes back
A 202 with id, polling_url, status (pending) and model. Capture the id and poll.
ID=$(curl -s https://api.sume.com/v1/videos --json @body.json -H "x-api-key: $SUME_API_KEY" \
-H 'Idempotency-Key: kite-json-2' | jq -r .id)
curl -s "https://api.sume.com/v1/videos/$ID" -H "x-api-key: $SUME_API_KEY" | jq -r .statusCaveats
Older curl (before 7.82) rejects --json; fall back to -H 'content-type: application/json' --data-binary. A prompt with quotes or backslashes breaks hand-written JSON on the command line, so build the body with jq -n --arg and pass the file (see the related jq post). Statuses to poll for are pending, in_progress, completed, failed and cancelled.
Sources
Related posts
More in Developers
- curl -K config file: keep your Sume API key out of ps output
A key passed with -H shows in ps args and shell history. curl -K reads headers from a chmod 600 file instead. Tested on curl 8.7.1 against a stub.
- Cursor project .cursor/mcp.json or global ~/.cursor/mcp.json for Sume?
Put a URL-only Sume entry in .cursor/mcp.json to share it with a repo, and keep any API key in an env variable in the global file, not in git.
- Cut a 10-minute recording into 3-minute Reels with video trim
A 600 s recording becomes four trims: 180, 180, 180 and 60 s, $0.08 in total. Python loop with a safe Idempotency-Key per segment; run it with an imported file.
- Cut a YouTube Short on the beat: BPM to cut times in Python
Turn a music bed's BPM into cut start times for a 30-second Short. Runnable Python, plus the $0.10 Timeline render and $0.125 bed.
Written by Sume