Explicit key vs saved login: auth order in the Sume CLI
The Sume docs state no precedence between a saved login and an env key. Here is what they do say about saved login, env keys, auth mode and the two-header 401.

Sume's docs do not state a precedence order between a saved sume login key and SUME_API_KEY, so do not rely on one. What they do state is that the CLI defaults to x-api-key, and that any request carrying both Authorization: Bearer and x-api-key fails with 401 unauthorized.
Why precedence matters
A saved login and an environment key can both exist on one machine, for example a laptop that runs sume login and also exports SUME_API_KEY for a script. If you cannot tell which one a command used, spend and audit trails are harder to read. Set one explicitly in each environment.
What the Sume docs say
sume login opens a device approval page, waits, and stores a CLI-scoped API key in ~/.sume-com/config.json by default. SUME_API_KEY is documented for CI and server automation, SUME_API_AUTH_MODE is x-api-key or bearer, and SUME_CONFIG_DIR overrides the config directory.
sume auth status shows login state and sume doctor --agent --json inspects local readiness without calling the API. Never print or commit SUME_API_KEY or the config file.
A setup that does not depend on precedence
Make one credential the only one in each environment.
- Laptop: run
sume loginand leaveSUME_API_KEYunset. - CI: set
SUME_API_KEYfrom a secret manager, and pointSUME_CONFIG_DIRat an empty temporary directory so no stale login can be read. - Run
sume auth statusat the start of a job and fail fast if it is not what you expect. - Do not add an
Authorizationheader to the same requests; send exactly one credential.
The two-header trap
The API docs say neither header wins when both are present, and the second does not shadow the first. The result is a 401 with the message Send only one API key credential. The usual cause is a gateway or fetch wrapper that adds its own Authorization header. Strip one rather than hunting for a precedence rule that does not exist.
Sources
Related posts
More in Developers
- FCC caption display settings, August 2026: burned-in captions
The FCC's caption display settings rule had an August 17, 2026 compliance date. Burned-in captions are pixels in the video; how to add them with Sume's API.
- Fit narration to a fixed slot: measure first, then set TTS speed
A 45-second cap or a 30-second slot decides your script. Render once with word timings, compute the speed ratio, and rewrite only if outside 0.6 to 1.5.
- format_not_forkable 409 in the Sume API: what it means and the fix
Sume returns 409 format_not_forkable when the id you called names a built-in capability, not a Format card. How to tell, and which ids to call instead.
- Gemini 3.8 Live audio: wrap 24 kHz PCM in WAV, resample to 16 kHz
Gemini 3.8 Live takes 16-bit 16 kHz PCM in and returns 24 kHz out. A Python WAV wrapper, an ffmpeg resample command, and the Sume detach settings that match.
Written by Sume