@code-yeongyu/senpi-ai 2026.11.5-1 → 2026.11.6-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/anthropic-messages.js +2 -6
- package/dist/api/openai-codex-responses.js +22 -10
- package/dist/api/openai-images-params.d.ts +5 -0
- package/dist/api/openai-images-params.js +1 -0
- package/dist/api/warm-prompt-cache.js +4 -3
- package/dist/auth/pool/slots.d.ts +11 -0
- package/dist/auth/pool/slots.js +72 -0
- package/dist/auth/types.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models.js +5 -2
- package/dist/providers/chatgpt-subscription.js +11 -0
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/baseten.json +1 -1
- package/dist/providers/data/fireworks.json +1 -1
- package/dist/providers/data/openai.json +1 -1
- package/dist/providers/data/opencode-go.json +1 -1
- package/dist/providers/data/opencode.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/venice.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/utils/prompt-cache-ttl.d.ts +9 -0
- package/dist/utils/prompt-cache-ttl.js +15 -3
- package/dist/utils/provider-error.js +3 -2
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ import { withGzipRequestBodies } from "../utils/gzip-request-body.js";
|
|
|
14
14
|
import { headersToRecord, providerHeadersToRecord } from "../utils/headers.js";
|
|
15
15
|
import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse.js";
|
|
16
16
|
import { getPiUserAgent } from "../utils/pi-user-agent.js";
|
|
17
|
-
import {
|
|
17
|
+
import { allowsAnthropicLongCacheRetention, getAnthropicCompat } from "../utils/prompt-cache-ttl.js";
|
|
18
18
|
import { attachProviderDiagnostic } from "../utils/provider-diagnostic-carrier.js";
|
|
19
19
|
import { anthropicProviderDiagnosticFromError, anthropicProviderDiagnosticFromSseData, awaitProviderTransport, } from "../utils/provider-diagnostic-sources.js";
|
|
20
20
|
import { getProviderEnvValue } from "../utils/provider-env.js";
|
|
@@ -63,11 +63,7 @@ function getCacheControl(model, cacheRetention, env) {
|
|
|
63
63
|
if (retention === "none") {
|
|
64
64
|
return { retention };
|
|
65
65
|
}
|
|
66
|
-
const ttl = retention === "long" &&
|
|
67
|
-
isAnthropicApiBaseUrl(model.baseUrl) &&
|
|
68
|
-
getAnthropicCompat(model).supportsLongCacheRetention
|
|
69
|
-
? "1h"
|
|
70
|
-
: undefined;
|
|
66
|
+
const ttl = retention === "long" && allowsAnthropicLongCacheRetention(model) ? "1h" : undefined;
|
|
71
67
|
return {
|
|
72
68
|
retention,
|
|
73
69
|
cacheControl: { type: "ephemeral", ...(ttl && { ttl }) },
|
|
@@ -351,7 +351,7 @@ export const stream = (model, context, options) => {
|
|
|
351
351
|
startEmitted = true;
|
|
352
352
|
stream.push({ type: "start", partial: output });
|
|
353
353
|
}
|
|
354
|
-
await processStream(response, output, stream, model, grammarToolInputProperties, options);
|
|
354
|
+
await processStream(response, output, stream, model, grammarToolInputProperties, options, body.service_tier);
|
|
355
355
|
if (options?.signal?.aborted) {
|
|
356
356
|
throw new Error("Request was aborted");
|
|
357
357
|
}
|
|
@@ -485,15 +485,20 @@ function applyServiceTierPricing(usage, serviceTier, model) {
|
|
|
485
485
|
usage.cost.cacheWrite *= multiplier;
|
|
486
486
|
usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
|
|
487
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* The tier a Codex turn was served at. The backend echoes `service_tier:
|
|
490
|
+
* "default"` or `"auto"` on turns it serves at the sent tier, so a `default`,
|
|
491
|
+
* `auto` or absent echo carries no information and, like an absent one,
|
|
492
|
+
* resolves to the tier that was sent. Any other echo (`flex`, `priority`,
|
|
493
|
+
* `fast`, `ultrafast`, `scale`) is authoritative. The echo cannot reveal a
|
|
494
|
+
* genuine downgrade, so a downgraded turn is recorded at the sent tier.
|
|
495
|
+
* Port of the oh-my-pi v18.8.1 fix (204b8f3); senpi#2890.
|
|
496
|
+
*/
|
|
488
497
|
function resolveCodexServiceTier(responseServiceTier, requestServiceTier) {
|
|
489
|
-
if (responseServiceTier === "default"
|
|
490
|
-
(requestServiceTier === "flex" ||
|
|
491
|
-
requestServiceTier === "priority" ||
|
|
492
|
-
requestServiceTier === "fast" ||
|
|
493
|
-
requestServiceTier === "ultrafast")) {
|
|
498
|
+
if (responseServiceTier === undefined || responseServiceTier === "default" || responseServiceTier === "auto") {
|
|
494
499
|
return requestServiceTier;
|
|
495
500
|
}
|
|
496
|
-
return responseServiceTier
|
|
501
|
+
return responseServiceTier;
|
|
497
502
|
}
|
|
498
503
|
function resolveCodexUrl(baseUrl) {
|
|
499
504
|
const raw = baseUrl && baseUrl.trim().length > 0 ? baseUrl : DEFAULT_CODEX_BASE_URL;
|
|
@@ -515,9 +520,13 @@ function resolveCodexWebSocketUrl(baseUrl) {
|
|
|
515
520
|
// ============================================================================
|
|
516
521
|
// Response Processing
|
|
517
522
|
// ============================================================================
|
|
518
|
-
async function processStream(response, output, stream, model, grammarToolInputProperties, options
|
|
523
|
+
async function processStream(response, output, stream, model, grammarToolInputProperties, options,
|
|
524
|
+
// The tier the request body actually carried after `onPayload` (senpi#2890):
|
|
525
|
+
// a payload hook such as `/fast` may set `service_tier` without it ever
|
|
526
|
+
// appearing in `options.serviceTier`, and pricing must fall back to it.
|
|
527
|
+
sentServiceTier) {
|
|
519
528
|
await processResponsesStream(mapCodexEvents(parseSSE(response, options?.signal), output, model, options?.onProviderStreamEvent), output, stream, model, {
|
|
520
|
-
serviceTier:
|
|
529
|
+
serviceTier: sentServiceTier,
|
|
521
530
|
grammarToolInputProperties,
|
|
522
531
|
resolveServiceTier: resolveCodexServiceTier,
|
|
523
532
|
applyServiceTierPricing: (usage, serviceTier) => applyServiceTierPricing(usage, serviceTier, model),
|
|
@@ -1241,7 +1250,10 @@ async function processWebSocketStream(url, body, headers, output, stream, model,
|
|
|
1241
1250
|
try {
|
|
1242
1251
|
socket.send(JSON.stringify({ type: "response.create", ...requestBody }));
|
|
1243
1252
|
await processResponsesStream(startWebSocketOutputOnFirstEvent(mapCodexEvents(parseWebSocket(socket, options?.signal, idleTimeoutMs), output, model, options?.onProviderStreamEvent), onStart), output, stream, model, {
|
|
1244
|
-
|
|
1253
|
+
// Price against the tier the frame just sent (senpi#2890, port of
|
|
1254
|
+
// oh-my-pi v18.8.1 6428580): `onPayload` may rewrite `service_tier`,
|
|
1255
|
+
// and the requested option no longer describes what went out.
|
|
1256
|
+
serviceTier: requestBody.service_tier,
|
|
1245
1257
|
grammarToolInputProperties,
|
|
1246
1258
|
resolveServiceTier: resolveCodexServiceTier,
|
|
1247
1259
|
applyServiceTierPricing: (usage, serviceTier) => applyServiceTierPricing(usage, serviceTier, model),
|
|
@@ -6,6 +6,8 @@ export type OpenAIImageSize = "auto" | "1024x1024" | "1536x1024" | "1024x1536" |
|
|
|
6
6
|
export type OpenAIImageBackground = "auto" | "transparent" | "opaque";
|
|
7
7
|
export type OpenAIImageOutputFormat = "png" | "jpeg" | "webp";
|
|
8
8
|
export type OpenAIImageModeration = "auto" | "low";
|
|
9
|
+
/** GPT Image 2.6 planning effort before rendering; the API defaults to `high`. */
|
|
10
|
+
export type OpenAIImageComplexity = "low" | "medium" | "high";
|
|
9
11
|
export interface OpenAIImagesOptions extends ImagesOptions {
|
|
10
12
|
size?: OpenAIImageSize;
|
|
11
13
|
quality?: OpenAIImageQuality;
|
|
@@ -17,12 +19,15 @@ export interface OpenAIImagesOptions extends ImagesOptions {
|
|
|
17
19
|
/** 0-100 compression for jpeg/webp output only. */
|
|
18
20
|
outputCompression?: number;
|
|
19
21
|
moderation?: OpenAIImageModeration;
|
|
22
|
+
/** GPT Image 2.6 only; older models reject the field, so omit it for them. */
|
|
23
|
+
complexity?: OpenAIImageComplexity;
|
|
20
24
|
/** Inpainting mask applied to the first input image; requires at least one image input. */
|
|
21
25
|
mask?: ImageContent;
|
|
22
26
|
}
|
|
23
27
|
export type OpenAIImageParams = Omit<ImageGenerateParamsNonStreaming, "size" | "quality"> & {
|
|
24
28
|
size?: OpenAIImageSize;
|
|
25
29
|
quality?: OpenAIImageQuality;
|
|
30
|
+
complexity?: OpenAIImageComplexity;
|
|
26
31
|
image?: Uploadable[];
|
|
27
32
|
mask?: Uploadable;
|
|
28
33
|
};
|
|
@@ -85,6 +85,7 @@ export function buildParams(model, context, options) {
|
|
|
85
85
|
...(options?.background === undefined ? {} : { background: options.background }),
|
|
86
86
|
...(options?.outputCompression === undefined ? {} : { output_compression: options.outputCompression }),
|
|
87
87
|
...(options?.moderation === undefined ? {} : { moderation: options.moderation }),
|
|
88
|
+
...(options?.complexity === undefined ? {} : { complexity: options.complexity }),
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
91
|
export function isImageParams(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withGzipRequestBodies } from "../utils/gzip-request-body.js";
|
|
2
2
|
import { providerHeadersToRecord } from "../utils/headers.js";
|
|
3
|
-
import { getAnthropicCompat,
|
|
3
|
+
import { getAnthropicCompat, supportsAnthropicCacheWarming } from "../utils/prompt-cache-ttl.js";
|
|
4
4
|
import { isOpenAIResponsesPromptCacheModel } from "./openai-responses-prompt-cache.js";
|
|
5
5
|
import { getPromptCacheWarmer } from "./prompt-cache-warmers.js";
|
|
6
6
|
export async function warmPromptCache(model, context, options = {}) {
|
|
@@ -24,10 +24,11 @@ export async function warmPromptCache(model, context, options = {}) {
|
|
|
24
24
|
usageRaw,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
if (model.api !== "anthropic-messages"
|
|
27
|
+
if (model.api !== "anthropic-messages")
|
|
28
28
|
return { supported: false };
|
|
29
|
-
}
|
|
30
29
|
const anthropicModel = model;
|
|
30
|
+
if (!supportsAnthropicCacheWarming(anthropicModel))
|
|
31
|
+
return { supported: false };
|
|
31
32
|
// Loaded lazily: a static import would pull the Anthropic SDK into the root
|
|
32
33
|
// barrel and break the lazy provider-loading contract (lazy-module-load.test.ts).
|
|
33
34
|
const [{ default: Anthropic }, { buildAnthropicWarmPromptCacheParams }] = await Promise.all([
|
|
@@ -77,6 +77,15 @@ export declare class EmptyApiKeyError extends Error {
|
|
|
77
77
|
readonly name = "EmptyApiKeyError";
|
|
78
78
|
constructor();
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A reauthorization signed in a different ChatGPT account than the saved one it was started for (#5003). Nothing
|
|
82
|
+
* is written: the selected account keeps its registration and the other sign-in is not silently swapped in.
|
|
83
|
+
*/
|
|
84
|
+
export declare class ReauthorizeAccountMismatchError extends Error {
|
|
85
|
+
readonly name = "ReauthorizeAccountMismatchError";
|
|
86
|
+
readonly slotName: string;
|
|
87
|
+
constructor(slotName: string);
|
|
88
|
+
}
|
|
80
89
|
/** Drops a blank or missing `key` from an API-key credential; used only for providers that declare `keyOptional`. */
|
|
81
90
|
export declare function withoutBlankKey(credential: Credential): Credential;
|
|
82
91
|
/**
|
|
@@ -111,6 +120,8 @@ export type AppendLoginSlotOptions = {
|
|
|
111
120
|
accountIdentity?: (credential: {
|
|
112
121
|
access: string;
|
|
113
122
|
}) => string | undefined;
|
|
123
|
+
/** `LoginOptions.reauthorizeSlot`: the saved account this login reauthorizes. */
|
|
124
|
+
reauthorizeSlot?: string;
|
|
114
125
|
};
|
|
115
126
|
/**
|
|
116
127
|
* Material a provider writes into the flat credential when the real token lives
|
package/dist/auth/pool/slots.js
CHANGED
|
@@ -318,6 +318,17 @@ export class EmptyApiKeyError extends Error {
|
|
|
318
318
|
this.name = "EmptyApiKeyError";
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* A reauthorization signed in a different ChatGPT account than the saved one it was started for (#5003). Nothing
|
|
323
|
+
* is written: the selected account keeps its registration and the other sign-in is not silently swapped in.
|
|
324
|
+
*/
|
|
325
|
+
export class ReauthorizeAccountMismatchError extends Error {
|
|
326
|
+
constructor(slotName) {
|
|
327
|
+
super(`Signed in to a different ChatGPT account than '${slotName}'; nothing was changed. Sign in as that account, or add the other one as a new account.`);
|
|
328
|
+
this.name = "ReauthorizeAccountMismatchError";
|
|
329
|
+
this.slotName = slotName;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
321
332
|
/** True when an API-key credential names a `key` that is blank, whitespace or not a string. */
|
|
322
333
|
function hasBlankKey(credential) {
|
|
323
334
|
if (credential.type !== "api_key" || !Object.hasOwn(credential, "key"))
|
|
@@ -380,6 +391,11 @@ export function appendLoginSlot(stored, flat, onAllocated, options) {
|
|
|
380
391
|
onAllocated?.(DEFAULT_SLOT_NAME, "generated");
|
|
381
392
|
return flat;
|
|
382
393
|
}
|
|
394
|
+
const target = provided || options?.reauthorizeSlot === undefined ? undefined : findSlot(current, options.reauthorizeSlot);
|
|
395
|
+
if (target) {
|
|
396
|
+
assertSameReauthorizedAccount(target, flat, options?.accountIdentity);
|
|
397
|
+
return restoreReauthorizedSlot(current, target, flat, onAllocated);
|
|
398
|
+
}
|
|
383
399
|
const storedAccounts = Array.isArray(current.accounts) ? current.accounts : undefined;
|
|
384
400
|
if (!provided && "signedOut" in current && current.signedOut === true) {
|
|
385
401
|
// Sign-out keeps only the registration for a later sign-in (senpi#5003 W7). That sign-in takes over
|
|
@@ -428,6 +444,62 @@ export function appendLoginSlot(stored, flat, onAllocated, options) {
|
|
|
428
444
|
onAllocated?.(name, "generated");
|
|
429
445
|
return next;
|
|
430
446
|
}
|
|
447
|
+
/**
|
|
448
|
+
* A reauthorization of a named saved account rewrites that account and nothing else (#5003). A signed-out account
|
|
449
|
+
* holds blank tokens, so neither the token-identity match nor the sign-in takeover can find it, and both used to
|
|
450
|
+
* append a duplicate `login-N`. The account keeps its name, label and source and drops `signedOut`; the flat
|
|
451
|
+
* projection moves to it when it carried that account or when the whole credential was signed out.
|
|
452
|
+
*/
|
|
453
|
+
/**
|
|
454
|
+
* The identity a reauthorization must keep. SIWC names an account by issuer, subject and issued client ID, which a
|
|
455
|
+
* sign-out keeps. A legacy Codex account is named by its token identity, or, once signed out and without a token,
|
|
456
|
+
* by its workspace (`accountId`). A field the saved account never recorded cannot be compared and is not checked.
|
|
457
|
+
*/
|
|
458
|
+
function assertSameReauthorizedAccount(target, flat, accountIdentity) {
|
|
459
|
+
if (flat.type !== "oauth")
|
|
460
|
+
return;
|
|
461
|
+
const saved = target;
|
|
462
|
+
const fresh = flat;
|
|
463
|
+
const differs = (field) => typeof saved[field] === "string" &&
|
|
464
|
+
saved[field] !== "" &&
|
|
465
|
+
typeof fresh[field] === "string" &&
|
|
466
|
+
saved[field] !== fresh[field];
|
|
467
|
+
if ((saved.route ?? "codex") !== (flat.route ?? "codex"))
|
|
468
|
+
throw new ReauthorizeAccountMismatchError(target.name);
|
|
469
|
+
if (flat.route === "siwc") {
|
|
470
|
+
if (["issuer", "subject", "clientId"].some(differs))
|
|
471
|
+
throw new ReauthorizeAccountMismatchError(target.name);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
const savedIdentity = accountIdentity && typeof target.access === "string" && target.access !== ""
|
|
475
|
+
? accountIdentity({ access: target.access })
|
|
476
|
+
: undefined;
|
|
477
|
+
const freshIdentity = accountIdentity?.(flat);
|
|
478
|
+
if (savedIdentity !== undefined && freshIdentity !== undefined) {
|
|
479
|
+
if (savedIdentity !== freshIdentity)
|
|
480
|
+
throw new ReauthorizeAccountMismatchError(target.name);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
if (differs("accountId"))
|
|
484
|
+
throw new ReauthorizeAccountMismatchError(target.name);
|
|
485
|
+
}
|
|
486
|
+
function restoreReauthorizedSlot(current, target, flat, onAllocated) {
|
|
487
|
+
onAllocated?.(target.name, "generated");
|
|
488
|
+
if (!Array.isArray(current.accounts) || current.accounts.length === 0)
|
|
489
|
+
return flat;
|
|
490
|
+
const fresh = {
|
|
491
|
+
...slotFromFlatCredentialNamed(flat, target.name),
|
|
492
|
+
...(target.displayName === undefined ? {} : { displayName: target.displayName }),
|
|
493
|
+
...(target.source === undefined ? {} : { source: target.source }),
|
|
494
|
+
};
|
|
495
|
+
const accounts = listSlots(current).map((slot) => (slot.name === target.name ? fresh : slot));
|
|
496
|
+
const wholeSignedOut = "signedOut" in current && current.signedOut === true;
|
|
497
|
+
const reproject = wholeSignedOut || slotMirrorsFlat(current, target);
|
|
498
|
+
const next = { ...(reproject ? projectFlatFields(current, fresh) : current), accounts };
|
|
499
|
+
if (reproject)
|
|
500
|
+
Reflect.deleteProperty(next, "signedOut");
|
|
501
|
+
return next;
|
|
502
|
+
}
|
|
431
503
|
/**
|
|
432
504
|
* A login of an account that is already saved rewrites that account instead of
|
|
433
505
|
* appending another `login-N` copy of it. Appending kept the old copy, and once the
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -274,6 +274,11 @@ export interface LoginOptions {
|
|
|
274
274
|
* an account; callers must not infer this from the provider's active credential.
|
|
275
275
|
*/
|
|
276
276
|
reauthorize?: OAuthCredential;
|
|
277
|
+
/**
|
|
278
|
+
* The saved account name of `reauthorize`. The login then restores that account in place, signed-out ones
|
|
279
|
+
* included, instead of matching by token or appending another `login-N` copy of it.
|
|
280
|
+
*/
|
|
281
|
+
reauthorizeSlot?: string;
|
|
277
282
|
/**
|
|
278
283
|
* Returns the stable ID of this app installation, e.g. sent to OpenAI as its
|
|
279
284
|
* agent host ID. Called only by login flows that need it, so apps can create
|
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export * from "./utils/event-stream.ts";
|
|
|
58
58
|
export * from "./utils/json-parse.ts";
|
|
59
59
|
export * from "./utils/overflow.ts";
|
|
60
60
|
export * from "./utils/provider-error.ts";
|
|
61
|
-
export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_OPENAI_EXTENDED_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, type PromptCacheLifetime, resolvePromptCacheLifetime, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.ts";
|
|
61
|
+
export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_OPENAI_EXTENDED_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, type PromptCacheLifetime, resolvePromptCacheLifetime, resolvePromptCacheTtlSeconds, supportsAnthropicCacheWarming, } from "./utils/prompt-cache-ttl.ts";
|
|
62
62
|
export * from "./utils/provider-failure-description.ts";
|
|
63
63
|
export * from "./utils/retry.ts";
|
|
64
64
|
export * from "./utils/server-fallback-receipt.ts";
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export * from "./utils/event-stream.js";
|
|
|
44
44
|
export * from "./utils/json-parse.js";
|
|
45
45
|
export * from "./utils/overflow.js";
|
|
46
46
|
export * from "./utils/provider-error.js";
|
|
47
|
-
export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_OPENAI_EXTENDED_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheLifetime, resolvePromptCacheTtlSeconds, } from "./utils/prompt-cache-ttl.js";
|
|
47
|
+
export { isAnthropicApiBaseUrl, PROMPT_CACHE_TTL_LONG_SECONDS, PROMPT_CACHE_TTL_OPENAI_EXTENDED_SECONDS, PROMPT_CACHE_TTL_SHORT_SECONDS, resolvePromptCacheLifetime, resolvePromptCacheTtlSeconds, supportsAnthropicCacheWarming, } from "./utils/prompt-cache-ttl.js";
|
|
48
48
|
export * from "./utils/provider-failure-description.js";
|
|
49
49
|
export * from "./utils/retry.js";
|
|
50
50
|
export * from "./utils/server-fallback-receipt.js";
|
package/dist/models.js
CHANGED
|
@@ -2,7 +2,7 @@ import { lazyStream } from "./api/lazy.js";
|
|
|
2
2
|
import { defaultProviderAuthContext as defaultAuthContext } from "./auth/context.js";
|
|
3
3
|
import { InMemoryCredentialStore, revokeStoredOAuth } from "./auth/credential-store.js";
|
|
4
4
|
import { stampLogin } from "./auth/pool/login-id.js";
|
|
5
|
-
import { appendLoginSlot, assertLoginKeyPresent, removeSlot, withoutBlankKey } from "./auth/pool/slots.js";
|
|
5
|
+
import { appendLoginSlot, assertLoginKeyPresent, ReauthorizeAccountMismatchError, removeSlot, withoutBlankKey, } from "./auth/pool/slots.js";
|
|
6
6
|
import { resolveRefreshCredential } from "./auth/refresh-credential.js";
|
|
7
7
|
import { ModelsError, providerNotConfiguredMessage, resolveProviderAuth, } from "./auth/resolve.js";
|
|
8
8
|
import { inferGoogleThinkingLevelMap } from "./google-thinking-generation.js";
|
|
@@ -385,7 +385,7 @@ class ModelsImpl {
|
|
|
385
385
|
return stampLogin(appendLoginSlot(current, credential, (name, origin) => {
|
|
386
386
|
committedName = name;
|
|
387
387
|
committedOrigin = origin;
|
|
388
|
-
}, { accountIdentity: provider.auth.oauth?.accountIdentity }));
|
|
388
|
+
}, { accountIdentity: provider.auth.oauth?.accountIdentity, reauthorizeSlot: options?.reauthorizeSlot }));
|
|
389
389
|
}, { signal });
|
|
390
390
|
void mutation.catch(() => { });
|
|
391
391
|
try {
|
|
@@ -409,6 +409,9 @@ class ModelsImpl {
|
|
|
409
409
|
}
|
|
410
410
|
catch (error) {
|
|
411
411
|
signal.throwIfAborted();
|
|
412
|
+
// The user must see why a reauthorization changed nothing, not a storage failure.
|
|
413
|
+
if (error instanceof ReauthorizeAccountMismatchError)
|
|
414
|
+
throw error;
|
|
412
415
|
throw new ModelsError("auth", `Credential store modify failed for ${providerId}`, { cause: error });
|
|
413
416
|
}
|
|
414
417
|
if (committedName !== undefined && committedOrigin !== undefined) {
|
|
@@ -33,6 +33,11 @@ export function chatgptSubscriptionProvider() {
|
|
|
33
33
|
...legacy,
|
|
34
34
|
loginLabel: "Continue with ChatGPT",
|
|
35
35
|
login: async (interaction, options) => {
|
|
36
|
+
if (options?.reauthorize) {
|
|
37
|
+
return options.reauthorize.route === "siwc"
|
|
38
|
+
? { ...(await siwc.login(interaction, options)), route: "siwc" }
|
|
39
|
+
: legacy.login(interaction, options);
|
|
40
|
+
}
|
|
36
41
|
const route = await interaction.prompt({
|
|
37
42
|
type: "select",
|
|
38
43
|
message: "Sign in to ChatGPT Subscription:",
|
|
@@ -50,6 +55,12 @@ export function chatgptSubscriptionProvider() {
|
|
|
50
55
|
refresh: async (credential, signal) => credential.route === "siwc"
|
|
51
56
|
? { ...credential, ...(await siwc.refresh(credential, signal)), route: "siwc" }
|
|
52
57
|
: legacy.refresh(credential, signal),
|
|
58
|
+
revoke: async (credential, options) => {
|
|
59
|
+
const flow = await (credential.route === "siwc"
|
|
60
|
+
? loadOpenAIChatGPTOAuth()
|
|
61
|
+
: loadChatGptSubscriptionOAuth());
|
|
62
|
+
return flow.revoke?.(credential, options) ?? { status: "remote_revocation_unconfirmed" };
|
|
63
|
+
},
|
|
53
64
|
toAuth: async (credential) => credential.route === "siwc"
|
|
54
65
|
? {
|
|
55
66
|
...(await siwc.toAuth(credential)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":6,"generatedAt":"2026-11-
|
|
1
|
+
{"schemaVersion":6,"generatedAt":"2026-11-07T23:48:19.254Z","structureHash":"4187054e5eb70da209409c5f22a4a5074812b2fbffb0c805f3cbb44064c6f22c","files":{"alibaba-token-plan.json":"9f4d42cc765b2a875bcdcaa392bfdc1323c88968309baf9db9f611a26c595c73","amazon-bedrock.json":"a7e20838b095788cb9d5acbde49664b7f2868fad9b10fb4bbbd66635085bca2d","ant-ling.json":"628feab3ef6c7d80ce96f75999804e1d9f05fec3851e5302e30fff3b69db90f6","anthropic.json":"111384e9f5845e0247bd34edf2400ef7720fcbdac140b944cf8878192d8bd6ab","azure-openai-responses.json":"fd64c6a2a99fa87d768ed2f75f5c7813876df1dbe2f0d1776f7d9bd7ce2e61e4","bai.json":"7e6861aaf27d8af34e1771c6092602194fcec0a0046e6adfab9c3ee54d32b99f","baseten.json":"47d10c8050601eb88757def4fc957cdba769dacec4aeb3b0c3f39c41e442330e","cerebras.json":"2eb969b2956844f9a641d3de52c19f1791293c58f607282fb3b0ebfe85ff66f8","chatgpt-subscription.json":"98320f1d51709d26ca047b3d6e3191cfe2f192f1b27897cbb492f47b0e5a5030","cloudflare-ai-gateway.json":"ac281b8cc18eb84ba61f215eff3234d14732cd66239617fb59d6812b13d6473f","cloudflare-workers-ai.json":"1b9ad4360bde817f0ea358431020308f1052840e2278a57a93629f1790072d2e","deepseek.json":"10a296fb3e898f7715c80890c8af0af4f5fd58f22dbcd6612fdc5d762157ccdc","fireworks.json":"2172353d75f4d9fa1af5a1721ac28fb72dd7daa6699a57ede6bbf25d1d500df3","github-copilot.json":"474fa92eb88ef242208ca93709ebe6d7f21754917d0cad6210bd1edf2b99a87e","google-vertex.json":"8f986b4aca8c685b0f3481bd252bda21e4858bf9015ad37fc5bcc44b7f01d076","google.json":"d25613a7377e81d785d571be514d67b35436511ce6946247dc66f8674e2a5035","groq.json":"087df37206e9eed8b10f1e558e4c496289bef60074b7e8afba4f20fb102b4ec2","huggingface.json":"209cdcf205961ef2ff203486da614232a86a069ebe0e98266189a14a235fac8f","meta.json":"563f5ec07973f52ab8c3eb26ef91a36ad8a79e950b37174935666cdcb624bf35","minimax-cn.json":"70df757e95e9ea2275bf451956b58a746020835f6cbcbd1a644d7fad5b9941d3","minimax.json":"747038b05f4fc24e41405e8bc810f893d7d5121e214e35e6f812f775769a3806","mistral.json":"aafecc66686645b1baa8c90e81c02856115f09999ff507f9bee004d2e1c77a28","moonshotai-cn.json":"a953eace729ef96c91195d477c63c776a1c40aa36085b61236ca1be0fe5b9337","moonshotai.json":"0435f9dc4e532c0764b6d33d8dfa83ce5fccdbcab54224c5ae74ec2d965290f5","nvidia.json":"078fae404fc622ca6461f16a74791fedafe44976a6c3323b6ba779729823d4ff","openai.json":"80845240dd2e4cac670f8040ea7bdda867ca84cc0e4943b6b1b88a1676c0dbc7","opencode-go.json":"ae86439dff010c7ff156c4941aed5db6c1aa817c36dcbfbe893a3600bd4564f0","opencode.json":"2dfec265a63ae4e6bb76fe68b5ad4f27e245ef5bac371422709d25dbb6c19901","opengateway.json":"c39301d5db2d88aee71705143a6039ebfce2513ef4648979125def43ef409d49","openrouter.json":"b25d0c071b920a69f8cbffdf0de0dca020c0fe3a8c3153b83dbb344c35548a9c","qwen-token-plan-cn.json":"751b18bd443fceb16659ea33013fed90fbf3bbdb4e0ffd7607c93cee2b4cf40d","qwen-token-plan-individual.json":"35ffb0ba1a1ce3f68fc73262dd5e07fbcb5bf5911ad1e6e17bc0621e2894676a","qwen-token-plan.json":"e59b0a45e238578f80d0eea937a093b9cec7cb93751ae20a9e88b16c09eb5cdd","radius.json":"1e4868b8cef7b63d822584e7b8634111891fd6746983a758660ee8f44fad3400","together.json":"8b241bf22b25d8a4bf6d8effe45cebadd193a25a9f0ecc68039d395bf8c6e3bf","typesafe.json":"83409437dbf4c353ac413c0db4e7cf29902fc35e0e0197bdb4eeda2d7f3b07cd","venice.json":"ebb7b5378f2daf1dc73611a77ea9212fcf702d0e92a2d18698204828c6e55820","vercel-ai-gateway.json":"e961f61d02a9600a735e8cdb9869906fe2613d0f56ac3a8d4e0cb44ec3f68b58","xai.json":"cf3f475fe5a13625f858171900ba3456c4d95ebb0bac5060cc25e29bb31d3457","xiaomi-token-plan-ams.json":"7fa339ba5675460b1ff4e5bca9e8ad0aa60b0277d75a989b1c196aa6ca2af34d","xiaomi-token-plan-cn.json":"ef7917c6ea0d3edc655c8a52082ee5f1330658aa6f10199d8f164eb4605ef0a0","xiaomi-token-plan-sgp.json":"addda93f6b70ba879db97e3cfd2e4f2efc7cda47d7daa78c23c5b0e51162de5c","xiaomi.json":"5a42caf49d3e4d7946d60386e9899c2146bf8e3cbaff4c576ee4f49b398cc11c","zai-coding-cn.json":"2b6f85e04b5c568e320b1bde25b1c1614af9342e4c1ba0e1d5bb248aaf50cfe9","zai.json":"e9cc408e1756de8abc70148d63d89d11a63c65b7ef06ad0661cd1328e4209ba3"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"chat:deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":0.13,"output":0.26,"cacheRead":0.028,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":384000,"type":"chat"},"chat:deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.32,"output":3.96,"cacheRead":0.132,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.007,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.007,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast","name":"DeepSeek V4.1 Flash 1017 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.014,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-Fast","name":"DeepSeek V4.1 Flash Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.014,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:moonshotai/Kimi-K3.1-Pro":{"id":"moonshotai/Kimi-K3.1-Pro","name":"Kimi K3.1 Pro","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B","name":"Nemotron Ultra","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.12,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":202800,"maxTokens":202800,"type":"chat"},"chat:openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"OpenAI GPT 120B","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text"],"cost":{"input":0.1,"output":0.5,"cacheRead":0.1,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":128072,"maxTokens":128072,"type":"chat"},"chat:zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM 5.2","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.14,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"baseten","chatTemplateArgs":{"enable_thinking":{"$var":"thinking.enabled"}}},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:zai-org/GLM-5.2-Fast":{"id":"zai-org/GLM-5.2-Fast","name":"GLM 5.2 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":2.1,"output":6.6,"cacheRead":0.21,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"baseten","chatTemplateArgs":{"enable_thinking":{"$var":"thinking.enabled"}}},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.14,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:zai-org/GLM-5.3-Fast":{"id":"zai-org/GLM-5.3-Fast","name":"GLM 5.3 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":2.1,"output":6.6,"cacheRead":0.21,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|
|
1
|
+
{"openai-completions":{"chat:deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":0.13,"output":0.26,"cacheRead":0.028,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":384000,"type":"chat"},"chat:deepseek-ai/DeepSeek-V4-Pro-0813":{"id":"deepseek-ai/DeepSeek-V4-Pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.32,"output":3.96,"cacheRead":0.132,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash":{"id":"deepseek-ai/DeepSeek-V4.1-Flash","name":"DeepSeek V4.1 Flash","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.007,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-1017":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017","name":"DeepSeek V4.1 Flash 1017","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.007,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-1017-Fast","name":"DeepSeek V4.1 Flash 1017 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.014,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:deepseek-ai/DeepSeek-V4.1-Flash-Fast":{"id":"deepseek-ai/DeepSeek-V4.1-Flash-Fast","name":"DeepSeek V4.1 Flash Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.014,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":32768,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:moonshotai/Kimi-K3.1-Pro":{"id":"moonshotai/Kimi-K3.1-Pro","name":"Kimi K3.1 Pro","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B":{"id":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B","name":"Nemotron 3 Ultra","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text"],"cost":{"input":0.6,"output":2.4,"cacheRead":0.12,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":202800,"maxTokens":202800,"type":"chat"},"chat:openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"OpenAI GPT 120B","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text"],"cost":{"input":0.1,"output":0.5,"cacheRead":0.1,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":128072,"maxTokens":128072,"type":"chat"},"chat:zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM 5.2","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.14,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"baseten","chatTemplateArgs":{"enable_thinking":{"$var":"thinking.enabled"}}},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:zai-org/GLM-5.2-Fast":{"id":"zai-org/GLM-5.2-Fast","name":"GLM 5.2 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"cost":{"input":2.1,"output":6.6,"cacheRead":0.21,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"baseten","chatTemplateArgs":{"enable_thinking":{"$var":"thinking.enabled"}}},"contextWindow":1048576,"maxTokens":262144,"type":"chat"},"chat:zai-org/GLM-5.3":{"id":"zai-org/GLM-5.3","name":"GLM 5.3","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":1.4,"output":4.4,"cacheRead":0.14,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:zai-org/GLM-5.3-Fast":{"id":"zai-org/GLM-5.3-Fast","name":"GLM 5.3 Fast","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":2.1,"output":6.6,"cacheRead":0.21,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":262144,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"},"chat:zai-org/GLM-5.3-Flash":{"id":"zai-org/GLM-5.3-Flash","name":"GLM 5.3 Flash","api":"openai-completions","provider":"baseten","baseUrl":"https://inference.baseten.co/v1","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsStrictMode":true,"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":true,"supportsUsageInStreaming":true,"maxTokensField":"max_tokens","sendSessionAffinityHeaders":true,"supportsLongCacheRetention":false,"thinkingFormat":"openai"},"contextWindow":1048576,"maxTokens":131072,"inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}},"type":"chat"}}}
|