You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add api/ and oauth/ model entries with API key and OAuth labels. Preserve full routed IDs for chat and media requests.
API-key routes skip subscription quota lookup. OAuth routes retain alias-aware quota handling. Document the CLIProxyAPI v8 prefix setup and configuration migration.
Summary by CodeRabbit
New Features
Added support for selecting OAuth- and API-key-routed models and media using oauth/ and api/ prefixes. These routes are labeled by authentication type, and recognized model aliases can use their canonical model metadata.
Improved quota handling for OAuth-routed models while keeping API-key billing and rate errors from triggering OAuth quota checks or route fallback.
Documentation
Expanded setup guidance for OAuth and API-key routes, including route labels, model IDs, proxy configuration, and refresh and selection steps.
Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.
Summary
Adds separate api/ and oauth/ model entries while keeping full advertised IDs on requests.
Chat model routes show which credential the proxy will use.
Claude quota checks follow API-key and OAuth routes separately.
Supported media models can use API-key and OAuth routes.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Advertised model ID] --> B[Resolve metadata and route label]
B --> C[Chat request]
B --> D[Media request]
C --> E[Send full advertised ID]
D --> E
C --> F{Claude quota error}
F --> G[API route: response-based wait only]
F --> H[OAuth route: matching subscription lookup]
G --> I[Retry same full ID]
H --> I
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: a07241ed-8b40-4709-9087-f21d8a801e60
📥 Commits
Reviewing files that changed from the base of the PR and between a37d56d and b7b557a.
📒 Files selected for processing (7)
README.md
src/catalog.ts
src/claude-quota.ts
src/media-defaults.ts
src/provider.ts
test/auth-routes.test.ts
test/provider.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
Walkthrough
The change adds api/ and oauth/ model routes to catalog mapping and provider handling. It also updates media selection, Claude quota lookup, tests, and documentation for route labels, configuration, and selection.
Changes
Credential-prefixed model routes
Layer / File(s)
Summary
Route recognition and catalog mapping src/catalog.ts, src/media-defaults.ts, test/auth-routes.test.ts, test/provider.test.ts, README.md
The catalog recognizes api/ and oauth/ prefixes and uses metadata aliases for routed IDs. Media selection and picker tests cover these prefixes. The README documents supported routes, aliases, and route configuration.
Route-aware provider execution and quota handling src/claude-quota.ts, src/provider.ts, test/provider.test.ts, README.md
The provider applies route-aware Google adaptation and excludes API-key routes from live Claude quota handling. Tests cover API-key and OAuth request behavior, quota lookup, and other prefixed-model paths. The refresh-scope version changes from 4 to 5; the README describes route-specific quota behavior.
sequenceDiagram
participant Client
participant Provider
participant ManagementAPI
participant MessagesAPI
Client->>Provider: Request using a prefixed model ID
alt API-key route
Provider->>MessagesAPI: Send full api/ model ID
MessagesAPI-->>Provider: Return upstream response
else OAuth route
Provider->>ManagementAPI: Look up Claude quota
ManagementAPI-->>Provider: Return quota status
Provider->>MessagesAPI: Send full oauth/ model ID
MessagesAPI-->>Provider: Return upstream response
end
Provider-->>Client: Return response or quota result
Loading
Merge Risk:⚪ Minimal · up to b7b55
This change adds OAuth and API-key model routes with route-specific quota handling and documentation. No concrete merge-blocking risk was found.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 6 files. (1 skipped: 1…
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: adding OAuth and API-key model routes.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 6 files. (1 skipped: 1 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
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.
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
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.
Add
api/andoauth/model entries with API key and OAuth labels. Preserve full routed IDs for chat and media requests.API-key routes skip subscription quota lookup. OAuth routes retain alias-aware quota handling. Document the CLIProxyAPI v8 prefix setup and configuration migration.
Summary by CodeRabbit
oauth/andapi/prefixes. These routes are labeled by authentication type, and recognized model aliases can use their canonical model metadata.
Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Adds separate
api/andoauth/model entries while keeping full advertised IDs on requests.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Advertised model ID] --> B[Resolve metadata and route label] B --> C[Chat request] B --> D[Media request] C --> E[Send full advertised ID] D --> E C --> F{Claude quota error} F --> G[API route: response-based wait only] F --> H[OAuth route: matching subscription lookup] G --> I[Retry same full ID] H --> IReviews (1) · Last reviewed commit: "Add OAuth and API-key model routes" · Reviewed by Greptile