Skip to content

Testing provider charges

The wizard creates a one-hour, non-monetary verification run. Call the normal charge endpoint once for every configured event, using the supplied run ID and charge token. Verification calls create no debit, commission, provider credit, or production charge ledger entry.

The Node SDK contract tests cover retry-safe idempotency, partial chargedCount, and non-retryable validation errors. Run them with npm test in services/provider-sdk.

Backend integration coverage still required before production rollout includes:

  1. A valid active event charge and resulting wallet/provider ledger entries.
  2. Replay of the same (runId, idempotencyKey) without a second debit.
  3. Partial count at the signed run budget.
  4. Unknown or non-active event rejection.
  5. Expired, malformed, run-mismatched, and provider-mismatched charge tokens.
  6. Zero-price event behavior.
  7. Concurrent charge requests against the same run budget.
  8. OpenMeter failure while the local ledger remains committed.
  9. tool_call_fixed behavior after a successful upstream tool call.
  10. Revision approval atomically disabling the previous approved entry.

AgenticProviderClient accepts fetchImpl, so SDK unit tests can assert URL construction, security headers, request body, replay handling, and error propagation without network calls.