Node-RED http request: node headers overwrite msg.headers (Sume key)
Node-RED's http request node lets node-configured headers overwrite msg.headers. Keep Sume's one credential header in the node, per-call headers in the msg.

The answer
Node-RED's help for the http request node says that any headers set in the node configuration overwrite matching headers in msg.headers. So put the Sume credential in the node's own header list, where it cannot be replaced by an upstream message, and put per-request headers such as Idempotency-Key in msg.headers.
Sume wants exactly one credential. Its OpenAPI says to send either Authorization: Bearer sume_live_... or x-api-key: sume_live_..., and that a request carrying both is rejected with 401 unauthorized (Send only one API key credential.). Pick one and leave the other out everywhere.
Which header lives where
Splitting the headers this way keeps the secret in one place and the intent-specific value with the message that needs it.
| Header | Set in | Reason |
|---|---|---|
| Authorization: Bearer <key> | Node configuration | Cannot be overwritten by a message |
| Content-Type: application/json | msg.headers | Same for every call |
| Idempotency-Key | msg.headers | Differs per business intent |
| x-api-key | Not set | Both credentials together give a 401 |
The collision to avoid
Because the node configuration wins, a message that carries its own authorization key is silently replaced for that header. That is the safe direction for a credential, but it means you cannot override the key per message, for example to use a second workspace. For that case use a second node with its own configured header.
The opposite mistake is the 401 case. If a flow template already sets x-api-key in msg.headers and the node adds Authorization, the call fails with the single-credential error. Search your flows for both before you rotate a key.
A short function node
The function below sets only the message-level headers. The node's configured Authorization header is not repeated here.
msg.headers = {
"content-type": "application/json",
"idempotency-key": "invoice-" + msg.invoiceId + "-r1",
};
msg.url = "https://api.sume.com/v1/images";
msg.method = "POST";
msg.payload = { model: "sume/auto", mode: "async", prompt: msg.prompt };
return msg;Rotating the key
Because the credential lives in one node, rotating a Sume key is a one-place change: create the new key in the dashboard, paste it into the node's header, deploy, then revoke the old one. Sume API responses never return the full secret key, so the dashboard is the only place you see it at creation time; store it straight into the node.
If you run several environments, keep one configured node per environment rather than one node with message-level overrides, which the precedence rule would ignore.
Testing the header split
Check the split with a harmless read before trusting it with a paid submit. Point a request node at https://api.sume.com/v1/me with only the Authorization header configured in the node, and feed it a message that also sets an authorization header with a wrong value in msg.headers. Per the node help, the configured header overwrites the matching message header, so the call should succeed and msg.statusCode should be 200.
Then flip the test: remove the node-level header and keep the message-level one. If the call now works with a valid key in the message, you have confirmed the second half of the rule, that message headers are used when the node does not configure the same header. Delete the test message afterwards so the key is not left in a flow.
Finally send both authorization and x-api-key once on purpose and confirm the 401 single-credential response. Seeing that error in a controlled test makes it much easier to recognise in a real flow.
Sources
Related posts
More in Developers
- Node-RED http request node: submit a Sume job and branch on statusCode
Node-RED's http request node returns payload, statusCode and headers. Wire a Sume submit, branch on 202 vs errors, and keep the job id for the status read.
- og:image width, height and alt tags for an AI image from Sume
Open Graph has optional og:image:width, og:image:height and og:image:alt. Read the real size from a Sume render with Pillow and print all three tags.
- One reference image on Seedance 2.5 is not a first frame
On /v1/videos, input_references steer a generation; frame_images pin frames. Send one image the wrong way and the clip does not start on your picture.
- One request for four Sume video models: 1080p, 5 to 10 s, 16:9 or 9:16
Kling 3, Wan 3.0, H3 Max and Omni share one request shape: 1080p, 5 to 10 seconds, 16:9 or 9:16. Compute the intersection in Python and price each model.
Written by Sume