Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions server/dist/providers/google.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ export declare class GoogleProvider extends BaseProvider {
createSpeech(apiKey: string, request: SpeechRequest, modelId: string): Promise<SpeechResult>;
createRealtimeSession(apiKey: string, request: RealtimeSessionRequest, modelId: string): Promise<RealtimeSessionResponse>;
streamChatCompletion(apiKey: string, messages: ChatMessage[], modelId: string, options?: CompletionOptions): AsyncGenerator<ChatCompletionChunk>;
/**
* Liveness only — this proves the key authenticates, NOT that its project may
* run inference.
*
* Verified 2026-08-23 across 16 live keys: a project answering
* "403: Your project has been denied access" on generateContent still returns
* 200 from both `GET /models` and `countTokens`, so neither free endpoint can
* detect the denial. Only generateContent can, and health.ts sweeps every 5
* minutes — probing it here would burn ~4,600 free-tier requests a day just
* to check keys.
*
* The denial is caught where it actually surfaces instead: classifyProviderError
* maps it to an auth failure with a key-scoped 24h cooldown, so one 403 benches
* that credential across every model rather than once per model.
*/
validateKey(apiKey: string): Promise<boolean>;
}
//# sourceMappingURL=google.d.ts.map
2 changes: 1 addition & 1 deletion server/dist/providers/google.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions server/dist/providers/google.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/dist/providers/google.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions server/dist/routes/proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/dist/routes/proxy.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions server/dist/services/model-sweeps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/dist/services/model-sweeps.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions server/dist/services/provider-errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ export interface ClassifiedProviderError {
retryable: boolean;
skipModel: boolean;
keyCooldownMs: number;
/**
* How wide the cooldown should be. 'model' benches the credential for the
* one model that failed; 'key' benches it for every model on the platform,
* which is the only correct scope when the failure is a property of the
* account rather than the model.
*/
cooldownScope?: 'model' | 'key';
}
export declare function classifyProviderError(err: unknown): ClassifiedProviderError;
export declare function canRetryProviderFailure(failure: ClassifiedProviderError, requestedModel?: string): boolean;
Expand Down
2 changes: 1 addition & 1 deletion server/dist/services/provider-errors.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions server/dist/services/provider-errors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/dist/services/provider-errors.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions server/dist/services/ratelimit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ export declare function canUseTokens(platform: string, modelId: string, keyId: n
export declare function recordRequest(platform: string, modelId: string, keyId: number): void;
export declare function recordTokens(platform: string, modelId: string, keyId: number, tokens: number): void;
export declare function setCooldown(platform: string, modelId: string, keyId: number, durationMs?: number): void;
/**
* Bench a credential across ALL models on its platform.
*
* Some failures are properties of the account, not the model: a Google project
* denied access answers 403 for every model it owns. A per-model cooldown
* cannot express that, so the router kept re-selecting the bad credential once
* per model — one denied Google project produced 50 logged 403s across the
* catalog while its dashboard row still read "healthy".
*/
export declare function setKeyCooldown(platform: string, keyId: number, durationMs?: number): void;
export declare function isOnCooldown(platform: string, modelId: string, keyId: number): boolean;
export declare function getRateLimitStatus(platform: string, modelId: string, keyId: number, limits: {
rpm: number | null;
Expand Down
Loading
Loading