Auto top-up charges a saved bank card on a schedule and credits the amount to your balance. This ensures your balance never drops to zero mid-project.
Subscriptions are managed from Dashboard → Subscriptions.
How it works
Add a bank card
A card is saved automatically the first time you complete a card payment. You can view saved cards in Dashboard → Billing.
Create a subscription
Choose a saved card and the amount to top up. The charge runs on the scheduled date each period.
Automatic charge
On the scheduled date, the card is charged and the amount is credited to your balance instantly.
Pause or cancel anytime
Cancel a subscription at any time from the dashboard or via the API. No penalty.
API reference
List saved cards
Before creating a subscription, retrieve your saved card IDs.
curl https://modelswitch.io/api/cards \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
"cards": [
{"id": 1, "lastFour": "4242", "cardType": "Visa"}
]
}
Create a subscription
curl -X POST https://modelswitch.io/api/subscriptions \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"cardId": 1, "amount": "2000"}'
amount is in RUB. Minimum top-up is 100 RUB.
List subscriptions
curl https://modelswitch.io/api/subscriptions \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
"subscriptions": [
{
"id": 1,
"amount": 2000,
"status": "active",
"nextChargeAt": "2024-02-01T00:00:00Z"
}
]
}
Cancel a subscription
curl -X DELETE https://modelswitch.io/api/subscriptions/1 \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Cancellation takes effect immediately. The subscription will not run on its next scheduled date.
Low-balance notifications
You can receive email alerts when your balance falls below a threshold, independent of auto top-up.
Configure notifications from Dashboard → Settings → Notifications, or via the API:
curl -X PUT https://modelswitch.io/api/settings/notifications \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"emailNotificationsEnabled": true,
"lowBalanceThreshold": 500,
"notificationIntervalHours": 24
}'
| Field | Description |
|---|
emailNotificationsEnabled | Enable or disable email alerts |
lowBalanceThreshold | Balance level (in RUB) that triggers an alert |
notificationIntervalHours | Minimum hours between repeated alerts |
Combine auto top-up with low-balance notifications: set the notification threshold above your auto top-up trigger so you have advance warning if a charge fails.