Top up credits
top_up_creditsBuy one credit pack on the card your human enrolled, within the monthly top-up limit they set — no new human approval. This CHARGES the human’s card. Pass forCallCredits: the credits the call you are about to make will spend. A pack is charged only when your spendable credits are below that — the recorded consent charges a pack “each time your credits are not enough for a call you make”, so state what that call needs (from a quote or your plan’s per-call cost); when your credits already cover it, nothing is charged (not_needed). Pass a requestId you choose as an idempotency handle: a NEW value for each top-up you intend, the SAME value only to re-send a call that may not have completed (a retry returns the pack already charged, never a second one). Read status: bought added credits (creditsAdded) — unless replayed is true, which means this requestId had already bought one and nothing new was charged (use a new id next time); pending means YOUR pack was charged and is awaiting confirmation (read the balance shortly); busy means another top-up is already being charged — nothing was charged for THIS request, so check your balance shortly and re-send the SAME requestId only if you still need one; limit_reached means this UTC month’s top-up limit is used up (no charge — do not retry until next month); not_needed means your credits already cover the call (no charge); needs_attention means the card was declined or needs 3-D Secure, a card payment to Nevermined is disputed, a human must finish setting top-ups up, a prior top-up is stuck, or a prior top-up’s outcome is unconfirmed (it may have been charged) — hand the human operatorUrl, never try to confirm it yourself, and do not start a new top-up until they act; disabled means a human must turn top-ups on first (give them operatorUrl); unavailable means nothing was charged — retry with a NEW requestId (reusing this one keeps returning the same settled result). monthlyLimitUsd/boughtThisMonthUsd/packPriceUsd are the human-set limit and this month’s spend. Requires your Nevermined API key on the Authorization header; a commerce OAuth grant must have enabled credit top-ups at consent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | An idempotency handle you choose (8–200 chars, letters/digits/._:-). Use a NEW value for each top-up you intend; reuse the SAME value only to re-send a call that may not have completed. | |
| forCallCredits | Yes | The credits the call you are about to make will spend. A pack is charged only when your spendable credits are below this; when they already cover it, nothing is charged (`not_needed`). |