Apple Shortcuts: generate a Sume image with Get Contents of URL

Build a Shortcut that POSTs JSON to Sume's /v1/images and shows the result: Get Contents of URL, a JSON body, a bearer header, and a check for the 202 case.

4 min readSume
All posts

Use the Get Contents of URL action. Apple's Shortcuts guide says it supports GET, POST, PUT, PATCH and DELETE, and that for POST, PUT and PATCH you add a Request Body that can be JSON, a Form or a File. That is all POST https://api.sume.com/v1/images needs.

The Sume image docs give the call: a bearer key in the Authorization header and a JSON body with model and prompt. The response has data[].url, a hosted link to the image.

Which actions do I add?

  • Get Contents of URL: URL https://api.sume.com/v1/images, Method POST.
  • Headers: Authorization set to Bearer plus your key, and Content-Type set to application/json.
  • Request Body: JSON, with model text openai/gpt-image-2.5, prompt text from Ask for Input, and quality text low for drafts.
  • Get Dictionary Value for data, then Get Item from List (first), then Get Dictionary Value for url.
  • Get Contents of URL again on that url (a plain GET), then Show Result or Save to Photo Album.

Where does a Shortcut trip on Sume?

The call waits up to 30 seconds. If the job is still running, Sume returns 202 with a job envelope and no data array, so Get Dictionary Value for data comes back empty and the Shortcut looks broken. Add an If action that checks whether the result has a data value, or send quality: "low" to keep drafts fast. The jobs guide shows the status_url to poll when you do hit 202.

Treat the key like a password. A Shortcut shared as a link carries the header with it, XX with an Ask for Input action for the key instead of a stored string.

The request body

This is the JSON the Request Body field builds, written out so you can compare it with what the app shows.

{
  "model": "openai/gpt-image-2.5",
  "prompt": "a watercolor lighthouse at dusk",
  "quality": "low",
  "output_format": "jpeg"
}

Pinning output_format to jpeg gives you a file that every Apple app opens without questions, and the docs list jpeg as an accepted value. The billed amount is in usage.cost on a 200 response, in USD, which you can pass to Show Result for a running tally.

To keep a copy, add Save File after the second Get Contents of URL. Sume-hosted URLs are meant for use in your own pipeline, so download the file into your own storage in the same Shortcut instead of leaning on the link in a note or a message days later.

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume