billing.autotopup
Change auto top-up: on or off, threshold, draw size.
Details
- Endpoint
- PUT /v1/billing/autotopup
- Credits
- Free
- Rate class
- Light. Counts against your light requests per second.
Sets when tide draws (`thresholdCredits`: credits left under this) and how much (`drawUsd`, at most the allowance's per-window cap), or pauses it (`enabled: false`). The on-chain allowance is unchanged; revoke it on chain to stop tide for good.
Parameters
| Name | Type | Description |
|---|---|---|
| enabled | boolean | |
| thresholdCredits | integer | |
| drawUsd | string or number |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X PUT "https://api.tide.ad/v1/billing/autotopup" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"thresholdCredits": 500000,
"drawUsd": "5"
}'TypeScript
const res = await fetch("https://api.tide.ad/v1/billing/autotopup", {
method: "PUT",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"thresholdCredits": 500000,
"drawUsd": "5"
}),
});
const data = await res.json();Response
JSON
{
"autoTopup": {
"enabled": true,
"thresholdCredits": 500000,
"drawUsd": "5"
}
}