Repository navigation
fix(api): name working OpenRouter ids when Gemini embed creds are missing - #10565
Merged
diegosouzapw merged 1 commit intoAug 18, 2026
Conversation
…sing Native gemini-embedding-2 400s with a dead-end credentials error even though openrouter/google/gemini-embedding-2 already serves 3072-d vectors. Co-authored-by: Cursor <cursoragent@cursor.com>
5 of 12 tasks
Collaborator
|
Clean, focused fix -- the error-hint tests cover both the Gemini-specific case and confirm unrelated providers keep their short message. Verified no conflict with the other PRs in this batch. Merging as-is; the base-branch CI reds (Docs Gates, Fast Quality Gates, Unit Tests fast-path) are pre-existing release-tip drift unrelated to this diff. |
diegosouzapw
merged commit Aug 18, 2026
134ab8c
into
cheaper-inference:release/v3.8.50
5 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…sing (cheaper-inference#10565) Native gemini-embedding-2 400s with a dead-end credentials error even though openrouter/google/gemini-embedding-2 already serves 3072-d vectors. Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Native
gemini-embedding-2is registered in OmniRoute, but a host without a Google AI Studio key on thegeminiprovider returns a dead-end 400. OpenRouter already serves the same model. This PR only improves that 400 (and the unknown-google400) so operators are told the working ids.This does not add a Gemini API key. Native
gemini-embedding-2still needs ageminiconnection (secrets-only / dashboard). See the secrets note at the bottom.Live evidence (re-verified 2026-08-17, OmniRoute 3.8.49)
Endpoint:
https://<omniroute-host>/v1/embeddingsClients that break: Hindsight 0.9.1 and Memorix 1.6.0 if they are pointed at bare
gemini-embedding-2/gemini/gemini-embedding-2.Actual — native id
Request:
{ "model": "gemini-embedding-2", "input": ["alpha", "beta"] }HTTP 400
{ "error": { "message": "No credentials for embedding provider: gemini", "type": "invalid_request_error", "code": "bad_request" } }gemini/gemini-embedding-2is the same 400.google/gemini-embedding-2is HTTP 400:{ "error": { "message": "Unknown embedding provider: google. No matching hardcoded or local provider found.", "type": "invalid_request_error", "code": "bad_request" } }Actual — working OpenRouter ids (same host, OpenRouter configured)
openrouter/google/gemini-embedding-2→ HTTP 200, 2 vectors, 3072-d, batch 2→2.openrouter/google/gemini-embedding-2-preview→ HTTP 200, 2 vectors, 3072-d.Expected after this PR
Same HTTP 400, but the message names:
openrouter/google/gemini-embedding-2openrouter/google/gemini-embedding-2-previewgeminiprovider is required forgemini/gemini-embedding-2Unrelated providers keep the short message (existing
route-edge-coverageregex still matches).Repro (redact the bearer)
Secrets-only (cannot ship in this PR)
Making native
gemini-embedding-2return 200 requires a Google AI Studio key stored as ageminiprovider connection (dashboard or importedGEMINI_API_KEY). That secret is not in git. Homelabomniroute-secretscurrently injectsJINA_AI_API_KEY, not a Gemini embed key.Related Issues
Validation
node --import tsx/esm --test tests/unit/embeddings-gemini-creds-hint.test.ts(4 pass)node --import tsx/esm --test tests/unit/route-edge-coverage.test.ts(16 pass)Tests Added Or Updated
tests/unit/embeddings-gemini-creds-hint.test.tsCoverage Notes
src/lib/embeddings/errors.tsis fully covered by the new unit file.src/lib/embeddings/service.tsnow calls those helpers on the existing 400 paths;route-edge-coveragestill exercises missing-credentials / unknown-provider.Reviewer Notes
googleis not aliased togeminiglobally — a custom provider_node with prefixgooglealready exists in tests (auth-clear-provider-routes).Made with Cursor