How to hit the Adobe Firefly Services API

Adobe Firefly Services include the Firefly image-generation API at https://firefly-api.adobe.io, plus Photoshop and Lightroom APIs. Get a token from Adobe IMS first; every call then sends both the token and your client id.

Authentication

Create a project with Firefly Services credentials in the Adobe Developer Console. The token call uses the client id and secret; the returned access_token is {{ADOBE_ACCESS_TOKEN}}, and the client id also goes in x-api-key. Lightroom and Photoshop API edits read and write files through storage URLs (e.g. presigned S3), not uploads.

Full reference: https://developer.adobe.com/firefly-services/docs/firefly-api/guides/

Get an access token

Scope list from Adobe's guide.

curl -X POST https://ims-na1.adobelogin.com/ims/token/v3 \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id={{ADOBE_CLIENT_ID}}&client_secret={{ADOBE_CLIENT_SECRET}}&scope=openid,AdobeID,session,additional_info,read_organizations,firefly_api,ff_apis"
Run in PostTaco

Generate an image

Asynchronous: returns a job to poll.

curl -X POST https://firefly-api.adobe.io/v3/images/generate-async \
  -H "x-api-key: {{ADOBE_CLIENT_ID}}" \
  -H "Authorization: Bearer {{ADOBE_ACCESS_TOKEN}}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"prompt": "a realistic illustration of a cat coding"}'
Run in PostTaco