eca icon indicating copy to clipboard operation
eca copied to clipboard

Docs/UI: warn clearly when API keys or env vars override login/subscription auth

Open christophe-gouel opened this issue 6 months ago • 3 comments

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

ECA seems to prefer API-key-based auth over login/subscription auth for providers like OpenAI and Anthropic, when the key comes from environment variables such as OPENAI_API_KEY or ANTHROPIC_API_KEY.

I ran into this unexpectedly and consumed paid API credits before realizing that ECA was not using my logged-in subscription auth.

What I found

On the docs page below, there is only a brief and fairly buried note:

  • https://eca.dev/config/models/

In the “Credential File Authentication” section, under “Notes”, it says:

Authentication priority (short): key (with dynamic string pase support) > OAuth.

This is too indirect to make the behavior clear in practice, especially because:

  • the docs do not clearly say that OPENAI_API_KEY / ANTHROPIC_API_KEY can override login/subscription auth
  • there does not seem to be an obvious warning during /login when both auth sources are available

Why this matters

This can lead to unexpected paid usage. A user may think they are using their subscription login, while ECA is actually using a paid API key from the environment.

Suggested improvements

Any of the following would help:

  1. Documentation

    • Add an explicit warning in config/models:
      • if API keys are configured, including through environment variables, they may take precedence over OAuth/login auth
      • mention the common env vars explicitly: OPENAI_API_KEY, ANTHROPIC_API_KEY
  2. Login/UI warning

    • During /login, warn if a key/env-based auth source already exists for that provider
    • Example: “An API key is already configured/resolved for this provider and may take precedence over login auth.”
  3. Optional confirmation

    • If both login auth and API-key auth are available, ask which one should be preferred

christophe-gouel avatar Jun 03 '26 07:06 christophe-gouel

Sorry for that @christophe-gouel, will take a look and try to improve those!

ericdallo avatar Jun 03 '26 14:06 ericdallo

@christophe-gouel improved docs + warning on /login, thank you!

ericdallo avatar Jun 03 '26 14:06 ericdallo

Excellent. Thanks a lot @ericdallo @ericdallo!

christophe-gouel avatar Jun 03 '26 14:06 christophe-gouel