Skip to content

fix: allow multiple API keys for OpenAI/Anthropic compatible providers - #1775

Closed
hodtien wants to merge 10 commits into
decolua:masterfrom
hodtien:fix/compatible-provider-multiple-keys
Closed

hodtien wants to merge 10 commits into
decolua:masterfrom
hodtien:fix/compatible-provider-multiple-keys

Conversation

@hodtien

@hodtien hodtien commented Jun 11, 2026

Copy link
Copy Markdown

Summary

  • Remove the one-connection-per-node guard for OpenAI Compatible and Anthropic Compatible providers so each endpoint can hold multiple API key connections.
  • Add explicit node-type validation so a compatible provider id must map to a node of the matching type (rejects misconfigured nodes with 400 instead of silently storing wrong data).
  • Pass defaultModel when bulk-adding API keys for compatible providers (single-add already required it; bulk previously created connections with defaultModel: null).
  • Remove stale "only one connection" copy from the unused page.new.js.

Custom Embedding nodes intentionally keep the single-connection guard (out of scope).

Why

Adding a second API key to a custom Anthropic/OpenAI Compatible provider returned Only one connection is allowed for this Anthropic Compatible node. Each API key is modeled as a separate providerConnection under one providerNode, so the guard was the only thing preventing multi-key endpoints. Removing it (and keeping node existence + type checks) enables multiple keys while preserving routing, priority, active/test status, and per-key model defaults.

Test plan

  • npx vitest run --config tests/vitest.config.js tests/unit/compatible-provider-connections.test.js — 4 passed (multi-key success, node-type mismatch rejection, existing single-connection cases)
  • Full unit suite shows no new regressions (24 pre-existing failures present on base master before this branch; this branch has the same set, none in touched files)
  • Manual: add two API keys to one compatible endpoint via UI (single + bulk), confirm both appear and route

hodtien and others added 6 commits July 9, 2026 12:14
@hodtien hodtien closed this Aug 17, 2026
@hodtien
hodtien deleted the fix/compatible-provider-multiple-keys branch August 17, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant