Skip to navigation

Update Pay as You Go Usage Settings

View as Markdown

Turn metered usage past the monthly allowances on or off and choose how it is paid. PREPAID_CREDIT uses retained credit without a subscription; USAGE_INVOICE requires an eligible paid Stripe plan. Send {“enabled”:false} to stop recording it. Returns the settings with this UTC month’s priced usage. Only a verified first-party user session may grant or revoke assistantPurchaseEnabled; that permission alone provisions nothing and enables no usage. Delegated OAuth/API-key mutations require the stored permission and an exact user authorizationQuote before enabling usage or changing funding or limits. Ask the user about funding and whether to keep, set, or clear the monthly cap before calling. Only a first-party session may authorize or revise automatic card top-ups. Quotes are approval evidence, not independently verified conversation transcripts.

Authentication

AuthorizationBearer

Your aVenture API key (https://aventure.vc/settings/api-keys) or OAuth access token

Request

This endpoint expects an object.
assistantPurchaseEnabledboolean or nullOptional

Allow assistant billing changes. Only a verified first-party user session may set or clear this permission; null revokes it. Omission preserves it.

authorizationQuotestring or nullOptional0-4000 characters

Exact user quote authorizing this delegated settings change, including the funding and monthly cap decision (keep, set, or no cap). Required for delegated changes that enable usage or change funding, cap, or invoice increment. Ask the user first; send their words unchanged. This quote is retained verbatim, never returned as settings.

autoTopUpAmountCentslong or nullOptional

Full amount of each automatic purchase, selected from the credit-pack catalog. No amount is preselected.

autoTopUpCardRevisionstring or nullOptional

The displayed default card’s current revision. Send it when accepting or revising standing top-up terms; omission never renews consent.

autoTopUpEnabledboolean or nullOptional

Authorize automatic purchases only on the approved card. If the default card differs at the pre-charge check, top-up pauses. A later default change cannot stop an admitted charge. Null turns top-up off; omission keeps the current choice.

enabledboolean or nullOptional
Turn recording of usage past the monthly caps on or off.
expectedPriceRevisionstring or nullOptional
The plan catalog's additionalUsagePriceRevision from the prices the user reviewed, sent with expectedTermsRevision.
expectedTermsRevisionstring or nullOptional

The termsRevision the user reviewed, sent with expectedPriceRevision; sending only one is rejected. When either is no longer current, nothing is saved and the request fails with 409 billing_additional_usage_terms_changed. Omitting both skips the check.

fundingenum or nullOptional

PREPAID_CREDIT spends purchased credit packs and stops when they run out. USAGE_INVOICE bills an invoice each time unbilled usage reaches invoiceIncrementCents, subject to an optional monthly spendCapCents.

Allowed values:
invoiceIncrementCentslong or nullOptional

Unbilled cents that trigger a USAGE_INVOICE invoice; one of the plan catalog’s invoiceIncrementCents.

spendCapCentslong or nullOptional

Optional monthly usage spend cap in cents; null clears it for either funding type.

Response headers

X-RateLimit-LimitintegerOptional

Requests allowed per client IP in the current rate-limit window.

X-RateLimit-RemainingintegerOptional

Requests left before the tightest applicable rate-limit bucket rejects.

X-RateLimit-ResetintegerOptional

Seconds until the exhausted rate-limit bucket admits another request; 0 when none is exhausted.

Response

OK
availableCreditCentsdouble

Spendable prepaid credit after pending usage and invoice-line rounding reserves, in cents.

blockedboolean

True while a failed threshold invoice blocks Pay as You Go Usage; paying it in Billing Portal clears the block.

enabledboolean
Whether usage past the monthly caps is recorded and billed.
meterlist of objects
resetAtdatetime

When spentCents returns to zero: the next UTC month.

spentCentsdouble
Pay as You Go Usage priced this UTC month, in cents.
unbilledCentsdouble

Priced usage not yet paid by credit or placed on an invoice, in cents; the next threshold or period invoice bills it.

assistantPurchaseEnabledbooleanOptionalDefaults to false

Whether assistants may request billing changes with an exact user authorization quote. Defaults to false; only a verified first-party user session may change it. This permission neither enables usage nor buys credit.

autoTopUpAmountCentslong or nullOptional
Selected automatic purchase amount, in USD cents.
autoTopUpEnabledboolean or nullOptional

Whether the account has a current automatic top-up authorization.

autoTopUpStatusenum or nullOptional
Current state of automatic prepaid credit purchases.
autoTopUpThresholdCentslong or nullOptional

Spendable balance below which a debit can trigger a top-up, in USD cents.

fundingenum or nullOptional

PREPAID_CREDIT spends purchased credit packs and stops when they run out. USAGE_INVOICE bills an invoice each time unbilled usage reaches invoiceIncrementCents, subject to an optional monthly spendCapCents.

Allowed values:
invoiceIncrementCentslong or nullOptional

USAGE_INVOICE bills an invoice once unbilled usage reaches this many cents; the invoice can exceed it by the usage recorded while it was being created.

spendCapCentslong or nullOptional

Optional monthly usage spend cap in cents for either funding type. Null means no configured monthly cap. One-time purchases are outside the limit; automatic purchases count toward it.

spendLimitUsedCentsdouble or nullOptional
Usage and automatic purchases counted against this UTC month's limit, in exact cents.
termsRevisionstringOptional

Opaque revision of the terms a user reviews: these settings, the standing automatic top-up approval, and the Pay as You Go Usage prices. Send it as expectedTermsRevision, with the plan catalog’s additionalUsagePriceRevision as expectedPriceRevision, when saving reviewed terms. Spend, balance, status, and reset time never change it. Always present; optional so older readers accept responses without it.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error