curl and jq script to test a new Sume image model id in one command

A 6-line shell script that posts one prompt to Sume POST /v1/images for any model id and prints the url, cost and status, to vet a gpt-image-1 replacement fast.

5 min readSume
All posts

To test a replacement for a retiring image model, run one script that takes the model id as an argument, posts a prompt to POST https://api.sume.com/v1/images, and prints the image URL, usage.cost and status. It uses only curl and jq, so it works on a laptop or in a CI step. Run it once per candidate id and compare.

The script does not use --fail, so a 404 model_not_found or 400 unsupported_parameter body is printed instead of swallowed.

The script

Save it as try-model.sh and make it executable. A 202 response has the job envelope under data, so the script prints status_url from there when data is not a list.

#!/usr/bin/env bash
set -euo pipefail
MODEL="${1:?usage: try-model.sh <model-id> [prompt]}"
PROMPT="${2:-a ceramic mug on linen, soft window light}"
curl -sS https://api.sume.com/v1/images \
  -H "Authorization: Bearer ${SUME_API_KEY:?set SUME_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg m "$MODEL" --arg p "$PROMPT" '{model:$m,prompt:$p}')" |
  jq 'if (.data|type)=="array" then {url: .data[0].url, cost: .usage.cost}
      elif (.data|type)=="object" then {pending: .data.status_url}
      else . end'

Ids to try first

Candidates for a gpt-image-1 replacement, Sume ids read 2026-10-06
CommandWhat it tests
./try-model.sh openai/gpt-image-2.5-sunburstThe vendor-named replacement
./try-model.sh openai/gpt-image-2.5Flare variant
./try-model.sh google/nano-banana-2A different family
./try-model.sh gpt-image-1Expect 404 model_not_found

What to compare

Compare the printed cost, which is the billed USD, and open each URL beside the old output. Then record the winning id in config, as in the model-map post. To test many prompts, loop over a file, and for parameters that differ per model see the preflight post. The shutdown dates are in the main post.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume