@code-yeongyu/senpi-ai 2026.9.3-2 → 2026.9.3-3
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/auth/pool/slots.d.ts +11 -3
- package/dist/auth/pool/slots.d.ts.map +1 -1
- package/dist/auth/pool/slots.js +32 -6
- package/dist/auth/pool/slots.js.map +1 -1
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/nvidia.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/package.json +2 -2
|
@@ -31,6 +31,13 @@ export declare function upsertSlot(credential: PooledCredential | undefined, slo
|
|
|
31
31
|
* Removes one slot. The credential is dropped entirely once its last slot is gone,
|
|
32
32
|
* and a pin naming the removed slot is cleared so selection never points at a slot
|
|
33
33
|
* that no longer exists.
|
|
34
|
+
*
|
|
35
|
+
* When the removed slot was the one the flat top-level fields projected, those
|
|
36
|
+
* fields are re-projected from the first survivor. Without that the pool keeps
|
|
37
|
+
* authenticating with the deleted account's material: a credential with a single
|
|
38
|
+
* remaining slot does not enter the rotation path, so ordinary requests resolve
|
|
39
|
+
* the flat projection and would keep using exactly the account the user removed.
|
|
40
|
+
* `accounts` is preserved either way, so the entry stays a pool.
|
|
34
41
|
*/
|
|
35
42
|
export declare function removeSlot(credential: PooledCredential | undefined, name: string): PooledCredential | undefined;
|
|
36
43
|
export declare function pinSlot(credential: PooledCredential, name: string): PooledCredential;
|
|
@@ -41,9 +48,10 @@ export declare function pinSlot(credential: PooledCredential, name: string): Poo
|
|
|
41
48
|
*/
|
|
42
49
|
export declare function projectSlot(credential: PooledCredential | undefined, name: string): Credential | undefined;
|
|
43
50
|
/**
|
|
44
|
-
* Appends an unnamed flat credential to a pool as a generated `login-N` slot.
|
|
45
|
-
*
|
|
46
|
-
*
|
|
51
|
+
* Appends an unnamed flat credential to a pool as a generated `login-N` slot.
|
|
52
|
+
* An absent current entry keeps today's whole-write shape; a flat current entry
|
|
53
|
+
* is promoted to a pool so the legacy credential stays reachable as `default`
|
|
54
|
+
* instead of being overwritten by the second login.
|
|
47
55
|
*
|
|
48
56
|
* A login result that already carries its own populated `accounts` array is a
|
|
49
57
|
* provider-owned pool: it IS the complete post-login credential, so it is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC3C,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMtD;AAmBD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,GAAG,cAAc,EAAE,CAIpF;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE3G;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,cAAc,GAAG,g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G;AAED,wBAAgB,OAAO,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAGpF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAU1G;AAwBD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAQnG;AAED;;;;;GAKG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAS7G;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAe3F"}
|
package/dist/auth/pool/slots.js
CHANGED
|
@@ -51,18 +51,43 @@ export function upsertSlot(credential, slot) {
|
|
|
51
51
|
: [...existing, slot];
|
|
52
52
|
return { ...base, accounts };
|
|
53
53
|
}
|
|
54
|
+
/** Whether the flat top-level fields are this slot's material rather than a sibling's. */
|
|
55
|
+
function slotMirrorsFlat(credential, slot) {
|
|
56
|
+
if (credential.type === "oauth")
|
|
57
|
+
return slot.access === credential.access || slot.refresh === credential.refresh;
|
|
58
|
+
return slot.key === credential.key;
|
|
59
|
+
}
|
|
60
|
+
/** Rewrites the flat top-level projection to carry the given slot's material. */
|
|
61
|
+
function projectFlatFields(credential, slot) {
|
|
62
|
+
if (credential.type === "oauth") {
|
|
63
|
+
if (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined)
|
|
64
|
+
return credential;
|
|
65
|
+
return { ...credential, access: slot.access, refresh: slot.refresh, expires: slot.expires };
|
|
66
|
+
}
|
|
67
|
+
return { ...credential, key: slot.key };
|
|
68
|
+
}
|
|
54
69
|
/**
|
|
55
70
|
* Removes one slot. The credential is dropped entirely once its last slot is gone,
|
|
56
71
|
* and a pin naming the removed slot is cleared so selection never points at a slot
|
|
57
72
|
* that no longer exists.
|
|
73
|
+
*
|
|
74
|
+
* When the removed slot was the one the flat top-level fields projected, those
|
|
75
|
+
* fields are re-projected from the first survivor. Without that the pool keeps
|
|
76
|
+
* authenticating with the deleted account's material: a credential with a single
|
|
77
|
+
* remaining slot does not enter the rotation path, so ordinary requests resolve
|
|
78
|
+
* the flat projection and would keep using exactly the account the user removed.
|
|
79
|
+
* `accounts` is preserved either way, so the entry stays a pool.
|
|
58
80
|
*/
|
|
59
81
|
export function removeSlot(credential, name) {
|
|
60
82
|
if (!credential)
|
|
61
83
|
return undefined;
|
|
62
|
-
const
|
|
84
|
+
const existing = listSlots(credential);
|
|
85
|
+
const removed = existing.find((slot) => slot.name === name);
|
|
86
|
+
const accounts = existing.filter((slot) => slot.name !== name);
|
|
63
87
|
if (accounts.length === 0)
|
|
64
88
|
return undefined;
|
|
65
|
-
const
|
|
89
|
+
const reprojected = removed && slotMirrorsFlat(credential, removed) ? projectFlatFields(credential, accounts[0]) : credential;
|
|
90
|
+
const next = { ...reprojected, accounts };
|
|
66
91
|
if (next.pinned === name)
|
|
67
92
|
delete next.pinned;
|
|
68
93
|
return next;
|
|
@@ -112,9 +137,10 @@ function nextLoginSlotName(credential) {
|
|
|
112
137
|
throw new Error("Credential pool is full");
|
|
113
138
|
}
|
|
114
139
|
/**
|
|
115
|
-
* Appends an unnamed flat credential to a pool as a generated `login-N` slot.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
140
|
+
* Appends an unnamed flat credential to a pool as a generated `login-N` slot.
|
|
141
|
+
* An absent current entry keeps today's whole-write shape; a flat current entry
|
|
142
|
+
* is promoted to a pool so the legacy credential stays reachable as `default`
|
|
143
|
+
* instead of being overwritten by the second login.
|
|
118
144
|
*
|
|
119
145
|
* A login result that already carries its own populated `accounts` array is a
|
|
120
146
|
* provider-owned pool: it IS the complete post-login credential, so it is
|
|
@@ -125,7 +151,7 @@ export function appendLoginSlot(current, flat) {
|
|
|
125
151
|
if ("accounts" in flat && Array.isArray(flat.accounts) && flat.accounts.length > 0) {
|
|
126
152
|
return flat;
|
|
127
153
|
}
|
|
128
|
-
if (!current
|
|
154
|
+
if (!current) {
|
|
129
155
|
return flat;
|
|
130
156
|
}
|
|
131
157
|
return upsertSlot(current, slotFromFlatCredentialNamed(flat, nextLoginSlotName(current)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/auth/pool/slots.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAkB3C,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAE7D,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACd,yBAAyB,IAAI,qEAAqE,CAClG,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAS,WAAW,CAAC,UAA4B;IAChD,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,SAAS,sBAAsB,CAAC,UAA4B;IAC3D,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO;YACN,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,OAAO,EAAE,UAAU,CAAC,OAAO;SAC3B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC;A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,CAAC,CAAC;IACnH,MAAM,OAAO,GAAG;QACf,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;KAC1B,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM;QACtB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpB,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import type { Credential } from \"../types.ts\";\n\nexport type { Credential };\n\nexport const DEFAULT_SLOT_NAME = \"default\";\n\nexport type CredentialSlotSource = \"login\" | \"import\" | \"env\";\n\nexport type CredentialSlot = {\n\tname: string;\n\tsource?: CredentialSlotSource;\n\tkey?: string;\n\taccess?: string;\n\trefresh?: string;\n\texpires?: number;\n};\n\nexport type PooledCredential = Credential & {\n\taccounts?: CredentialSlot[];\n\tpinned?: string;\n};\n\nconst SLOT_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;\n\nexport function assertValidSlotName(name: string): void {\n\tif (!SLOT_NAME_PATTERN.test(name)) {\n\t\tthrow new Error(\n\t\t\t`Invalid account name '${name}': use letters, digits, '-' or '_', starting with a letter or digit`,\n\t\t);\n\t}\n}\n\nfunction storedSlots(credential: PooledCredential): CredentialSlot[] {\n\treturn Array.isArray(credential.accounts) ? credential.accounts : [];\n}\n\nfunction slotFromFlatCredential(credential: PooledCredential): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname: DEFAULT_SLOT_NAME,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name: DEFAULT_SLOT_NAME, source: \"login\", key: credential.key };\n}\n\n/**\n * A flat credential written by a build predating pools is read as a one-slot pool\n * without writing anything back; the caller decides whether a write ever happens.\n */\nexport function listSlots(credential: PooledCredential | undefined): CredentialSlot[] {\n\tif (!credential) return [];\n\tconst slots = storedSlots(credential);\n\treturn slots.length > 0 ? [...slots] : [slotFromFlatCredential(credential)];\n}\n\nexport function findSlot(credential: PooledCredential | undefined, name: string): CredentialSlot | undefined {\n\treturn listSlots(credential).find((slot) => slot.name === name);\n}\n\n/**\n * Replaces or appends one slot while every sibling, the pin, and the flat\n * top-level credential survive untouched. The flat fields stay as written so a\n * build that ignores `accounts` still authenticates from them.\n */\nexport function upsertSlot(credential: PooledCredential | undefined, slot: CredentialSlot): PooledCredential {\n\tassertValidSlotName(slot.name);\n\tconst base: PooledCredential =\n\t\tcredential ??\n\t\t(slot.access !== undefined || slot.refresh !== undefined\n\t\t\t? { type: \"oauth\", access: slot.access ?? \"\", refresh: slot.refresh ?? \"\", expires: slot.expires ?? 0 }\n\t\t\t: { type: \"api_key\", key: slot.key });\n\tconst existing = listSlots(base);\n\tconst index = existing.findIndex((candidate) => candidate.name === slot.name);\n\tconst accounts =\n\t\tindex >= 0\n\t\t\t? existing.map((candidate) => (candidate.name === slot.name ? { ...candidate, ...slot } : candidate))\n\t\t\t: [...existing, slot];\n\treturn { ...base, accounts };\n}\n\n/**\n * Removes one slot. The credential is dropped entirely once its last slot is gone,\n * and a pin naming the removed slot is cleared so selection never points at a slot\n * that no longer exists.\n */\nexport function removeSlot(credential: PooledCredential | undefined, name: string): PooledCredential | undefined {\n\tif (!credential) return undefined;\n\tconst accounts = listSlots(credential).filter((slot) => slot.name !== name);\n\tif (accounts.length === 0) return undefined;\n\tconst next: PooledCredential = { ...credential, accounts };\n\tif (next.pinned === name) delete next.pinned;\n\treturn next;\n}\n\nexport function pinSlot(credential: PooledCredential, name: string): PooledCredential {\n\tassertValidSlotName(name);\n\treturn { ...credential, pinned: name };\n}\n\n/**\n * Projects one named slot onto the flat credential shape for request-scoped\n * resolution; pool bookkeeping fields are stripped so provider handlers see a\n * plain credential and never write pool state back through the projection.\n */\nexport function projectSlot(credential: PooledCredential | undefined, name: string): Credential | undefined {\n\tif (!credential) return undefined;\n\tconst slot = findSlot(credential, name);\n\tif (!slot) return undefined;\n\tconst { accounts: _accounts, pinned: _pinned, ...flat } = credential;\n\tif (flat.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return undefined;\n\t\treturn { ...flat, access: slot.access, refresh: slot.refresh, expires: slot.expires };\n\t}\n\treturn { ...flat, key: slot.key };\n}\n\nfunction slotFromFlatCredentialNamed(credential: Credential, name: string): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name, source: \"login\", key: credential.key };\n}\n\nfunction nextLoginSlotName(credential: PooledCredential): string {\n\tconst taken = new Set(listSlots(credential).map((slot) => slot.name));\n\tfor (let index = 2; index < 1000; index++) {\n\t\tconst candidate = `login-${index}`;\n\t\tif (!taken.has(candidate)) return candidate;\n\t}\n\tthrow new Error(\"Credential pool is full\");\n}\n\n/**\n * Appends an unnamed flat credential to a pool as a generated `login-N` slot. A\n * flat or absent current entry keeps today's whole-write shape so no existing\n * user's stored bytes change until a second credential actually exists.\n *\n * A login result that already carries its own populated `accounts` array is a\n * provider-owned pool: it IS the complete post-login credential, so it is\n * written through untouched. Reading its top-level fields as a flat credential\n * would append the provider's placeholder material as a second slot.\n */\nexport function appendLoginSlot(current: PooledCredential | undefined, flat: Credential): Credential {\n\tif (\"accounts\" in flat && Array.isArray(flat.accounts) && flat.accounts.length > 0) {\n\t\treturn flat;\n\t}\n\tif (!current || !Array.isArray(current.accounts) || current.accounts.length === 0) {\n\t\treturn flat;\n\t}\n\treturn upsertSlot(current, slotFromFlatCredentialNamed(flat, nextLoginSlotName(current)));\n}\n\n/**\n * Merges a rotated OAuth credential back into the pool: the slot whose material\n * matches the pre-refresh flat fields is updated in place together with those\n * flat fields, while every sibling and the pin survive byte-identical. A flat\n * current entry keeps today's whole-write shape.\n */\n/**\n * Merges a rotated OAuth credential into the NAMED slot. The flat top-level\n * projection rotates only when it mirrored that slot's previous material, so\n * refreshing a secondary slot never disturbs what an older binary reads.\n */\nexport function mergeRefreshedSlot(current: PooledCredential, name: string, refreshed: Credential): Credential {\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return current;\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) return mergeRefreshed(current, refreshed);\n\tconst target = current.accounts.find((slot) => slot.name === name);\n\tif (!target) return current;\n\tconst rotated = { access: refreshed.access, refresh: refreshed.refresh, expires: refreshed.expires };\n\tconst accounts = current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot));\n\tconst mirrorsFlat = target.access === current.access || target.refresh === current.refresh;\n\treturn mirrorsFlat ? { ...current, ...rotated, accounts } : { ...current, accounts };\n}\n\nexport function mergeRefreshed(current: PooledCredential, refreshed: Credential): Credential {\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) {\n\t\treturn refreshed;\n\t}\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return refreshed;\n\tconst target = current.accounts.find((slot) => slot.access === current.access || slot.refresh === current.refresh);\n\tconst rotated = {\n\t\taccess: refreshed.access,\n\t\trefresh: refreshed.refresh,\n\t\texpires: refreshed.expires,\n\t};\n\tconst accounts = target\n\t\t? current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot))\n\t\t: current.accounts;\n\treturn { ...current, ...rotated, accounts };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/auth/pool/slots.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Credential };\n\nexport const DEFAULT_SLOT_NAME = \"default\";\n\nexport type CredentialSlotSource = \"login\" | \"import\" | \"env\";\n\nexport type CredentialSlot = {\n\tname: string;\n\tsource?: CredentialSlotSource;\n\tkey?: string;\n\taccess?: string;\n\trefresh?: string;\n\texpires?: number;\n};\n\nexport type PooledCredential = Credential & {\n\taccounts?: CredentialSlot[];\n\tpinned?: string;\n};\n\nconst SLOT_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;\n\nexport function assertValidSlotName(name: string): void {\n\tif (!SLOT_NAME_PATTERN.test(name)) {\n\t\tthrow new Error(\n\t\t\t`Invalid account name '${name}': use letters, digits, '-' or '_', starting with a letter or digit`,\n\t\t);\n\t}\n}\n\nfunction storedSlots(credential: PooledCredential): CredentialSlot[] {\n\treturn Array.isArray(credential.accounts) ? credential.accounts : [];\n}\n\nfunction slotFromFlatCredential(credential: PooledCredential): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname: DEFAULT_SLOT_NAME,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name: DEFAULT_SLOT_NAME, source: \"login\", key: credential.key };\n}\n\n/**\n * A flat credential written by a build predating pools is read as a one-slot pool\n * without writing anything back; the caller decides whether a write ever happens.\n */\nexport function listSlots(credential: PooledCredential | undefined): CredentialSlot[] {\n\tif (!credential) return [];\n\tconst slots = storedSlots(credential);\n\treturn slots.length > 0 ? [...slots] : [slotFromFlatCredential(credential)];\n}\n\nexport function findSlot(credential: PooledCredential | undefined, name: string): CredentialSlot | undefined {\n\treturn listSlots(credential).find((slot) => slot.name === name);\n}\n\n/**\n * Replaces or appends one slot while every sibling, the pin, and the flat\n * top-level credential survive untouched. The flat fields stay as written so a\n * build that ignores `accounts` still authenticates from them.\n */\nexport function upsertSlot(credential: PooledCredential | undefined, slot: CredentialSlot): PooledCredential {\n\tassertValidSlotName(slot.name);\n\tconst base: PooledCredential =\n\t\tcredential ??\n\t\t(slot.access !== undefined || slot.refresh !== undefined\n\t\t\t? { type: \"oauth\", access: slot.access ?? \"\", refresh: slot.refresh ?? \"\", expires: slot.expires ?? 0 }\n\t\t\t: { type: \"api_key\", key: slot.key });\n\tconst existing = listSlots(base);\n\tconst index = existing.findIndex((candidate) => candidate.name === slot.name);\n\tconst accounts =\n\t\tindex >= 0\n\t\t\t? existing.map((candidate) => (candidate.name === slot.name ? { ...candidate, ...slot } : candidate))\n\t\t\t: [...existing, slot];\n\treturn { ...base, accounts };\n}\n\n/** Whether the flat top-level fields are this slot's material rather than a sibling's. */\nfunction slotMirrorsFlat(credential: PooledCredential, slot: CredentialSlot): boolean {\n\tif (credential.type === \"oauth\") return slot.access === credential.access || slot.refresh === credential.refresh;\n\treturn slot.key === credential.key;\n}\n\n/** Rewrites the flat top-level projection to carry the given slot's material. */\nfunction projectFlatFields(credential: PooledCredential, slot: CredentialSlot): PooledCredential {\n\tif (credential.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return credential;\n\t\treturn { ...credential, access: slot.access, refresh: slot.refresh, expires: slot.expires };\n\t}\n\treturn { ...credential, key: slot.key };\n}\n\n/**\n * Removes one slot. The credential is dropped entirely once its last slot is gone,\n * and a pin naming the removed slot is cleared so selection never points at a slot\n * that no longer exists.\n *\n * When the removed slot was the one the flat top-level fields projected, those\n * fields are re-projected from the first survivor. Without that the pool keeps\n * authenticating with the deleted account's material: a credential with a single\n * remaining slot does not enter the rotation path, so ordinary requests resolve\n * the flat projection and would keep using exactly the account the user removed.\n * `accounts` is preserved either way, so the entry stays a pool.\n */\nexport function removeSlot(credential: PooledCredential | undefined, name: string): PooledCredential | undefined {\n\tif (!credential) return undefined;\n\tconst existing = listSlots(credential);\n\tconst removed = existing.find((slot) => slot.name === name);\n\tconst accounts = existing.filter((slot) => slot.name !== name);\n\tif (accounts.length === 0) return undefined;\n\tconst reprojected =\n\t\tremoved && slotMirrorsFlat(credential, removed) ? projectFlatFields(credential, accounts[0]) : credential;\n\tconst next: PooledCredential = { ...reprojected, accounts };\n\tif (next.pinned === name) delete next.pinned;\n\treturn next;\n}\n\nexport function pinSlot(credential: PooledCredential, name: string): PooledCredential {\n\tassertValidSlotName(name);\n\treturn { ...credential, pinned: name };\n}\n\n/**\n * Projects one named slot onto the flat credential shape for request-scoped\n * resolution; pool bookkeeping fields are stripped so provider handlers see a\n * plain credential and never write pool state back through the projection.\n */\nexport function projectSlot(credential: PooledCredential | undefined, name: string): Credential | undefined {\n\tif (!credential) return undefined;\n\tconst slot = findSlot(credential, name);\n\tif (!slot) return undefined;\n\tconst { accounts: _accounts, pinned: _pinned, ...flat } = credential;\n\tif (flat.type === \"oauth\") {\n\t\tif (slot.access === undefined || slot.refresh === undefined || slot.expires === undefined) return undefined;\n\t\treturn { ...flat, access: slot.access, refresh: slot.refresh, expires: slot.expires };\n\t}\n\treturn { ...flat, key: slot.key };\n}\n\nfunction slotFromFlatCredentialNamed(credential: Credential, name: string): CredentialSlot {\n\tif (credential.type === \"oauth\") {\n\t\treturn {\n\t\t\tname,\n\t\t\tsource: \"login\",\n\t\t\taccess: credential.access,\n\t\t\trefresh: credential.refresh,\n\t\t\texpires: credential.expires,\n\t\t};\n\t}\n\treturn { name, source: \"login\", key: credential.key };\n}\n\nfunction nextLoginSlotName(credential: PooledCredential): string {\n\tconst taken = new Set(listSlots(credential).map((slot) => slot.name));\n\tfor (let index = 2; index < 1000; index++) {\n\t\tconst candidate = `login-${index}`;\n\t\tif (!taken.has(candidate)) return candidate;\n\t}\n\tthrow new Error(\"Credential pool is full\");\n}\n\n/**\n * Appends an unnamed flat credential to a pool as a generated `login-N` slot.\n * An absent current entry keeps today's whole-write shape; a flat current entry\n * is promoted to a pool so the legacy credential stays reachable as `default`\n * instead of being overwritten by the second login.\n *\n * A login result that already carries its own populated `accounts` array is a\n * provider-owned pool: it IS the complete post-login credential, so it is\n * written through untouched. Reading its top-level fields as a flat credential\n * would append the provider's placeholder material as a second slot.\n */\nexport function appendLoginSlot(current: PooledCredential | undefined, flat: Credential): Credential {\n\tif (\"accounts\" in flat && Array.isArray(flat.accounts) && flat.accounts.length > 0) {\n\t\treturn flat;\n\t}\n\tif (!current) {\n\t\treturn flat;\n\t}\n\treturn upsertSlot(current, slotFromFlatCredentialNamed(flat, nextLoginSlotName(current)));\n}\n\n/**\n * Merges a rotated OAuth credential back into the pool: the slot whose material\n * matches the pre-refresh flat fields is updated in place together with those\n * flat fields, while every sibling and the pin survive byte-identical. A flat\n * current entry keeps today's whole-write shape.\n */\n/**\n * Merges a rotated OAuth credential into the NAMED slot. The flat top-level\n * projection rotates only when it mirrored that slot's previous material, so\n * refreshing a secondary slot never disturbs what an older binary reads.\n */\nexport function mergeRefreshedSlot(current: PooledCredential, name: string, refreshed: Credential): Credential {\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return current;\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) return mergeRefreshed(current, refreshed);\n\tconst target = current.accounts.find((slot) => slot.name === name);\n\tif (!target) return current;\n\tconst rotated = { access: refreshed.access, refresh: refreshed.refresh, expires: refreshed.expires };\n\tconst accounts = current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot));\n\tconst mirrorsFlat = target.access === current.access || target.refresh === current.refresh;\n\treturn mirrorsFlat ? { ...current, ...rotated, accounts } : { ...current, accounts };\n}\n\nexport function mergeRefreshed(current: PooledCredential, refreshed: Credential): Credential {\n\tif (!Array.isArray(current.accounts) || current.accounts.length === 0) {\n\t\treturn refreshed;\n\t}\n\tif (refreshed.type !== \"oauth\" || current.type !== \"oauth\") return refreshed;\n\tconst target = current.accounts.find((slot) => slot.access === current.access || slot.refresh === current.refresh);\n\tconst rotated = {\n\t\taccess: refreshed.access,\n\t\trefresh: refreshed.refresh,\n\t\texpires: refreshed.expires,\n\t};\n\tconst accounts = target\n\t\t? current.accounts.map((slot) => (slot === target ? { ...slot, ...rotated } : slot))\n\t\t: current.accounts;\n\treturn { ...current, ...rotated, accounts };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":3,"generatedAt":"2026-09-
|
|
1
|
+
{"schemaVersion":3,"generatedAt":"2026-09-03T11:13:12.383Z","structureHash":"40540b267bb9f3f7b2ace473e4efc3ef60c2d573b26d33289a79528692f42bcf","files":{"alibaba-token-plan.json":"9f9e8f88b1faa2e4134a0d8bcda600531d4d044d64b7ec3d2373f1db46dcf452","amazon-bedrock.json":"c86cdf3eb28122f8682415543012feee0a84dd4a30f03b784dfffde92b0d69f4","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"c5c043d7daef4e179d0c1288683b63e52a88efa581edc9201f327ddefd27265c","azure-openai-responses.json":"37d12c5cbfc29bfd9a802a0516f5d3209320bd4aa8ef9cd7c219af208244afa3","baseten.json":"e4d1ec84e8180a53e21c1511b8d78e497784515c33ba8397382ac3450c8b126e","cerebras.json":"38272a7525d6680c71bb4bb3c4085e871768b400832e2013b0e7fd92f8fd4f05","cloudflare-ai-gateway.json":"eea26bf03ac54766119422ebfe05306b1878ae1cd36dac6a60fe35fe81505139","cloudflare-workers-ai.json":"07ef63208ff7517fd1a80962f18143e21de399640423329490b157f459ccf995","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"b3bbc10a86e94accd1d79aaf7c6b753caa346a5d0a7f9690c92acbfd27179ade","github-copilot.json":"61dec9e46df61a9b0bf6c7618651f97bfa9ae609d4c216b5725f014942ca3001","google-vertex.json":"e1631109172dc1f7d7977570420a5bb86258bdd1088427e244a2c51545c4f24d","google.json":"7619bf03edd2a7acb06a2274a14b13c3a61354288abe029a758401d4de36a8fd","groq.json":"e4728fd72e358cd8f25e9a518e9b49a521ef44523d3debe38a7db9e0663c4077","huggingface.json":"4df842498d6e823fc1ad0cd1f06b52c7087d5a340dd38ad4352498d6b3dae1d8","kimi-coding.json":"88150f8970f83e17968b02f3b33fac803b96ebf1474e76437689b7d0f1b69363","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"dbf1b71ee36812fe64b014177ff455809a8dd852bbbd584422645beb85635127","moonshotai.json":"2d7518b4769e97ac900366175c8b60ff86a02675bb6f6cc2fffcc6761fda6faa","nvidia.json":"7e5d6e027f61e36f8d806d0af311cda93a40e75920b8a0645eddf0ab9f058033","openai-codex.json":"4e4afe2929b2b20a751f2453b219deae4e5b9fd85e147bd0403601f183cfc15f","openai.json":"b014fb0676fec97264eb13b367b0ed73b99915f45410a3dd9a7397a0360c2a4b","opencode-go.json":"2d38500b561528e826b313ab16f1a3fc27999d6cd205fc9fdbef3c82ec98d274","opencode.json":"1a8ccb928714bbee3a75814da7108aa2a9ee05dfb94973f630f11ebb12b40412","opengateway.json":"ea7baf1096fe1488ee080ece109743fe69a8ccc111908a991ca09532efc60e15","openrouter.json":"d854275aa182f9433842b22a862fbdfdfed18eac60f9b126f2181913cb4e1001","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"5649fd4075ada766ec65a7a162cd65f096a7ecc29960ace04b2e6a6a4a995a41","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"6010980c9b0af72c60965ae325dbdb21e67c91844a7f7f6f7d71d363f1325f56","vercel-ai-gateway.json":"c2d95761e7cf72792e0619b4b98bf8484c162548a636678019932b433f7b086a","xai.json":"9973aae022723732b8a7ea12107e6fb8b3f1d0e087ec6bbc2ee18f0820595e19","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"d3c969020a7ab978497837a3301c7bca364d704082832221cfe61e6596333e56","zai.json":"f42790c77fb4681a656897a9d860b939916c0ddf979a5f16856bce9573cdf64e"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"deepseek-ai/deepseek-v4-flash-0731":{"id":"deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"contextWindow":1000000,"maxTokens":384000,"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"}},"deepseek-ai/deepseek-v4-pro-0813":{"id":"deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"contextWindow":1000000,"maxTokens":384000,"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"}},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"meta/llama-3.2-11b-vision-instruct":{"id":"meta/llama-3.2-11b-vision-instruct","name":"Llama 3.2 11b Vision Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":4096},"meta/llama-3.2-90b-vision-instruct":{"id":"meta/llama-3.2-90b-vision-instruct","name":"Llama-3.2-90B-Vision-Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":8192},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":131072},"minimaxai/minimax-m3":{"id":"minimaxai/minimax-m3","name":"MiniMax-M3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":16384},"mistralai/mistral-7b-instruct-v0.3":{"id":"mistralai/mistral-7b-instruct-v0.3","name":"Mistral-7B-Instruct-v0.3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":65536,"maxTokens":65536},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1048576,"maxTokens":131072},"nvidia/cosmos-reason2-8b":{"id":"nvidia/cosmos-reason2-8b","name":"Cosmos Reason2 8B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"nvidia/llama-3.1-nemotron-70b-instruct":{"id":"nvidia/llama-3.1-nemotron-70b-instruct","name":"Llama 3.1 Nemotron 70B Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":8192},"nvidia/llama-3.1-nemotron-ultra-253b-v1":{"id":"nvidia/llama-3.1-nemotron-ultra-253b-v1","name":"Llama 3.1 Nemotron Ultra 253B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":16384},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning":{"id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning","name":"Nemotron 3 Nano Omni","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":256000,"maxTokens":65536},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0.5,"output":2.5,"cacheRead":0.15,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":65536},"nvidia/nemotron-3.5-lightning-30b-a3b":{"id":"nvidia/nemotron-3.5-lightning-30b-a3b","name":"Nemotron 3.5 Lightning 30B A3B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT-OSS-120B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":8192},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":32768},"poolside/laguna-xs-2.1":{"id":"poolside/laguna-xs-2.1","name":"Laguna XS 2.1","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":16384}}}
|
|
1
|
+
{"openai-completions":{"deepseek-ai/deepseek-v4-flash-0731":{"id":"deepseek-ai/deepseek-v4-flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"contextWindow":1000000,"maxTokens":384000,"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"}},"deepseek-ai/deepseek-v4-pro-0813":{"id":"deepseek-ai/deepseek-v4-pro-0813","name":"DeepSeek V4 Pro 0813","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false,"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek"},"contextWindow":1000000,"maxTokens":384000,"thinkingLevelMap":{"minimal":null,"low":null,"medium":null,"high":"high","max":"max"}},"google/gemma-3-12b-it":{"id":"google/gemma-3-12b-it","name":"Gemma 3 12B IT","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"google/gemma-3-4b-it":{"id":"google/gemma-3-4b-it","name":"Gemma 3 4B IT","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"meta/llama-3.2-11b-vision-instruct":{"id":"meta/llama-3.2-11b-vision-instruct","name":"Llama 3.2 11b Vision Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":4096},"meta/llama-3.2-90b-vision-instruct":{"id":"meta/llama-3.2-90b-vision-instruct","name":"Llama-3.2-90B-Vision-Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":8192},"meta/muse-glimmer-30b":{"id":"meta/muse-glimmer-30b","name":"Muse Glimmer 30B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":131072},"minimaxai/minimax-m3":{"id":"minimaxai/minimax-m3","name":"MiniMax-M3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":16384},"mistralai/mistral-7b-instruct-v0.3":{"id":"mistralai/mistral-7b-instruct-v0.3","name":"Mistral-7B-Instruct-v0.3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":65536,"maxTokens":65536},"moonshotai/kimi-k2.6":{"id":"moonshotai/kimi-k2.6","name":"Kimi K2.6","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/kimi-k3":{"id":"moonshotai/kimi-k3","name":"Kimi K3","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1048576,"maxTokens":131072},"nvidia/cosmos-reason2-8b":{"id":"nvidia/cosmos-reason2-8b","name":"Cosmos Reason2 8B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":16384},"nvidia/llama-3.1-nemotron-70b-instruct":{"id":"nvidia/llama-3.1-nemotron-70b-instruct","name":"Llama 3.1 Nemotron 70B Instruct","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":8192},"nvidia/llama-3.1-nemotron-ultra-253b-v1":{"id":"nvidia/llama-3.1-nemotron-ultra-253b-v1","name":"Llama 3.1 Nemotron Ultra 253B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":128000,"maxTokens":16384},"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning":{"id":"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning","name":"Nemotron 3 Nano Omni","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":256000,"maxTokens":65536},"nvidia/nemotron-3-super-120b-a12b":{"id":"nvidia/nemotron-3-super-120b-a12b","name":"Nemotron 3 Super","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"nvidia/nemotron-3-ultra-550b-a55b":{"id":"nvidia/nemotron-3-ultra-550b-a55b","name":"Nemotron 3 Ultra 550B A55B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0.5,"output":2.5,"cacheRead":0.15,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":1000000,"maxTokens":65536},"nvidia/nemotron-3.5-lightning-30b-a3b":{"id":"nvidia/nemotron-3.5-lightning-30b-a3b","name":"Nemotron 3.5 Lightning 30B A3B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":262144},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":131072,"maxTokens":32768},"poolside/laguna-xs-2.1":{"id":"poolside/laguna-xs-2.1","name":"Laguna XS 2.1","api":"openai-completions","provider":"nvidia","baseUrl":"https://integrate.api.nvidia.com/v1","headers":{"NVCF-POLL-SECONDS":"3600"},"reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsStore":false,"supportsDeveloperRole":false,"supportsReasoningEffort":false,"maxTokensField":"max_tokens","supportsStrictMode":false,"supportsLongCacheRetention":false},"contextWindow":262144,"maxTokens":16384}}}
|