Skip to content

Commit 1adf377

Browse files
committed
test(venice): verify pricing through setup and explicit overrides
Preserve the canonical manifest model definition without redundant input copying, use a neutral unknown-model fixture, and cover fresh onboarding prices plus existing zero/custom overrides. Document pricing ownership and remove the API-key-printing troubleshooting example. The full candidate has three failing-before pricing regressions and 90 passing focused tests. Full build, changed-file gates, and fresh isolated P0-scoped Codex review pass. Real catalog/discovery and usage-estimator probes preserve all 19 known base prices and 92 unknown zero estimates; synthetic token totals render $3.31 instead of $0.0000. No inference or provider-billing claim is made.
1 parent 7bd7b92 commit 1adf377

4 files changed

Lines changed: 34 additions & 13 deletions

File tree

‎docs/providers/venice.md‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ Venice uses a credit-based system. Anonymized models cost roughly the same as
164164
direct API pricing plus a small Venice fee. See
165165
[venice.ai/pricing](https://venice.ai/pricing) for current rates.
166166

167+
OpenClaw uses the Venice plugin manifest's prices for bundled models, including
168+
when those models appear in live discovery. Newly discovered models outside the
169+
manifest keep zero estimates until pricing is configured; zero does not mean the
170+
model is free.
171+
172+
Existing explicit model prices take precedence, including zero. Onboarding
173+
preserves existing model entries rather than replacing their prices. If an older
174+
configuration contains obsolete zero rates, back up your configuration and update
175+
only the affected `models.providers.venice.models[].cost` fields to current rates.
176+
Keep intentional custom prices. See [Token use and costs](/reference/token-use)
177+
for pricing units and usage reporting.
178+
167179
## Usage examples
168180

169181
```bash
@@ -188,11 +200,11 @@ openclaw agent --model venice/qwen3-coder-480b-a35b-instruct-turbo --message "Re
188200
<AccordionGroup>
189201
<Accordion title="API key not recognized">
190202
```bash
191-
echo $VENICE_API_KEY
192-
openclaw models list | grep venice
203+
openclaw models list --provider venice
193204
```
194205

195-
Confirm the key starts with `vapi_`.
206+
Confirm the API key is configured and starts with `vapi_`; do not print or
207+
share its value.
196208

197209
</Accordion>
198210

‎extensions/venice/models.test.ts‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ describe("venice-models", () => {
204204
stubVeniceModelsFetch([
205205
{ id: "zai-org-glm-4.7" },
206206
{ id: "claude-opus-5" },
207-
{ id: "stealth-ox-alpha" },
208-
{ id: "gemini-3-6-flash" },
207+
{ id: "unknown-model-without-pricing" },
209208
]);
210209
const manifestCosts = new Map(
211210
manifest.modelCatalog.providers.venice.models.map(({ id, cost }) => [id, cost]),
@@ -217,11 +216,7 @@ describe("venice-models", () => {
217216
{ id: "zai-org-glm-4.7", cost: manifestCosts.get("zai-org-glm-4.7") },
218217
{ id: "claude-opus-5", cost: manifestCosts.get("claude-opus-5") },
219218
{
220-
id: "stealth-ox-alpha",
221-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
222-
},
223-
{
224-
id: "gemini-3-6-flash",
219+
id: "unknown-model-without-pricing",
225220
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
226221
},
227222
]);

‎extensions/venice/models.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const VENICE_DISCOVERY_CACHE_TTL_MS = 60_000;
3030
function decorateVeniceModelDefinition(entry: ModelDefinitionConfig): ModelDefinitionConfig {
3131
return {
3232
...entry,
33-
input: [...entry.input],
3433
compat: {
3534
supportsUsageInStreaming: false,
3635
...entry.compat,

‎extensions/venice/onboard.test.ts‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe("Venice onboarding", () => {
88
it("applies the manifest catalog, default, and alias", () => {
99
const config = applyVeniceConfig({});
1010

11-
expect(config.models?.providers?.venice?.models.map((model) => model.id)).toEqual(
12-
manifest.modelCatalog.providers.venice.models.map((model) => model.id),
11+
expect(config.models?.providers?.venice?.models.map(({ id, cost }) => ({ id, cost }))).toEqual(
12+
manifest.modelCatalog.providers.venice.models.map(({ id, cost }) => ({ id, cost })),
1313
);
1414
expect(resolveAgentModelPrimaryValue(config.agents?.defaults?.model)).toBe(
1515
VENICE_DEFAULT_MODEL_REF,
@@ -19,4 +19,19 @@ describe("Venice onboarding", () => {
1919
[VENICE_DEFAULT_MODEL_REF]: { alias: "GLM 4.7" },
2020
});
2121
});
22+
23+
it.each([
24+
{ label: "zero", cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } },
25+
{ label: "custom", cost: { input: 1, output: 2, cacheRead: 0.25, cacheWrite: 0.5 } },
26+
])("preserves existing $label pricing when onboarding again", ({ cost }) => {
27+
const config = applyVeniceConfig({});
28+
const model = config.models!.providers!.venice!.models[0]!;
29+
model.cost = { ...cost };
30+
31+
const reapplied = applyVeniceConfig(config);
32+
33+
expect(
34+
reapplied.models?.providers?.venice?.models.find(({ id }) => id === model.id)?.cost,
35+
).toEqual(cost);
36+
});
2237
});

0 commit comments

Comments
 (0)