Skip to content

fix(venice): classify insufficient-balance 402 as payment_required (v0.18.1) - #44

Merged
clawnchdev merged 1 commit into
mainfrom
fix/venice-payment-required
Jun 9, 2026
Merged

fix(venice): classify insufficient-balance 402 as payment_required (v0.18.1)#44
clawnchdev merged 1 commit into
mainfrom
fix/venice-payment-required

Conversation

@clawnchdev

Copy link
Copy Markdown
Owner

Venice returns HTTP 402 for two distinct conditions:

  • missing/invalid key → "Authentication required"
  • valid key, empty account"Insufficient USD or Diem balance… add credits"

v0.18.0 classified both as no_credentials. This splits the balance case into a new payment_required code so the failure is actionable (top up vs fix auth).

Surfaced while live-testing a real Venice key: the key authenticated fine — the account just had no credits. Adds a unit test for the new branch; full suite green at 100% coverage; plugin.yaml byte-identical.

…(v0.18.1)

Venice returns HTTP 402 for two different conditions: a missing/invalid key
("Authentication required") and a valid key on an account with no funds
("Insufficient USD or Diem balance"). Both were classified as no_credentials;
the balance case now raises payment_required so callers know to add credits
(venice.ai/settings/api) rather than fix auth. Found while live-testing a real
Venice key — the key authenticated fine, the account was just empty.

Gate: full suite green, 100% coverage; ruff clean; plugin.yaml byte-identical.
@clawnchdev
clawnchdev merged commit 60e563e into main Jun 9, 2026
4 checks passed
@clawnchdev
clawnchdev deleted the fix/venice-payment-required branch June 9, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant