Repository navigation
Add optional modelID input for custom API Key Providers testing - #315
Merged
Merged
Conversation
- 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
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 |
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
4 tasks done
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.