Skip to content

No Usage Events

Use this checklist when provider calls succeed but Spendware analytics do not show expected usage.

Check Runtime Credentials

  • Confirm provider adapters use a customer key by default. If you intentionally use a user API key, include the intended customer ID in bearer-auth runtime context for every request.
  • Confirm the customer key has usage:write for logging.
  • Confirm preflight calls have preflight:read if preflight is enabled.
  • Confirm the runtime service uses the intended SPENDWARE_BASE_URL.

Check SDK Behavior

  • If async logging is enabled, call shutdown() or the SDK cleanup method before process exit.
  • Check whether dry-run mode is enabled. Dry-run skips backend calls.
  • Check queue and retry settings if the process exits quickly or sends high-volume traffic.

Check Context

  • Verify customer and project IDs are correct.
  • Use stable external IDs if internal Spendware IDs are not available at runtime.
  • Confirm multi-tenant services resolve context per request rather than sharing one global customer.
  • If the key was lost after creation, create a replacement or rotate it; raw key material is intentionally shown only once.

Check Analytics Window

  • Query with an explicit date range.
  • Check project, customer, provider, feature, and model filters.
  • For unresolved partial usage, query with partials_mode: include_eligible_partials or finalize the partial resources first.
  • Confirm write-side payloads use raw token and request counts.

Useful Calls

curl "$SPENDWARE_BASE_URL/api/v1/usage/query-usage?include_statistics=true" \
  -H "Authorization: Bearer $SPENDWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer_ids":["CUSTOMER_ID"]}'
usage = client.usage.query({"customer_ids": ["CUSTOMER_ID"]}, include_statistics=True)
const usage = await client.usage.query({ customer_ids: ["CUSTOMER_ID"] }, { includeStatistics: true });