Repository navigation
feat(provider): add xxapi - #2479
Conversation
Disabled built-in OpenAI-compatible provider for https://xxapi.ai/v1 with live /models discovery, the xxapi swift icon (mono) and focused defaults and registry tests.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Provider configuration and tests src/main/provider/defaults.ts, src/main/provider/providerRegistry.ts, test/main/provider/defaultProviders.test.ts, test/main/provider/basicApiKeyProviders.test.ts |
The defaults and registry define XXAPI as an OpenAI-compatible, API-key provider with embeddings disabled. Tests check its configuration and provider definition. |
Provider icon mapping src/renderer/src/components/icons/modelIconRegistry.ts |
The registry imports the XXAPI icon, maps it to the xxapi provider key, and includes it in the monochrome icon set. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Feature
Suggested reviewers: zerob13
Merge Risk: 
Minimal · up to c8381
-
The disabled XXAPI provider registration and icon can be merged without an identified actionable risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "feat(provider): add xxapi" states the main change. The PR adds xxapi as a disabled-by-default, OpenAI-compatible provider. The change touches the defaults entry, the registry entry, the icon mapping, and the tests, and all of these support the same provider addition. The title is concise, specific, and follows a conventional commit style. It does not describe unrelated work.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
zerob13
left a comment
There was a problem hiding this comment.
Verdict: approve. No blocking findings.
This adds xxapi as a disabled built-in provider and touches only the six files that provider listings normally touch: defaults, registry, icon, icon registry, and two tests. It is additions only — no existing line is changed. The shape matches #2464 (AtmoRouter), which is the smallest of the recent provider PRs.
What I checked, and why it is fine:
- Registration resolves correctly.
xxapipicks up the existing OpenAI-compatible runtime withcredentialStrategy: 'api-key'andembeddingStrategy: 'none', so it inheritsmodelSource: 'openai'andcheckStrategy: 'fetch-models'fromOPENAI_BASE. No custom adapter, no new branch inaiSdkProvider.ts, no provider-db entry — all of which would have been unnecessary for a plain relay. - Model discovery needs a key, so the check is meaningful.
GET https://xxapi.ai/v1/modelsreturned 401 without a key during review, sofetch-modelswill reject a bad key instead of silently passing. That justifies not adding a generate-text check. defaultBaseUrlis derived, not duplicated.DEFAULT_PROVIDERSfillswebsites.defaultBaseUrlfrombaseUrl; the test asserting it is checking the derived value, not a second hand-written copy.- Icon wiring is complete. The SVG is a single
currentColorpath, registered inmodelIconsand inmonoIconUrlsso it inverts in dark mode. - Tests and formatting. I ran the two touched suites in the PR worktree with this repo's dependencies: 87 tests pass, including both new cases.
oxfmt --checkis clean on all changed files.
Non-blocking notes:
- The
modelswebsite field points at the pricing page. That is consistent with your description (the model list lives there), but it differs from peers such asyapi, which use a dedicated model page. Fine to keep. - The README provider grid was not updated. CloudGPU and Runcrate did add rows; AtmoRouter, Y-API and apimodels did not, so this is not a requirement — just be aware the listing is discoverable in Settings but not on the README grid.
- Your PR body says the
basicApiKeyProviders.test.tscase was never executed because the AI SDK stack was not installed. It does run — it is included in the 87 passing tests above, so that gap is closed. - This is a self-submitted relay listing with the disclosure stated. The provider stays disabled by default and offers no embeddings endpoint, so nothing changes for existing users until they opt in.
I also approved the two action_required workflow runs (PR Check, Package Check) so CI can run; they were queued when this review was posted.
Review scope and evidence
- Worktree: detached checkout of
c83814af44081ec786163d3bdb45c40abf949fb2(branchfeat/provider-xxapi, basedev). - Diff scope: 6 files, +66/-0 —
src/main/provider/defaults.ts,src/main/provider/providerRegistry.ts,src/renderer/src/assets/llm-icons/xxapi.svg,src/renderer/src/components/icons/modelIconRegistry.ts,test/main/provider/basicApiKeyProviders.test.ts,test/main/provider/defaultProviders.test.ts. - Comparisons: commit
28835548e(AtmoRouter, 6 files/+66),9621a9354(Runcrate, 9 files),c70f7f1f4(CloudGPU, 11 files). - Commands:
pnpm exec vitest run --config vitest.config.ts test/main/provider/defaultProviders.test.ts test/main/provider/basicApiKeyProviders.test.ts→ 2 files, 87 tests passed;pnpm exec oxfmt --check <changed files>→ clean. - Endpoint probes:
https://xxapi.ai/v1/models→ 401 without key (as described),https://xxapi.ai/→ 200,https://docs.xxapi.ai/getting-started→ 200.
Adds xxapi as a disabled built-in OpenAI-compatible provider, in the same shape as Y-API (#2393) and AtmoRouter (#2464): a defaults entry, a registry entry, an icon and two focused tests. Insertions only; no existing line changes.
xxapi (https://xxapi.ai) is a pay-as-you-go API relay for Claude and GPT models.
defaults.ts:xxapi, base URLhttps://xxapi.ai/v1, disabled by default. Keys at https://xxapi.ai/keys, getting-started guide at https://docs.xxapi.ai/getting-started, model list and prices at https://xxapi.ai/pricing.providerRegistry.ts:...OPENAI_BASEwithcredentialStrategy: 'api-key'andembeddingStrategy: 'none', so it resolves to the existingopenai-compatibleruntime withmodelSource: 'openai'andcheckStrategy: 'fetch-models'. No embeddings endpoint is offered.GET /v1/modelsneeds a key: on 2026-10-28,/v1/modelsand/v1/chat/completionsreturned 401 without a valid key, so thefetch-modelscheck rejects a bad key. Each key belongs to one plan and/v1/modelslists the models that key can call.currentColorSVG, registered with the mono icons so it inverts in dark mode.Validation:
test/main/provider/defaultProviders.test.tspassed locally with Vitest 4.1.10, including the new case. The newbasicApiKeyProviders.test.tscase imports the full AI SDK stack, which I didn't install, so I ran the same assertion in a throwaway file againstproviderRegistry.ts(passed, file deleted). I did not run format, lint or typecheck locally; the added lines follow the surrounding style (single quotes, no semicolons, under 100 columns).Disclosure: I run xxapi, so this is a self-submitted listing. Prepared with AI assistance (Claude Code).
Summary by CodeRabbit