@openclaw/chutes-provider 2026.8.1 → 2026.8.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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-Df7LGSwe.js";
1
+ import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BCzv23TU.js";
2
2
  import { CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig } from "./onboard.js";
3
3
  import { buildChutesProvider } from "./provider-catalog.js";
4
4
  export { CHUTES_BASE_URL, CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, CHUTES_MODEL_CATALOG, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig, buildChutesProvider, discoverChutesModels };
@@ -1,3 +1,4 @@
1
+ import { normalizeChutesModelPricing } from "./pricing-api.js";
1
2
  import { asPositiveSafeInteger, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
3
4
  import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
@@ -9,6 +10,7 @@ var openclaw_plugin_default = {
9
10
  activation: { "onStartup": false },
10
11
  enabledByDefault: true,
11
12
  providers: ["chutes"],
13
+ modelPricing: { "providers": { "chutes": { "chutes": { "provider": "chutes" } } } },
12
14
  providerEndpoints: [{
13
15
  "endpointClass": "chutes-native",
14
16
  "hosts": ["llm.chutes.ai"]
@@ -64,7 +66,7 @@ var openclaw_plugin_default = {
64
66
  "cost": {
65
67
  "input": 1,
66
68
  "output": 1,
67
- "cacheRead": .5,
69
+ "cacheRead": .09999999999999998,
68
70
  "cacheWrite": 0
69
71
  }
70
72
  },
@@ -76,9 +78,9 @@ var openclaw_plugin_default = {
76
78
  "contextWindow": 262144,
77
79
  "maxTokens": 65535,
78
80
  "cost": {
79
- "input": .66,
80
- "output": 3.5,
81
- "cacheRead": .33,
81
+ "input": .58,
82
+ "output": 3.4,
83
+ "cacheRead": .05799999999999998,
82
84
  "cacheWrite": 0
83
85
  }
84
86
  },
@@ -108,7 +110,7 @@ var openclaw_plugin_default = {
108
110
  "cost": {
109
111
  "input": 1.25,
110
112
  "output": 3.95,
111
- "cacheRead": .625,
113
+ "cacheRead": .12499999999999997,
112
114
  "cacheWrite": 0
113
115
  }
114
116
  },
@@ -136,7 +138,7 @@ var openclaw_plugin_default = {
136
138
  "cost": {
137
139
  "input": .3,
138
140
  "output": 2,
139
- "cacheRead": .15,
141
+ "cacheRead": .029999999999999992,
140
142
  "cacheWrite": 0
141
143
  }
142
144
  },
@@ -150,7 +152,7 @@ var openclaw_plugin_default = {
150
152
  "cost": {
151
153
  "input": .45,
152
154
  "output": 3,
153
- "cacheRead": .225,
155
+ "cacheRead": .04499999999999999,
154
156
  "cacheWrite": 0
155
157
  },
156
158
  "status": "deprecated",
@@ -185,7 +187,7 @@ const CHUTES_MODEL_CATALOG = buildManifestModelProviderConfig({
185
187
  providerId: "chutes",
186
188
  catalog: CHUTES_MANIFEST_CATALOG
187
189
  }).models.map(decorateChutesModelDefinition);
188
- const CACHE_TTL = 300 * 1e3;
190
+ const CACHE_TTL = 3e5;
189
191
  function projectChutesModels(rows) {
190
192
  const seen = /* @__PURE__ */ new Set();
191
193
  const models = [];
@@ -201,10 +203,10 @@ function projectChutesModels(rows) {
201
203
  name: id,
202
204
  reasoning: entry.supported_features?.includes("reasoning") || lowerId.includes("r1") || lowerId.includes("thinking") || lowerId.includes("reason") || lowerId.includes("tee"),
203
205
  input: (entry.input_modalities || ["text"]).filter((item) => item === "text" || item === "image"),
204
- cost: {
205
- input: entry.pricing?.prompt || 0,
206
- output: entry.pricing?.completion || 0,
207
- cacheRead: entry.pricing?.input_cache_read || 0,
206
+ cost: normalizeChutesModelPricing(entry.pricing) ?? {
207
+ input: 0,
208
+ output: 0,
209
+ cacheRead: 0,
208
210
  cacheWrite: 0
209
211
  },
210
212
  contextWindow: asPositiveSafeInteger(entry.context_length) ?? asPositiveSafeInteger(entry.max_model_len) ?? CHUTES_DEFAULT_CONTEXT_WINDOW,
package/dist/models.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-Df7LGSwe.js";
1
+ import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BCzv23TU.js";
2
2
  export { CHUTES_BASE_URL, CHUTES_MODEL_CATALOG, discoverChutesModels };
package/dist/oauth.js CHANGED
@@ -48,7 +48,7 @@ function buildAuthorizeUrl(params) {
48
48
  function resolveChutesExpiresAt(value, now) {
49
49
  return resolveExpiresAtMsFromDurationSeconds(value, {
50
50
  nowMs: now,
51
- bufferMs: 300 * 1e3,
51
+ bufferMs: 3e5,
52
52
  minRemainingMs: 3e4
53
53
  });
54
54
  }
@@ -158,7 +158,7 @@ async function refreshChutesOAuthCredential(credential, options = {}) {
158
158
  async function loginChutes(params) {
159
159
  const { verifier, challenge } = generatePkceVerifierChallenge();
160
160
  const state = params.createState?.() ?? randomBytes(16).toString("hex");
161
- const timeoutMs = params.timeoutMs ?? 180 * 1e3;
161
+ const timeoutMs = params.timeoutMs ?? 18e4;
162
162
  const url = buildAuthorizeUrl({
163
163
  clientId: params.app.clientId,
164
164
  redirectUri: params.app.redirectUri,
package/dist/onboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as openclaw_plugin_default, n as CHUTES_MODEL_CATALOG, t as CHUTES_BASE_URL } from "./models-Df7LGSwe.js";
1
+ import { i as openclaw_plugin_default, n as CHUTES_MODEL_CATALOG, t as CHUTES_BASE_URL } from "./models-BCzv23TU.js";
2
2
  import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
3
3
  import { applyAgentDefaultModelPrimary, createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
4
4
  //#region extensions/chutes/onboard.ts
@@ -6,11 +6,11 @@ const CHUTES_DEFAULT_MODEL_ID = openclaw_plugin_default.modelCatalog.providers.c
6
6
  const CHUTES_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "chutes");
7
7
  const chutesPresetAppliers = createModelCatalogPresetAppliers({
8
8
  primaryModelRef: CHUTES_DEFAULT_MODEL_REF,
9
- resolveParams: (_cfg) => ({
9
+ resolveParams: (cfg) => ({
10
10
  providerId: "chutes",
11
11
  api: "openai-completions",
12
12
  baseUrl: CHUTES_BASE_URL,
13
- catalogModels: structuredClone(CHUTES_MODEL_CATALOG),
13
+ catalogModels: cfg.models?.mode === "replace" ? structuredClone(CHUTES_MODEL_CATALOG) : [],
14
14
  aliases: [
15
15
  ...CHUTES_MODEL_CATALOG.map((model) => `chutes/${model.id}`),
16
16
  {
@@ -0,0 +1,22 @@
1
+ import { asFiniteNumberInRange, asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ import { normalizeModelPricingCatalog } from "openclaw/plugin-sdk/model-catalog-pricing";
3
+ //#region extensions/chutes/pricing-api.ts
4
+ /** Chutes publishes numeric USD-per-million rates, not OpenRouter's per-token strings. */
5
+ function normalizeChutesModelPricing(value) {
6
+ const pricing = asOptionalRecord(value);
7
+ const input = asFiniteNumberInRange(pricing?.prompt, { min: 0 });
8
+ const output = asFiniteNumberInRange(pricing?.completion, { min: 0 });
9
+ const cacheRead = pricing?.input_cache_read === void 0 ? 0 : asFiniteNumberInRange(pricing.input_cache_read, { min: 0 });
10
+ if (input === void 0 || output === void 0 || cacheRead === void 0) return;
11
+ return {
12
+ input,
13
+ output,
14
+ cacheRead,
15
+ cacheWrite: 0
16
+ };
17
+ }
18
+ function parseChutesPricingCatalog(payload) {
19
+ return normalizeModelPricingCatalog(asOptionalRecord(payload)?.data, normalizeChutesModelPricing);
20
+ }
21
+ //#endregion
22
+ export { normalizeChutesModelPricing, parseChutesPricingCatalog };
@@ -1,4 +1,4 @@
1
- import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-Df7LGSwe.js";
1
+ import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BCzv23TU.js";
2
2
  //#region extensions/chutes/provider-catalog.ts
3
3
  /** Builds the static Chutes provider catalog from bundled model metadata. */
4
4
  function buildStaticChutesProvider() {
@@ -14,11 +14,10 @@ function buildStaticChutesProvider() {
14
14
  * Accepts an optional access token (API key or OAuth access token) for authenticated discovery.
15
15
  */
16
16
  async function buildChutesProvider(accessToken) {
17
- const models = await discoverChutesModels(accessToken);
18
17
  return {
19
18
  baseUrl: CHUTES_BASE_URL,
20
19
  api: "openai-completions",
21
- models: models.length > 0 ? models : structuredClone(CHUTES_MODEL_CATALOG)
20
+ models: await discoverChutesModels(accessToken)
22
21
  };
23
22
  }
24
23
  //#endregion
@@ -5,6 +5,11 @@
5
5
  },
6
6
  "enabledByDefault": true,
7
7
  "providers": ["chutes"],
8
+ "modelPricing": {
9
+ "providers": {
10
+ "chutes": { "chutes": { "provider": "chutes" } }
11
+ }
12
+ },
8
13
  "providerEndpoints": [
9
14
  {
10
15
  "endpointClass": "chutes-native",
@@ -76,7 +81,7 @@
76
81
  "cost": {
77
82
  "input": 1,
78
83
  "output": 1,
79
- "cacheRead": 0.5,
84
+ "cacheRead": 0.09999999999999998,
80
85
  "cacheWrite": 0
81
86
  }
82
87
  },
@@ -88,9 +93,9 @@
88
93
  "contextWindow": 262144,
89
94
  "maxTokens": 65535,
90
95
  "cost": {
91
- "input": 0.66,
92
- "output": 3.5,
93
- "cacheRead": 0.33,
96
+ "input": 0.58,
97
+ "output": 3.4,
98
+ "cacheRead": 0.05799999999999998,
94
99
  "cacheWrite": 0
95
100
  }
96
101
  },
@@ -120,7 +125,7 @@
120
125
  "cost": {
121
126
  "input": 1.25,
122
127
  "output": 3.95,
123
- "cacheRead": 0.625,
128
+ "cacheRead": 0.12499999999999997,
124
129
  "cacheWrite": 0
125
130
  }
126
131
  },
@@ -148,7 +153,7 @@
148
153
  "cost": {
149
154
  "input": 0.3,
150
155
  "output": 2,
151
- "cacheRead": 0.15,
156
+ "cacheRead": 0.029999999999999992,
152
157
  "cacheWrite": 0
153
158
  }
154
159
  },
@@ -162,7 +167,7 @@
162
167
  "cost": {
163
168
  "input": 0.45,
164
169
  "output": 3,
165
- "cacheRead": 0.225,
170
+ "cacheRead": 0.04499999999999999,
166
171
  "cacheWrite": 0
167
172
  },
168
173
  "status": "deprecated",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/chutes-provider",
3
- "version": "2026.8.1",
3
+ "version": "2026.8.2",
4
4
  "description": "OpenClaw Chutes.ai provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.6.8"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.8.1"
21
+ "pluginApi": ">=2026.8.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.8.1",
24
+ "openclawVersion": "2026.8.2",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -38,7 +38,7 @@
38
38
  "README.md"
39
39
  ],
40
40
  "peerDependencies": {
41
- "openclaw": ">=2026.8.1"
41
+ "openclaw": ">=2026.8.2"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "openclaw": {