@openclaw/venice-provider 2026.8.1 → 2026.8.33
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/{models-7ngRXOeA.js → .setup/models-Bcq-4SGP.mjs} +33 -4
- package/dist/api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/models.js +1 -1
- package/dist/onboard.js +3 -3
- package/dist/pricing-api.js +54 -0
- package/dist/provider-catalog.js +1 -1
- package/dist/usage.js +1 -1
- package/openclaw.plugin.json +49 -2
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseVeniceModelPricing } from "../pricing-api.js";
|
|
1
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
3
|
import { buildManifestModelProviderConfig, readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
4
|
//#region extensions/venice/openclaw.plugin.json
|
|
@@ -7,6 +8,7 @@ var openclaw_plugin_default = {
|
|
|
7
8
|
enabledByDefault: true,
|
|
8
9
|
providers: ["venice"],
|
|
9
10
|
contracts: { "usageProviders": ["venice"] },
|
|
11
|
+
modelPricing: { "providers": { "venice": { "venice": { "provider": "venice" } } } },
|
|
10
12
|
providerAuthChoices: [{
|
|
11
13
|
"provider": "venice",
|
|
12
14
|
"method": "api-key",
|
|
@@ -183,7 +185,20 @@ var openclaw_plugin_default = {
|
|
|
183
185
|
"input": 2.27,
|
|
184
186
|
"output": 6.8,
|
|
185
187
|
"cacheRead": .34,
|
|
186
|
-
"cacheWrite": 0
|
|
188
|
+
"cacheWrite": 0,
|
|
189
|
+
"tieredPricing": [{
|
|
190
|
+
"input": 2.27,
|
|
191
|
+
"output": 6.8,
|
|
192
|
+
"cacheRead": .34,
|
|
193
|
+
"cacheWrite": 0,
|
|
194
|
+
"range": [0, 200001]
|
|
195
|
+
}, {
|
|
196
|
+
"input": 4.53,
|
|
197
|
+
"output": 13.6,
|
|
198
|
+
"cacheRead": .68,
|
|
199
|
+
"cacheWrite": 0,
|
|
200
|
+
"range": [200001]
|
|
201
|
+
}]
|
|
187
202
|
},
|
|
188
203
|
"compat": { "supportsUsageInStreaming": false }
|
|
189
204
|
},
|
|
@@ -213,7 +228,20 @@ var openclaw_plugin_default = {
|
|
|
213
228
|
"input": .5,
|
|
214
229
|
"output": 2,
|
|
215
230
|
"cacheRead": .05,
|
|
216
|
-
"cacheWrite": .625
|
|
231
|
+
"cacheWrite": .625,
|
|
232
|
+
"tieredPricing": [{
|
|
233
|
+
"input": .5,
|
|
234
|
+
"output": 2,
|
|
235
|
+
"cacheRead": .05,
|
|
236
|
+
"cacheWrite": .625,
|
|
237
|
+
"range": [0, 256001]
|
|
238
|
+
}, {
|
|
239
|
+
"input": 1.5,
|
|
240
|
+
"output": 6,
|
|
241
|
+
"cacheRead": .15,
|
|
242
|
+
"cacheWrite": 1.875,
|
|
243
|
+
"range": [256001]
|
|
244
|
+
}]
|
|
217
245
|
},
|
|
218
246
|
"compat": { "supportsUsageInStreaming": false }
|
|
219
247
|
},
|
|
@@ -392,6 +420,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
392
420
|
const apiModel = row;
|
|
393
421
|
if (typeof apiModel.id !== "string" || !apiModel.id.trim()) continue;
|
|
394
422
|
const catalogEntry = catalogById.get(apiModel.id);
|
|
423
|
+
const liveCost = parseVeniceModelPricing(apiModel.model_spec?.pricing);
|
|
395
424
|
const apiMaxTokens = resolveApiMaxCompletionTokens({
|
|
396
425
|
apiModel,
|
|
397
426
|
knownMaxTokens: catalogEntry?.maxTokens
|
|
@@ -401,7 +430,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
401
430
|
const definition = {
|
|
402
431
|
...catalogEntry,
|
|
403
432
|
input: [...catalogEntry.input],
|
|
404
|
-
cost: { ...catalogEntry.cost },
|
|
433
|
+
cost: liveCost ?? { ...catalogEntry.cost },
|
|
405
434
|
...catalogEntry.compat ? { compat: { ...catalogEntry.compat } } : {}
|
|
406
435
|
};
|
|
407
436
|
if (apiMaxTokens !== void 0) definition.maxTokens = apiMaxTokens;
|
|
@@ -420,7 +449,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
420
449
|
name: apiSpec?.name || apiModel.id,
|
|
421
450
|
reasoning: isReasoning,
|
|
422
451
|
input: hasVision ? ["text", "image"] : ["text"],
|
|
423
|
-
cost: VENICE_DEFAULT_COST,
|
|
452
|
+
cost: liveCost ?? VENICE_DEFAULT_COST,
|
|
424
453
|
contextWindow: normalizePositiveInt(apiSpec?.availableContextTokens) ?? VENICE_DEFAULT_CONTEXT_WINDOW,
|
|
425
454
|
maxTokens: apiMaxTokens ?? VENICE_DEFAULT_MAX_TOKENS,
|
|
426
455
|
compat: {
|
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "
|
|
1
|
+
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-Bcq-4SGP.mjs";
|
|
2
2
|
export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as openclaw_plugin_default, i as VENICE_MODEL_DISCOVERY_OPTIONS } from "
|
|
1
|
+
import { a as openclaw_plugin_default, i as VENICE_MODEL_DISCOVERY_OPTIONS } from "./.setup/models-Bcq-4SGP.mjs";
|
|
2
2
|
import { applyVeniceConfig } from "./onboard.js";
|
|
3
3
|
import { buildStaticVeniceProvider } from "./provider-catalog.js";
|
|
4
4
|
import { createVeniceStreamWrapper } from "./stream.js";
|
package/dist/models.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as VENICE_MODEL_DISCOVERY_OPTIONS, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "
|
|
1
|
+
import { i as VENICE_MODEL_DISCOVERY_OPTIONS, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-Bcq-4SGP.mjs";
|
|
2
2
|
export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG, VENICE_MODEL_DISCOVERY_OPTIONS };
|
package/dist/onboard.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "
|
|
1
|
+
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-Bcq-4SGP.mjs";
|
|
2
2
|
import "./api.js";
|
|
3
3
|
import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
4
|
//#region extensions/venice/onboard.ts
|
|
5
5
|
const { applyConfig: applyVeniceConfig } = createModelCatalogPresetAppliers({
|
|
6
6
|
primaryModelRef: VENICE_DEFAULT_MODEL_REF,
|
|
7
|
-
resolveParams: () => ({
|
|
7
|
+
resolveParams: (cfg) => ({
|
|
8
8
|
providerId: "venice",
|
|
9
9
|
api: "openai-completions",
|
|
10
10
|
baseUrl: VENICE_BASE_URL,
|
|
11
|
-
catalogModels: structuredClone(VENICE_MODEL_CATALOG),
|
|
11
|
+
catalogModels: cfg.models?.mode === "replace" ? structuredClone(VENICE_MODEL_CATALOG) : [],
|
|
12
12
|
aliases: [{
|
|
13
13
|
modelRef: VENICE_DEFAULT_MODEL_REF,
|
|
14
14
|
alias: "GLM 4.7"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { asFiniteNumberInRange, asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { normalizeModelPricingCatalog } from "openclaw/plugin-sdk/model-catalog-pricing";
|
|
3
|
+
//#region extensions/venice/pricing-api.ts
|
|
4
|
+
function readVeniceRates(value) {
|
|
5
|
+
const row = asOptionalRecord(value);
|
|
6
|
+
const [input, output, cacheRead, cacheWrite] = [
|
|
7
|
+
"input",
|
|
8
|
+
"output",
|
|
9
|
+
"cache_input",
|
|
10
|
+
"cache_write"
|
|
11
|
+
].map((field, index) => {
|
|
12
|
+
if (index >= 2 && row?.[field] === void 0) return 0;
|
|
13
|
+
return asFiniteNumberInRange(asOptionalRecord(row?.[field])?.usd, { min: 0 });
|
|
14
|
+
});
|
|
15
|
+
if (input === void 0 || output === void 0 || cacheRead === void 0 || cacheWrite === void 0) return;
|
|
16
|
+
return {
|
|
17
|
+
input,
|
|
18
|
+
output,
|
|
19
|
+
cacheRead,
|
|
20
|
+
cacheWrite
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Venice's public /models prices are USD per million tokens, for the whole request. */
|
|
24
|
+
function parseVeniceModelPricing(value) {
|
|
25
|
+
const row = asOptionalRecord(value);
|
|
26
|
+
const base = readVeniceRates(row);
|
|
27
|
+
if (!base || row?.extended === void 0) return base;
|
|
28
|
+
const extended = asOptionalRecord(row.extended);
|
|
29
|
+
const rates = readVeniceRates(extended);
|
|
30
|
+
const threshold = asFiniteNumberInRange(extended?.context_token_threshold, {
|
|
31
|
+
min: 0,
|
|
32
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
33
|
+
maxExclusive: true
|
|
34
|
+
});
|
|
35
|
+
if (!rates || threshold === void 0) return;
|
|
36
|
+
if (["cache_input", "cache_write"].some((field) => row[field] !== void 0 && extended?.[field] === void 0)) return;
|
|
37
|
+
const start = Math.floor(threshold) + 1;
|
|
38
|
+
return {
|
|
39
|
+
...base,
|
|
40
|
+
tieredPricing: [{
|
|
41
|
+
...base,
|
|
42
|
+
range: [0, start]
|
|
43
|
+
}, {
|
|
44
|
+
...rates,
|
|
45
|
+
range: [start]
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Public lightweight publisher entrypoint; vendor payload interpretation stays in this plugin. */
|
|
50
|
+
function parseVenicePricingCatalog(payload) {
|
|
51
|
+
return normalizeModelPricingCatalog(asOptionalRecord(payload)?.data, parseVeniceModelPricing, (model) => model.type === "text" ? asOptionalRecord(model.model_spec)?.pricing : void 0);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { parseVeniceModelPricing, parseVenicePricingCatalog };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "
|
|
1
|
+
import { r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./.setup/models-Bcq-4SGP.mjs";
|
|
2
2
|
//#region extensions/venice/provider-catalog.ts
|
|
3
3
|
function buildStaticVeniceProvider() {
|
|
4
4
|
return {
|
package/dist/usage.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-htt
|
|
|
2
2
|
import { buildUsageHttpErrorSnapshot, parseProviderUsageNonNegativeNumber } from "openclaw/plugin-sdk/provider-usage";
|
|
3
3
|
//#region extensions/venice/usage.ts
|
|
4
4
|
const VENICE_BALANCE_URL = "https://api.venice.ai/api/v1/billing/balance";
|
|
5
|
-
const VENICE_USAGE_RESPONSE_MAX_BYTES =
|
|
5
|
+
const VENICE_USAGE_RESPONSE_MAX_BYTES = 1048576;
|
|
6
6
|
async function readPayload(response, timeoutMs) {
|
|
7
7
|
return await readProviderJsonObjectResponse(response, "Venice usage", {
|
|
8
8
|
maxBytes: VENICE_USAGE_RESPONSE_MAX_BYTES,
|
package/openclaw.plugin.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"contracts": {
|
|
9
9
|
"usageProviders": ["venice"]
|
|
10
10
|
},
|
|
11
|
+
"modelPricing": {
|
|
12
|
+
"providers": {
|
|
13
|
+
"venice": { "venice": { "provider": "venice" } }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
11
16
|
"providerAuthChoices": [
|
|
12
17
|
{
|
|
13
18
|
"provider": "venice",
|
|
@@ -160,7 +165,28 @@
|
|
|
160
165
|
"input": ["text", "image"],
|
|
161
166
|
"contextWindow": 500000,
|
|
162
167
|
"maxTokens": 32000,
|
|
163
|
-
"cost": {
|
|
168
|
+
"cost": {
|
|
169
|
+
"input": 2.27,
|
|
170
|
+
"output": 6.8,
|
|
171
|
+
"cacheRead": 0.34,
|
|
172
|
+
"cacheWrite": 0,
|
|
173
|
+
"tieredPricing": [
|
|
174
|
+
{
|
|
175
|
+
"input": 2.27,
|
|
176
|
+
"output": 6.8,
|
|
177
|
+
"cacheRead": 0.34,
|
|
178
|
+
"cacheWrite": 0,
|
|
179
|
+
"range": [0, 200001]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"input": 4.53,
|
|
183
|
+
"output": 13.6,
|
|
184
|
+
"cacheRead": 0.68,
|
|
185
|
+
"cacheWrite": 0,
|
|
186
|
+
"range": [200001]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
164
190
|
"compat": {
|
|
165
191
|
"supportsUsageInStreaming": false
|
|
166
192
|
}
|
|
@@ -184,7 +210,28 @@
|
|
|
184
210
|
"input": ["text", "image"],
|
|
185
211
|
"contextWindow": 1000000,
|
|
186
212
|
"maxTokens": 65536,
|
|
187
|
-
"cost": {
|
|
213
|
+
"cost": {
|
|
214
|
+
"input": 0.5,
|
|
215
|
+
"output": 2,
|
|
216
|
+
"cacheRead": 0.05,
|
|
217
|
+
"cacheWrite": 0.625,
|
|
218
|
+
"tieredPricing": [
|
|
219
|
+
{
|
|
220
|
+
"input": 0.5,
|
|
221
|
+
"output": 2,
|
|
222
|
+
"cacheRead": 0.05,
|
|
223
|
+
"cacheWrite": 0.625,
|
|
224
|
+
"range": [0, 256001]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"input": 1.5,
|
|
228
|
+
"output": 6,
|
|
229
|
+
"cacheRead": 0.15,
|
|
230
|
+
"cacheWrite": 1.875,
|
|
231
|
+
"range": [256001]
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
188
235
|
"compat": {
|
|
189
236
|
"supportsUsageInStreaming": false
|
|
190
237
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/venice-provider",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.33",
|
|
4
4
|
"description": "OpenClaw Venice provider plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"minHostVersion": ">=2026.6.9"
|
|
15
15
|
},
|
|
16
16
|
"compat": {
|
|
17
|
-
"pluginApi": ">=2026.8.
|
|
17
|
+
"pluginApi": ">=2026.8.33"
|
|
18
18
|
},
|
|
19
19
|
"build": {
|
|
20
|
-
"openclawVersion": "2026.8.
|
|
20
|
+
"openclawVersion": "2026.8.33",
|
|
21
21
|
"bundledDist": false
|
|
22
22
|
},
|
|
23
23
|
"release": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.8.
|
|
41
|
+
"openclaw": ">=2026.8.33"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|