add_credits
Compatibility credit grant (1-10000); beta customer operations are already free.
When VHGENGINE_ADMIN_KEY is configured on the deployment this requires a
matching admin_key argument; otherwise it stays self-serve (unless
VHGENGINE_FREE_CREDITS is off). Idempotent on idempotency_key (replay does NOT
grant twice). Returns {credits (new balance), granted}. Errors: unauthorized
(missing/wrong admin key or self-serve disabled), invalid_request (amount range
/ balance ceiling), idempotency_conflict, rate_limited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Compatibility credits to add, 1-10000. Customer operations are free during beta, so this is not required for access. The grant has a per-account balance ceiling. | |
| api_key | No | API key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized. | |
| admin_key | No | The deployment's VHGENGINE_ADMIN_KEY. Required ONLY when the operator configured one; omit on a self-serve deployment. A wrong or missing value where one is configured is unauthorized. | |
| idempotency_key | No | Caller-chosen replay key (any string, unique per intended effect). A repeat call with the SAME key returns the stored result and is NEVER charged twice; the same key with different arguments is an idempotency_conflict. Omit and every call is a fresh, separately charged operation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| credits | No | Balance AFTER the grant. | |
| granted | No | Credits added by this call; 0 on an idempotent replay. | |
| replayed | No | true when an earlier call with the same idempotency_key already granted. |