Skip to content

Add optional modelID input for custom API Key Providers testing - #315

Merged
decolua merged 2 commits into
decolua:masterfrom
moophat:master
Mar 16, 2026
Merged

decolua merged 2 commits into
decolua:masterfrom
moophat:master

Conversation

@moophat

@moophat moophat commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Some custom provider (for example the recently emerged Ali cloud and some local ones) do not implement /models endpoint. Current "Check" process only do a quick fetch to /models so the error can be confusing even though the provider DO work. Added a field to allow user to configure exact model ID, and add some more meaningful error message.

moophat added 2 commits March 15, 2026 03:35
- If /models endpoint unavailable, validate via /chat/completions
- Add optional Model ID input in EditCompatibleNodeModal
- Improves compatibility with providers lacking /models endpoint
- Add Model ID input for chat/completions fallback validation
- Reorder UI: API Key → Model ID → Check button + Badge
- Display detailed BE error messages in FE
- Add status-specific error handling (401/403/400/404/5xx)
- Add unit tests for error message helpers
- Add vitest devDependency
@decolua
decolua merged commit 65af432 into decolua:master Mar 16, 2026
@decolua

decolua commented Mar 16, 2026

Copy link
Copy Markdown
Owner

Thank you so much @moophat for this contribution! 🎉 The modelId fallback for provider validation is a great improvement — it's a real pain point for providers that don't expose a /models endpoint. Really appreciate the clean implementation and the detailed error handling. Welcome to keep contributing! 🙏

kwanLeeFrmVi pushed a commit to kwanLeeFrmVi/9router that referenced this pull request Mar 16, 2026
…lua#315)

* feat: add modelId fallback for provider validation

- If /models endpoint unavailable, validate via /chat/completions
- Add optional Model ID input in EditCompatibleNodeModal
- Improves compatibility with providers lacking /models endpoint

* feat: improve provider validation with modelId fallback

- Add Model ID input for chat/completions fallback validation
- Reorder UI: API Key → Model ID → Check button + Badge
- Display detailed BE error messages in FE
- Add status-specific error handling (401/403/400/404/5xx)
- Add unit tests for error message helpers
- Add vitest devDependency
idbara pushed a commit to idbara/9router that referenced this pull request Apr 23, 2026
…lua#315)

* feat: add modelId fallback for provider validation

- If /models endpoint unavailable, validate via /chat/completions
- Add optional Model ID input in EditCompatibleNodeModal
- Improves compatibility with providers lacking /models endpoint

* feat: improve provider validation with modelId fallback

- Add Model ID input for chat/completions fallback validation
- Reorder UI: API Key → Model ID → Check button + Badge
- Display detailed BE error messages in FE
- Add status-specific error handling (401/403/400/404/5xx)
- Add unit tests for error message helpers
- Add vitest devDependency
luckystart79-lang pushed a commit to luckystart79-lang/minirouter that referenced this pull request May 2, 2026
…lua#315)

* feat: add modelId fallback for provider validation

- If /models endpoint unavailable, validate via /chat/completions
- Add optional Model ID input in EditCompatibleNodeModal
- Improves compatibility with providers lacking /models endpoint

* feat: improve provider validation with modelId fallback

- Add Model ID input for chat/completions fallback validation
- Reorder UI: API Key → Model ID → Check button + Badge
- Display detailed BE error messages in FE
- Add status-specific error handling (401/403/400/404/5xx)
- Add unit tests for error message helpers
- Add vitest devDependency
caothu159 pushed a commit to diepxuan/9router that referenced this pull request May 14, 2026
…lua#315)

* feat: add modelId fallback for provider validation

- If /models endpoint unavailable, validate via /chat/completions
- Add optional Model ID input in EditCompatibleNodeModal
- Improves compatibility with providers lacking /models endpoint

* feat: improve provider validation with modelId fallback

- Add Model ID input for chat/completions fallback validation
- Reorder UI: API Key → Model ID → Check button + Badge
- Display detailed BE error messages in FE
- Add status-specific error handling (401/403/400/404/5xx)
- Add unit tests for error message helpers
- Add vitest devDependency
diegosouzapw pushed a commit to diegosouzapw/OmniRoute that referenced this pull request Jun 21, 2026
Some custom OpenAI/Anthropic-compatible providers (Ali Cloud, local
inference servers, etc.) do not implement /models. The "Check" button
in the Add/Edit Compatible Provider modals would surface a generic
"Invalid API key" even when the credentials worked, because the probe
only hit /models.

This change adds an optional "Model ID" input next to the API-key
check. When supplied and /models fails with anything other than 401/403,
the validate route falls back to POST /chat/completions with that model
and a one-token ping. Auth failures (401/403) still short-circuit — a
chat fallback there would only reconfirm unauthorized.

Error messages are now status-aware (e.g. 404 from /models suggests
entering a model ID), and the response includes method:"chat" when the
fallback was used so the UI can surface which probe succeeded.

Ports decolua/9router#315 to TypeScript and routes the call through
safeOutboundFetch / providerOutboundGuard so SSRF protection still
applies to the chat fallback.

Inspired-by: decolua/9router#315
Co-authored-by: Doan Minh Tu <minhtu.workmail@gmail.com>
diegosouzapw pushed a commit to diegosouzapw/OmniRoute that referenced this pull request Jun 21, 2026
Some custom OpenAI/Anthropic-compatible providers (Ali Cloud, local
inference servers, etc.) do not implement /models. The "Check" button
in the Add/Edit Compatible Provider modals would surface a generic
"Invalid API key" even when the credentials worked, because the probe
only hit /models.

This change adds an optional "Model ID" input next to the API-key
check. When supplied and /models fails with anything other than 401/403,
the validate route falls back to POST /chat/completions with that model
and a one-token ping. Auth failures (401/403) still short-circuit — a
chat fallback there would only reconfirm unauthorized.

Error messages are now status-aware (e.g. 404 from /models suggests
entering a model ID), and the response includes method:"chat" when the
fallback was used so the UI can surface which probe succeeded.

Ports decolua/9router#315 to TypeScript and routes the call through
safeOutboundFetch / providerOutboundGuard so SSRF protection still
applies to the chat fallback.

Inspired-by: decolua/9router#315
Co-authored-by: Doan Minh Tu <minhtu.workmail@gmail.com>
diegosouzapw pushed a commit to diegosouzapw/OmniRoute that referenced this pull request Jun 22, 2026
Some custom OpenAI/Anthropic-compatible providers (Ali Cloud, local
inference servers, etc.) do not implement /models. The "Check" button
in the Add/Edit Compatible Provider modals would surface a generic
"Invalid API key" even when the credentials worked, because the probe
only hit /models.

This change adds an optional "Model ID" input next to the API-key
check. When supplied and /models fails with anything other than 401/403,
the validate route falls back to POST /chat/completions with that model
and a one-token ping. Auth failures (401/403) still short-circuit — a
chat fallback there would only reconfirm unauthorized.

Error messages are now status-aware (e.g. 404 from /models suggests
entering a model ID), and the response includes method:"chat" when the
fallback was used so the UI can surface which probe succeeded.

Ports decolua/9router#315 to TypeScript and routes the call through
safeOutboundFetch / providerOutboundGuard so SSRF protection still
applies to the chat fallback.

Inspired-by: decolua/9router#315
Co-authored-by: Doan Minh Tu <minhtu.workmail@gmail.com>
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.

2 participants