apiblaze 0.21.14 → 0.21.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -3
- package/dist/index.js +2193 -1511
- package/dist/server/index.d.mts +16 -7
- package/dist/server/index.d.ts +16 -7
- package/dist/server/index.js +57 -5
- package/dist/server/index.mjs +57 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# apiblaze
|
|
2
2
|
|
|
3
|
+
> **Superseded 2026-09-24** for throttling, quota and credits by `specs/TQC/final_throttling_quota_credits.MD`. Upstash is gone; anything below about Redis keys, Lua gates, leases-on-Upstash or the reclaim/reconcile crons is historical.
|
|
4
|
+
|
|
3
5
|
CLI for [APIblaze](https://apiblaze.com) — chat with your APIs, run them as serverless proxies, and let your customers self-serve keys, users & groups from your own site.
|
|
4
6
|
|
|
5
7
|
---
|
|
@@ -25,7 +27,7 @@ The easiest way is to just chat with it:
|
|
|
25
27
|
npx apiblaze agent
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
> Talk in plain English — "make an API for httpbin.org", "rate
|
|
30
|
+
> Talk in plain English — "make an API for httpbin.org", "set its rate limit to 50/sec",
|
|
29
31
|
> "give me a key". It does the work and shows what each step costs.
|
|
30
32
|
|
|
31
33
|
Prefer commands? A few one-liners:
|
|
@@ -156,7 +158,7 @@ calls it makes — as copy-pasteable `curl` you could run yourself with your own
|
|
|
156
158
|
login token, plus the underlying admin-api leaf each one drives:
|
|
157
159
|
|
|
158
160
|
```bash
|
|
159
|
-
apiblaze
|
|
161
|
+
apiblaze limits set myapi --rate 50 --verbose
|
|
160
162
|
```
|
|
161
163
|
|
|
162
164
|
## Commands
|
|
@@ -218,11 +220,46 @@ Every chat turn shows its cost.
|
|
|
218
220
|
| Command | What it does |
|
|
219
221
|
|---|---|
|
|
220
222
|
| `apiblaze target <project> --url <url> [--env <e>]` | Change where it forwards requests |
|
|
221
|
-
| `apiblaze throttle <project> [--rate n] [--quota n] [--period daily\|weekly\|monthly]` | Set rate limits and quotas |
|
|
222
223
|
| `apiblaze rename <project> --display-name <name>` | Rename it |
|
|
223
224
|
| `apiblaze spec get <project>` | Print its OpenAPI spec |
|
|
224
225
|
| `apiblaze spec set <project> --file <path>` | Replace its OpenAPI spec from a file |
|
|
225
226
|
|
|
227
|
+
### Producer — limits
|
|
228
|
+
|
|
229
|
+
Three names, fixed: **rate limit** (requests per second — Standard mode is approximate per
|
|
230
|
+
location and free, Strict is exact per consumer), **quota** (an exact count per fixed UTC
|
|
231
|
+
window) and **spend cap** (exact dollars per month). Every rate is shown with its 10-second
|
|
232
|
+
figure beside it (`50/s (500 per 10 s)`), because that is the window the Standard limiter counts.
|
|
233
|
+
|
|
234
|
+
| Command | What it does |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `apiblaze limits get <project> [--version v]` | Show mode, rate limits, ceiling, quota, spend cap, credential quota |
|
|
237
|
+
| `apiblaze limits set <project> [--rate n] [--end-user-rate n] [--mode strict\|standard] [--quota n --period daily\|weekly\|monthly] [--spend-cap usd] [--credential-quota n]` | Change any subset (`--quota none` / `--spend-cap none` clear). A rate above the self-serve ceiling is refused and the output prints the exact `limits request-max` command |
|
|
238
|
+
| `apiblaze limits request-max <project> --rps n [--use-case "…"]` | Ask for a higher ceiling (instant to 1,000/s for a proven wallet; an operator approves above) |
|
|
239
|
+
| `apiblaze limits usage <project> [--watch]` | The team quota meter: used / in use / limit / resets in. Per-project usage is not exposed by the API yet — the output says so |
|
|
240
|
+
| `apiblaze config <project> limits.<key> [value]` | The same settings by key: `limits.mode`, `limits.consumerRps`, `limits.endUserRps`, `limits.ceilingRps` (read-only), `limits.quota.limit`, `limits.quota.period`, `limits.spendCapCents`. The old `throttling.*` keys still work for one release |
|
|
241
|
+
|
|
242
|
+
> `apiblaze throttle <project> --rate n --quota n --period p` still works for one release: it
|
|
243
|
+
> prints a deprecation line and runs `limits set` with the same numbers.
|
|
244
|
+
|
|
245
|
+
### Producer — billing
|
|
246
|
+
|
|
247
|
+
| Command | What it does |
|
|
248
|
+
|---|---|
|
|
249
|
+
| `apiblaze billing balance [--team]` | Available, in use (pre-paid to live requests), grace owed, status, auto-rebuy, last top-up. Numbers are shown only to the wallet owner |
|
|
250
|
+
| `apiblaze billing topup <usd> [--team] [--open]` | Prints (or opens) the dashboard wallet page for that amount — card checkout runs in your browser session |
|
|
251
|
+
| `apiblaze billing history [--since d] [--until d] [--project p] [--format table\|json\|csv] [--raw]` | Usage and exact cost as daily rollups, per consumer key; `--raw` = hourly |
|
|
252
|
+
| `apiblaze billing rebuy on\|off\|status [--amount usd] [--threshold usd]` | Auto-rebuy: add `--amount` whenever available drops under `--threshold` |
|
|
253
|
+
|
|
254
|
+
When a call is refused for money or limits, every command prints the same thing for the same
|
|
255
|
+
refusal (`application/problem+json`): `service-paused` shows the producer's contact and status
|
|
256
|
+
page (and, if it is your wallet, the `billing topup` hint), `trial-exhausted` the claim URL,
|
|
257
|
+
`quota-exceeded` when it resets, `spend-cap-reached` the `limits set` command, and
|
|
258
|
+
`platform-degraded` when to retry.
|
|
259
|
+
|
|
260
|
+
Exit codes for every command: `0` ok, `1` your input (flags, not found, forbidden), `2` the
|
|
261
|
+
server could not answer (5xx) — retry on 2.
|
|
262
|
+
|
|
226
263
|
> Every command in these two sections accepts `--verbose` (see the equivalent API
|
|
227
264
|
> calls), plus `--team`, `--apiversion`, and `--json`.
|
|
228
265
|
|