Auto-reload
Off by default. When on, the card saved at checkout buys a pack whenever the balance drops below the threshold (default 1,000), within a monthly cap.
Turn it on when you buy (the switch under the packs on pricing), on the success page, or with the API below. The MCP tools contextfetch_balance and contextfetch_auto_reload call the same endpoints.
POST/v1/billing/auto-reload
Credits: 0
Turn auto-reload on or off, or change it. After a deduction leaves the balance strictly below threshold, the card saved at checkout buys pack once, as long as this UTC month's auto-reload spend plus the pack price stays within monthly_max_usd. Credits arrive when the payment succeeds. A declined payment turns auto-reload off and sets last_error. Through the API a key can turn it off, lower values or change the pack, but monthly_max_usd can never go above $500; a higher cap needs the browser success page. MCP tool: contextfetch_auto_reload.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization / x-api-key | header | string | yes | The key to change. |
| enabled | body | bool | yes | true to turn auto-reload on, false to turn it off. |
| threshold | body | int | no | Reload when credits drop below this. 100 to 100,000, default 1,000. |
| pack | body | "instant" | "builder" | "scale" | no | Pack to buy on each reload, default builder. |
| monthly_max_usd | body | number | no | Monthly spending cap in USD, at most 500 through the API. Default 500. |
Example request
curl -s https://api.contextfetch.dev/v1/billing/auto-reload \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"enabled":true,"threshold":1000,"pack":"builder","monthly_max_usd":500}'Example response
{
"credits": 14873,
"auto_reload": {
"enabled": true,
"threshold": 1000,
"pack": "builder",
"monthly_max_usd": 500,
"spent_this_month_usd": 50,
"last_error": null
},
"burn_rate_per_day": 412
}Errors
| Status | Body | When |
|---|---|---|
| 401 | {"error": "invalid_api_key"} | The key is unknown. |
| 409 | {"error": "no_payment_method", "message": "..."} | Auto-reload requested for a key without a saved card. The message carries a buy link; buy with auto-reload on to save one. |
| 422 | - | Request validation failed, e.g. a query over 2,000 characters or a threshold outside 100 to 100,000. |