zuplo 7.15.30 → 7.15.33

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.
Files changed (82) hide show
  1. package/docs/ai-gateway/custom-pricing.mdx +54 -0
  2. package/docs/ai-gateway/jev.mdx +35 -0
  3. package/docs/ai-gateway/managing-apps.mdx +17 -0
  4. package/docs/ai-gateway/managing-providers.mdx +11 -0
  5. package/docs/ai-gateway/observability/analytics.mdx +2 -2
  6. package/docs/ai-gateway/openrouter.mdx +20 -0
  7. package/docs/ai-gateway/routing.mdx +40 -1
  8. package/docs/ai-gateway/universal-api.mdx +50 -6
  9. package/docs/ai-gateway/user-apps.mdx +44 -2
  10. package/docs/analytics/shared-controls.md +5 -0
  11. package/docs/analytics/tabs/consumers.md +36 -0
  12. package/docs/articles/api-key-api.mdx +16 -1
  13. package/docs/articles/api-key-buckets.mdx +1 -1
  14. package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +1 -1
  15. package/docs/articles/api-key-self-serve-integration.mdx +1 -1
  16. package/docs/articles/api-lint-configuration.mdx +21 -0
  17. package/docs/articles/api-lint-custom-rules.mdx +6 -0
  18. package/docs/articles/branch-based-deployments.mdx +11 -3
  19. package/docs/articles/ci-cd-azure/multi-stage-deployment.mdx +2 -2
  20. package/docs/articles/ci-cd-azure/pr-preview-environments.mdx +23 -4
  21. package/docs/articles/ci-cd-azure/tag-based-releases.mdx +1 -1
  22. package/docs/articles/ci-cd-bitbucket/multi-stage-deployment.mdx +3 -4
  23. package/docs/articles/ci-cd-bitbucket/pr-preview-environments.mdx +6 -5
  24. package/docs/articles/ci-cd-bitbucket/tag-based-releases.mdx +1 -1
  25. package/docs/articles/ci-cd-circleci/multi-stage-deployment.mdx +2 -3
  26. package/docs/articles/ci-cd-circleci/pr-preview-environments.mdx +6 -5
  27. package/docs/articles/ci-cd-circleci/tag-based-releases.mdx +1 -3
  28. package/docs/articles/ci-cd-github/basic-deployment.mdx +6 -6
  29. package/docs/articles/ci-cd-github/cleanup-on-branch-delete.mdx +8 -20
  30. package/docs/articles/ci-cd-github/deploy-and-test.mdx +3 -3
  31. package/docs/articles/ci-cd-github/local-testing.mdx +1 -1
  32. package/docs/articles/ci-cd-github/multi-stage-deployment.mdx +2 -3
  33. package/docs/articles/ci-cd-github/pr-preview-environments.mdx +20 -31
  34. package/docs/articles/ci-cd-github/tag-based-releases.mdx +5 -3
  35. package/docs/articles/ci-cd-gitlab/mr-preview-environments.mdx +10 -4
  36. package/docs/articles/ci-cd-gitlab/multi-stage-deployment.mdx +3 -3
  37. package/docs/articles/ci-cd-gitlab/tag-based-releases.mdx +1 -1
  38. package/docs/articles/custom-ci-cd-azure.mdx +2 -2
  39. package/docs/articles/custom-ci-cd-bitbucket.mdx +2 -2
  40. package/docs/articles/custom-ci-cd-circleci.mdx +2 -2
  41. package/docs/articles/custom-ci-cd-github.mdx +10 -11
  42. package/docs/articles/custom-ci-cd-gitlab.mdx +2 -2
  43. package/docs/articles/environment-variables.mdx +55 -0
  44. package/docs/articles/monetization/api-access.mdx +126 -9
  45. package/docs/articles/monetization/meters.mdx +49 -2
  46. package/docs/articles/monetization/subscription-lifecycle.md +117 -19
  47. package/docs/articles/monetization/usage.mdx +58 -0
  48. package/docs/articles/monorepo-deployment.mdx +10 -25
  49. package/docs/articles/openapi.mdx +14 -0
  50. package/docs/articles/support.mdx +35 -0
  51. package/docs/articles/testing-preview-environments.mdx +1 -1
  52. package/docs/cli/delete.mdx +50 -0
  53. package/docs/cli/delete.partial.mdx +52 -0
  54. package/docs/cli/deploy.mdx +35 -18
  55. package/docs/cli/deploy.partial.mdx +35 -18
  56. package/docs/cli/variable-delete.mdx +36 -0
  57. package/docs/cli/variable-delete.partial.mdx +37 -0
  58. package/docs/concepts/source-control-and-deployment.mdx +5 -5
  59. package/docs/dedicated/source-control.mdx +1 -1
  60. package/docs/dev-portal/dev-portal-create-consumer-on-auth.mdx +1 -1
  61. package/docs/dev-portal/overview.mdx +23 -0
  62. package/docs/dev-portal/zudoku/components/alert.mdx +1 -1
  63. package/docs/dev-portal/zudoku/configuration/api-reference.md +52 -0
  64. package/docs/dev-portal/zudoku/configuration/authentication-auth0.md +25 -0
  65. package/docs/dev-portal/zudoku/configuration/authentication-azure-ad.md +7 -0
  66. package/docs/dev-portal/zudoku/configuration/authentication-openid.md +48 -2
  67. package/docs/dev-portal/zudoku/configuration/authentication.md +4 -0
  68. package/docs/dev-portal/zudoku/configuration/build-configuration.mdx +4 -0
  69. package/docs/dev-portal/zudoku/configuration/navigation.mdx +15 -1
  70. package/docs/dev-portal/zudoku/configuration/overview.md +3 -0
  71. package/docs/dev-portal/zudoku/custom-plugins.md +38 -1
  72. package/docs/dev-portal/zudoku/guides/server-side-content-protection.md +7 -7
  73. package/docs/dev-portal/zudoku/openapi-extensions/x-enum-descriptions.md +85 -0
  74. package/docs/dev-portal/zudoku-partials/configuration/authentication-auth0.partial.md +24 -0
  75. package/docs/errors/build-error.mdx +58 -0
  76. package/docs/mcp-gateway/auth/configuring-entra.mdx +59 -0
  77. package/docs/mcp-gateway/auth/configuring-okta.mdx +30 -6
  78. package/docs/mcp-gateway/auth/configuring-workos.mdx +26 -0
  79. package/docs/mcp-gateway/auth/overview.mdx +2 -2
  80. package/docs/policies/request-validation-inbound/doc.md +54 -0
  81. package/docs/programmable-api/environment.mdx +10 -2
  82. package/package.json +5 -5
@@ -96,6 +96,61 @@ variable named `MY_VAR` can't be set on say the **Production** environments.
96
96
 
97
97
  :::
98
98
 
99
+ ## Manage variables from the CLI or API
100
+
101
+ You can create, update, and delete variables without opening the Zuplo Portal.
102
+ This is useful in CI/CD pipelines and scripts. The CLI commands call the
103
+ [Zuplo Developer API](https://dev.zuplo.com/docs/), so you can also call the
104
+ Variables endpoints directly.
105
+
106
+ | Action | CLI command | Developer API |
107
+ | ------ | ----------------------------------------------------- | ------------------------------------------ |
108
+ | Create | [`zuplo variable create`](../cli/variable-create.mdx) | `POST .../branches/{branchName}/variables` |
109
+ | Update | [`zuplo variable update`](../cli/variable-update.mdx) | `PATCH .../variables/{variableName}` |
110
+ | Delete | [`zuplo variable delete`](../cli/variable-delete.mdx) | `DELETE .../variables/{variableName}` |
111
+
112
+ ```bash
113
+ zuplo variable create --name BASE_URL --value https://api.example.com \
114
+ --is-secret false --branch main
115
+
116
+ zuplo variable delete --name BASE_URL --branch main
117
+ ```
118
+
119
+ See the Variables operations in the
120
+ [Zuplo Developer API reference](https://dev.zuplo.com/docs/) for the request and
121
+ response formats.
122
+
123
+ ### Which variable the branch selects
124
+
125
+ Every variable command takes a branch. The branch picks which variable the
126
+ command works on:
127
+
128
+ - On your project's default branch (usually `main`), the command works on the
129
+ variable that targets **Production**.
130
+ - On any other branch, the command works on the variable scoped to that
131
+ **Preview** branch.
132
+
133
+ Deleting a variable removes the whole variable from every environment it
134
+ targets, not only from the branch you passed. For example, a variable that
135
+ applies to Production and to a Preview branch is gone from both after you delete
136
+ it from either.
137
+
138
+ ### After you change a variable
139
+
140
+ As with the editor, a change only reaches an environment on its next deployment.
141
+ Redeploy the environment for a deletion, update, or new variable to take effect.
142
+
143
+ ### When delete returns 404
144
+
145
+ Delete returns `404` when the branch doesn't select an existing variable:
146
+
147
+ - No variable with that name exists for the branch.
148
+ - The variable is a Preview variable that applies to all branches. No branch
149
+ selects it, so you can't delete it from the CLI or API. Manage it in the
150
+ [editor](#environment-variable-editor) instead.
151
+ - The project has no default branch and you're deleting a Production variable.
152
+ Without a default branch, only branch-scoped variables can be selected.
153
+
99
154
  ## Reserved Environment Variables
100
155
 
101
156
  Names that start with `ZUPLO_`, `__ZUPLO`, or `ZUDOKU_` are reserved for Zuplo,
@@ -58,9 +58,10 @@ curl \
58
58
  ## Bucket monetization configuration
59
59
 
60
60
  Each bucket has an optional `MonetizationConfiguration` that holds bucket-wide
61
- behavior — multi-subscription support, plan display order, plan-level overrides,
62
- and the default payment grace period. The configuration is read by the runtime
63
- and the Developer Portal; it is not stored in OpenMeter.
61
+ behavior — whether customers can hold multiple subscriptions, plan display
62
+ order, plan-level overrides, and the default payment grace period. The
63
+ configuration is read by the runtime and the Developer Portal; it is not stored
64
+ in OpenMeter.
64
65
 
65
66
  ### Read
66
67
 
@@ -94,12 +95,12 @@ curl \
94
95
  EOF
95
96
  ```
96
97
 
97
- | Field | Type | Description |
98
- | ------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
- | `multipleSubscriptionsEnabled` | `boolean` | Stored on the bucket. Reserved for future multi-subscription rules; today the Developer Portal create-subscription path enforces a single active subscription per customer regardless of this flag. |
100
- | `planOrder` | `string[]` | Ordered list of plan keys; drives pricing-page sort and upgrade/downgrade direction during plan changes |
101
- | `planSettings` | `object` | Per-plan overrides keyed by plan key. The supported sub-key today is `visiblePhases` — an array of phase keys that should appear on the pricing page |
102
- | `maxPaymentOverdueDays` | `integer` | Bucket-default payment grace period. Must be ≥ 0. Defaults to `3` when not set |
98
+ | Field | Type | Description |
99
+ | ------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
100
+ | `multipleSubscriptionsEnabled` | `boolean` | When `true`, a customer can hold several active subscriptions on different plans, each with its own API keys. When `false` (the default), a customer can hold one active subscription, and creating another returns `409 Conflict`. A customer can't hold two subscriptions on the same plan either way. The Developer Portal also reads this flag: with it on, checkout links start a new subscription instead of changing the plan |
101
+ | `planOrder` | `string[]` | Ordered list of plan keys; drives pricing-page sort and upgrade/downgrade direction during plan changes |
102
+ | `planSettings` | `object` | Per-plan overrides keyed by plan key. The supported sub-key today is `visiblePhases` — an array of phase keys that should appear on the pricing page |
103
+ | `maxPaymentOverdueDays` | `integer` | Bucket-default payment grace period. Must be ≥ 0. Defaults to `3` when not set |
103
104
 
104
105
  The request body must include at least one of these fields. All four fields are
105
106
  optional in the request — the upsert preserves any field you don't send.
@@ -239,6 +240,122 @@ EOF
239
240
  The same key-prefix validation applies — a live key is rejected on a
240
241
  non-production bucket and vice versa.
241
242
 
243
+ ## Manage subscriber API keys
244
+
245
+ Each subscription is linked to a consumer that holds the subscriber's API keys.
246
+ You can update or delete those keys, and read them back when you list a
247
+ customer's subscriptions. These operations don't appear in the generated API
248
+ reference, so this section documents them.
249
+
250
+ In the examples, `$CONSUMER_ID` is the consumer's ID and `$API_KEY_ID` is the
251
+ key's ID. Both appear on the subscription's consumer in the subscription
252
+ response.
253
+
254
+ ### Update a key
255
+
256
+ `PATCH /v3/metering/{bucketId}/consumers/{consumerId}/keys/{apiKeyId}` changes a
257
+ key's description, its expiration date, or both. Fields you omit stay as they
258
+ are. The request must include at least one field, and a successful call returns
259
+ `204 No Content`.
260
+
261
+ | Field | Type | Description |
262
+ | ------------- | ------------------ | ------------------------------------------------------------------------------------------------------- |
263
+ | `description` | `string` | The key's description. An empty string clears it. |
264
+ | `expiresOn` | `string` or `null` | An RFC 3339 timestamp. A future time sets or extends the expiration. `null` clears a future expiration. |
265
+
266
+ Set a description and a future expiration:
267
+
268
+ ```shell
269
+ curl \
270
+ https://dev.zuplo.com/v3/metering/$BUCKET_ID/consumers/$CONSUMER_ID/keys/$API_KEY_ID \
271
+ --request PATCH \
272
+ --header "Authorization: Bearer $ZAPI_KEY" \
273
+ --header "Content-Type: application/json" \
274
+ --data '{ "description": "Production key", "expiresOn": "2027-01-31T00:00:00Z" }'
275
+ ```
276
+
277
+ Remove a future expiration so the key doesn't expire:
278
+
279
+ ```shell
280
+ curl \
281
+ https://dev.zuplo.com/v3/metering/$BUCKET_ID/consumers/$CONSUMER_ID/keys/$API_KEY_ID \
282
+ --request PATCH \
283
+ --header "Authorization: Bearer $ZAPI_KEY" \
284
+ --header "Content-Type: application/json" \
285
+ --data '{ "expiresOn": null }'
286
+ ```
287
+
288
+ To expire a key now, send a timestamp at or before the current time:
289
+
290
+ ```shell
291
+ curl \
292
+ https://dev.zuplo.com/v3/metering/$BUCKET_ID/consumers/$CONSUMER_ID/keys/$API_KEY_ID \
293
+ --request PATCH \
294
+ --header "Authorization: Bearer $ZAPI_KEY" \
295
+ --header "Content-Type: application/json" \
296
+ --data '{ "expiresOn": "2026-01-01T00:00:00Z" }'
297
+ ```
298
+
299
+ Sending a future timestamp for an expired key reactivates it. You can't clear
300
+ the expiration of an already expired key with `null`; the request returns
301
+ `400 Bad Request`.
302
+
303
+ #### The last-active-key rule
304
+
305
+ A consumer must always have at least one active key, meaning a key with no
306
+ expiration or an expiration in the future. If an update that sets `expiresOn`
307
+ would leave the consumer with no active key, the request fails with
308
+ `400 Bad Request` and nothing changes. Roll the key first so a replacement
309
+ exists, then expire the old one.
310
+
311
+ ### Delete a key
312
+
313
+ `DELETE /v3/metering/{bucketId}/consumers/{consumerId}/keys/{apiKeyId}` removes
314
+ a key permanently and returns `204 No Content`.
315
+
316
+ ```shell
317
+ curl \
318
+ https://dev.zuplo.com/v3/metering/$BUCKET_ID/consumers/$CONSUMER_ID/keys/$API_KEY_ID \
319
+ --request DELETE \
320
+ --header "Authorization: Bearer $ZAPI_KEY"
321
+ ```
322
+
323
+ A delete succeeds only when all of these are true:
324
+
325
+ - The key has an expiration date. A key without one is rejected with
326
+ `400 Bad Request`. The expiration can be in the past or in the future, so you
327
+ can delete a key that is scheduled to expire but hasn't yet.
328
+ - The consumer has at least one other active key. Otherwise the request returns
329
+ `400 Bad Request`.
330
+ - The consumer has an active subscription. Otherwise the request returns
331
+ `404 Not Found`.
332
+
333
+ To delete a key that has no expiration, first set an expiration with the update
334
+ operation, after making sure another active key exists.
335
+
336
+ ### Return key values with `key-format`
337
+
338
+ By default, the subscription endpoints return API keys as a placeholder. Add the
339
+ `key-format` query parameter to
340
+ `GET /v3/metering/{bucketId}/customers/{customerId}/subscriptions` to change
341
+ that:
342
+
343
+ | Value | Key in the response |
344
+ | --------- | -------------------------------------------- |
345
+ | `none` | A placeholder (`****`). This is the default. |
346
+ | `masked` | The key with only its suffix visible |
347
+ | `visible` | The full key |
348
+
349
+ ```shell
350
+ curl \
351
+ "https://dev.zuplo.com/v3/metering/$BUCKET_ID/customers/$CUSTOMER_ID/subscriptions?key-format=masked" \
352
+ --header "Authorization: Bearer $ZAPI_KEY"
353
+ ```
354
+
355
+ Each subscription's `consumer.apiKeys` array includes the key's `id`,
356
+ `description`, `createdOn`, `expiresOn` (omitted when the key doesn't expire),
357
+ and `key`. Treat responses that use `key-format=visible` as secrets.
358
+
242
359
  ## API Reference
243
360
 
244
361
  For complete API operations, see the API Reference documentation:
@@ -16,11 +16,37 @@ A meter is configured with:
16
16
  - **Event type** - Which events to process (e.g., `requests`, `tokens`)
17
17
  - **Value property** - JSONPath to extract the numeric value from event data.
18
18
  Events use `$.total` as the standard value property.
19
- - **Aggregation** - How to combine values (typically `SUM`)
19
+ - **Aggregation** - How to combine values (typically `SUM`). See
20
+ [Aggregation types](#aggregation-types).
20
21
 
21
22
  When events are ingested, the meter matches events by type, extracts the
22
23
  specified value, and aggregates it per customer subscription over time.
23
24
 
25
+ ## Aggregation types
26
+
27
+ The `aggregation` field sets how a meter combines the events it receives in a
28
+ time window.
29
+
30
+ | Aggregation | What it does | Value property |
31
+ | -------------- | ----------------------------- | ---------------------------------------- |
32
+ | `SUM` | Adds up the values | JSONPath to a number, such as `$.total` |
33
+ | `COUNT` | Counts events | Not needed; ignored if set |
34
+ | `UNIQUE_COUNT` | Counts distinct values | JSONPath to a string, such as `$.userId` |
35
+ | `AVG` | Averages the values | JSONPath to a number |
36
+ | `MIN` | Returns the smallest value | JSONPath to a number |
37
+ | `MAX` | Returns the largest value | JSONPath to a number |
38
+ | `LATEST` | Returns the most recent value | JSONPath into the event data |
39
+
40
+ `COUNT` doesn't need a value property, because it counts events rather than
41
+ reading a number from them. Every other aggregation requires one.
42
+
43
+ :::caution
44
+
45
+ You can't change a meter's aggregation or value property after you create it. To
46
+ use a different aggregation, create a new meter.
47
+
48
+ :::
49
+
24
50
  ## Common Examples
25
51
 
26
52
  ### API Request Counting
@@ -146,7 +172,23 @@ The meter `eventType` must match the key used in three places:
146
172
  If these don't match, usage is not tracked correctly against the subscription's
147
173
  entitlements.
148
174
 
149
- ## Creating a Meter
175
+ ## Create a meter in the Zuplo Portal
176
+
177
+ 1. Open
178
+ [**Services → Monetization → Pricing**](https://portal.zuplo.com/+/account/project/services)
179
+ and select the **Meters** tab.
180
+ 2. Click **Add Meter**, then choose **Blank Meter** or one of the templates
181
+ under **From Template**.
182
+ 3. Fill in the **Name**, **Event**, and optional **Description**.
183
+ 4. Choose an **Aggregation**. The dialog describes each option.
184
+ 5. Enter the **Value property**, a JSONPath such as `$.total`. The field is
185
+ disabled for `COUNT`.
186
+ 6. Click **Add Meter**.
187
+
188
+ After creation, **Edit Meter** lets you change the name and description, but the
189
+ aggregation and value property are locked.
190
+
191
+ ## Create a meter with the API
150
192
 
151
193
  ```shell
152
194
  curl \
@@ -165,6 +207,11 @@ curl \
165
207
  EOF
166
208
  ```
167
209
 
210
+ ## Monitor usage
211
+
212
+ To see what your meters record across customers, see
213
+ [Monitor usage](./usage.mdx).
214
+
168
215
  ## API Reference
169
216
 
170
217
  For complete API operations (list, get, update, delete), see the
@@ -59,6 +59,24 @@ completes Stripe Checkout, and gets their API key immediately.
59
59
  5. Clicks "Confirm & Subscribe" to finalize
60
60
  6. Subscription is active, API key is generated
61
61
 
62
+ ### In the Zuplo Portal
63
+
64
+ You can create a subscription for a customer yourself, for example for a
65
+ sales-assisted signup:
66
+
67
+ 1. Open
68
+ [**Services → Monetization → Customers**](https://portal.zuplo.com/+/account/project/services)
69
+ and select the customer.
70
+ 2. Click **Create Subscription**.
71
+ 3. Under **Published plan**, select a plan. Only published plans appear.
72
+ 4. Confirm the **Customer email**.
73
+ 5. Under **Start subscription**, choose **Immediately** or **On a specific
74
+ date**. For a specific date, enter a **Start date and time** in the future.
75
+ 6. Click **Create Subscription**.
76
+
77
+ To find a customer, type in the **Search customers...** box on the Customers
78
+ page. The search matches the customer's name, customer key, and email address.
79
+
62
80
  ### Programmatic (API)
63
81
 
64
82
  Create subscriptions directly via the API for cases where the checkout happens
@@ -186,9 +204,9 @@ What happens if the customer cancels during the trial depends on whether the
186
204
  trial phase has billable rate cards:
187
205
 
188
206
  - **Free trial** (no priced rate cards in the trial phase, like the example
189
- above): access ends immediately, no payment is charged, and the trial does not
190
- convert to the paid phase. Cancellation cannot defer to a billing-cycle end
191
- because the trial phase has nothing to bill
207
+ above): no payment is charged and the trial does not convert to the paid
208
+ phase. In the Developer Portal, the customer can keep access until the trial
209
+ period ends (the default) or end the subscription immediately
192
210
  - **Paid trial** (the trial phase has a price, e.g., a $1 introductory rate):
193
211
  access continues until the end of the trial period (default
194
212
  `next_billing_cycle` timing), the trial fee is billed on the final invoice,
@@ -209,6 +227,37 @@ Developer Portal:
209
227
  they apply at the next billing cycle
210
228
  6. The API key stays the same
211
229
 
230
+ ### In the Zuplo Portal
231
+
232
+ To move a customer's subscription to a different plan, open the subscription
233
+ from the customer's **Subscriptions** tab and use the buttons in **Subscription
234
+ Information**.
235
+
236
+ **Change plan:**
237
+
238
+ 1. Click **Change plan**.
239
+ 2. Under **Plan**, select the new plan. The list includes the published plans in
240
+ the subscription's currency, including private plans, and excludes the plan
241
+ the subscription is already on.
242
+ 3. Under **When it applies**, choose a timing:
243
+
244
+ | Timing | What happens |
245
+ | ---------------------- | --------------------------------------------------------------- |
246
+ | **Immediately** | The new plan starts now. |
247
+ | **Next billing cycle** | The current plan stays until the billing period ends. |
248
+ | **Automatic** | Upgrades start now. Downgrades start at the next billing cycle. |
249
+
250
+ 4. Click **Confirm change**.
251
+
252
+ Changing the plan cancels every manual top-up on the subscription and removes
253
+ its remaining balance.
254
+
255
+ **Cancel plan change:** while a change is scheduled, the subscription shows a
256
+ **Cancel plan change** button. Click it, then click **Cancel plan change** again
257
+ in the dialog to delete the scheduled subscription and keep the current one
258
+ active. You can't cancel a change in the last 5 minutes before it takes effect,
259
+ and top-ups already canceled by the change aren't restored.
260
+
212
261
  ### Programmatic (API)
213
262
 
214
263
  Plan changes go through the dedicated `change` endpoint, which closes the
@@ -299,15 +348,32 @@ Gaming via short-lived upgrades is constrained by two other mechanisms:
299
348
  Customers can cancel from the **Manage Subscription** section in the Developer
300
349
  Portal:
301
350
 
302
- 1. Customer clicks "Cancel Subscription"
303
- 2. Confirmation dialog explains what happens
304
- 3. Cancellation is scheduled for the end of the current billing period
305
- 4. Customer retains full access until the period ends
306
- 5. At period end, access is revoked and the API key stops working
351
+ 1. Customer clicks **Cancel subscription**.
352
+ 2. The dialog asks **When should your subscription end?** with two options: **At
353
+ the end of the billing period** (the default) and **Immediately**.
354
+ 3. Customer types the plan name to confirm and clicks **Cancel subscription**.
355
+ 4. With **At the end of the billing period**, the customer keeps access until
356
+ the period ends, then access is revoked and the API key stops working. With
357
+ **Immediately**, access stops right away.
307
358
 
308
- For free plans and subscriptions still in their free trial phase, cancellation
309
- is immediate — there are no billable items left to consume, so end-of-period
310
- behavior does not apply.
359
+ A subscription still in its free trial phase works the same way. The default is
360
+ the end of the billing period, which is the end of the trial. The subscription
361
+ ends before the trial converts to the paid phase, so nothing is charged
362
+ whichever option the customer picks.
363
+
364
+ If the cancellation fails, the dialog shows the reason under **Could not cancel
365
+ subscription** and leaves the subscription unchanged.
366
+
367
+ A customer who cancels at the end of the billing period can change their mind
368
+ before it ends. The subscription shows **Resume subscription** in **Manage
369
+ Subscription**, which removes the pending cancellation.
370
+
371
+ ### In the Zuplo Portal
372
+
373
+ To cancel a customer's subscription yourself, open it from the customer's
374
+ **Subscriptions** tab and click **Cancel subscription**. Choose **Next billing
375
+ cycle** (access continues until the period ends) or **Immediately** (access is
376
+ revoked right away), then click **Confirm cancel**.
311
377
 
312
378
  ### Programmatic cancellation
313
379
 
@@ -328,11 +394,13 @@ curl -X POST https://dev.zuplo.com/v3/metering/{bucketId}/subscriptions/{subscri
328
394
 
329
395
  ### Cancellation behavior
330
396
 
331
- | Scenario | Default behavior |
332
- | ---------------------------------------- | ------------------------------------------- |
333
- | Active subscription canceled | Access until period end, then revoked |
334
- | Free trial or free subscription canceled | Access ends immediately, no payment charged |
335
- | Subscription with overage | Overage billed on final invoice |
397
+ | Scenario | Behavior |
398
+ | ------------------------------------ | ------------------------------------------------------------------- |
399
+ | Customer cancels (Developer Portal) | Customer chooses; defaults to access until period end, then revoked |
400
+ | Customer cancels during a free trial | Defaults to the end of the trial; nothing is charged either way |
401
+ | Cancel with **Immediately** | Access is revoked right away |
402
+ | Subscription with overage | Overage billed on final invoice |
403
+ | Cancellation fails | The dialog shows the reason and the subscription is unchanged |
336
404
 
337
405
  ## Reactivation
338
406
 
@@ -346,9 +414,36 @@ curl -X POST https://dev.zuplo.com/v3/metering/{bucketId}/subscriptions/{subscri
346
414
 
347
415
  This removes the pending cancellation. The subscription continues as normal.
348
416
 
417
+ ### In the Zuplo Portal
418
+
419
+ Open a subscription that is scheduled to cancel and click **Restore**. The
420
+ dialog shows the scheduled end date. Click **Confirm restore** to clear the end
421
+ date and return the subscription to active, or **Keep canceled** to leave it.
422
+ Restore is available only until the scheduled end date passes.
423
+
424
+ In the Developer Portal, customers use **Resume subscription** in **Manage
425
+ Subscription** for the same result.
426
+
349
427
  If the subscription has already ended, create a new subscription rather than
350
428
  restoring the old one.
351
429
 
430
+ ## Subscription API keys in the Zuplo Portal
431
+
432
+ The subscription page in the Zuplo Portal has an **API Keys** card for the
433
+ linked consumer.
434
+
435
+ - Click the eye icon to show a key, or the copy icon to copy it.
436
+ - Click **Roll API key** to create a replacement key. Under **Expire old key**,
437
+ choose **Immediately** or **At a specific date and time** and enter the
438
+ **Expiration (local time)**, then click **Confirm roll**. Update your
439
+ applications to the new key before the old key expires.
440
+ - Click **Edit consumer** to change the consumer's metadata. The subject and key
441
+ manager are read-only.
442
+ - When a consumer has more than three keys, **View all** shows the rest.
443
+
444
+ To manage keys through the API, see
445
+ [Manage subscriber API keys](./api-access.mdx#manage-subscriber-api-keys).
446
+
352
447
  ## Subscriptions per customer
353
448
 
354
449
  By default, each customer can hold one active subscription at a time. The
@@ -357,9 +452,12 @@ subscriptions has been reached") when a customer tries to subscribe while
357
452
  another subscription is still active or pending cancellation — a subscription in
358
453
  the `canceled` wind-down state still counts toward the cap.
359
454
 
360
- Multi-subscription support is available on request. Contact
361
- [sales@zuplo.com](mailto:sales@zuplo.com) to enable it for your bucket if you
362
- need scenarios like:
455
+ To allow more, turn on **Allow multiple subscriptions** under **Payment
456
+ Provider** → **Billing & Subscriptions** in the Zuplo Portal, or set
457
+ `multipleSubscriptionsEnabled` in the
458
+ [bucket monetization configuration](./api-access.mdx#bucket-monetization-configuration).
459
+ A customer still can't hold two subscriptions on the same plan. Use it for
460
+ scenarios like:
363
461
 
364
462
  - A primary monthly subscription plus a credit pack top-up
365
463
  - Separate subscriptions for different API products
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: Monitor Usage
3
+ sidebar_label: Monitor Usage
4
+ description:
5
+ See request volume and metered usage across customers, or for one
6
+ subscription, in the Zuplo Portal Monetization section.
7
+ applies_to:
8
+ product: [gateway, developer-portal]
9
+ hosting: all
10
+ ---
11
+
12
+ The Zuplo Portal shows what your [meters](./meters.mdx) record, across all
13
+ customers and for each customer. Usage values are raw metered usage, not billed
14
+ amounts. Each meter keeps its own units and
15
+ [aggregation](./meters.mdx#aggregation-types).
16
+
17
+ ## Usage page
18
+
19
+ Open
20
+ [**Services → Monetization → Usage**](https://portal.zuplo.com/+/account/project/services)
21
+ to explore usage across customers in the selected environment group. Times are
22
+ in UTC.
23
+
24
+ - **Time range**: choose **Last 1 hour**, **Last 6 hours**, **Last 24 hours**,
25
+ **Last 7 days**, or **Last 30 days**. Ranges longer than your account's
26
+ analytics history are disabled.
27
+ - **Request volume**: a chart of requests over the range. It requires advanced
28
+ analytics on your account.
29
+ - **Meter usage**: a chart for one meter. Use the **Meter** menu to switch
30
+ meters. If you haven't created a meter, the page prompts you to create one.
31
+ - **All meters**: a table with each meter's **Period value**, **Previous
32
+ period**, **Change**, and **Trend**. **Change** compares the period with the
33
+ preceding period of the same length. A dash means there is no observation, or
34
+ no percentage comparison against a zero baseline.
35
+
36
+ ## Overview snapshot
37
+
38
+ The Monetization **Overview** page includes a **Usage snapshot** card with each
39
+ meter's usage for the last 30 days. Click **View all** to open the Usage page
40
+ with the same time range.
41
+
42
+ ## Customer usage
43
+
44
+ To see usage for one customer, open the customer from
45
+ [**Services → Monetization → Customers**](https://portal.zuplo.com/+/account/project/services)
46
+ and select the **Usage** tab. The **Usage history** section shows metered usage
47
+ for one subscription, including usage covered by plan allowances.
48
+
49
+ 1. If the customer has more than one subscription, select one in the
50
+ **Subscription** menu.
51
+ 2. Choose a time range: **Last 24 hours**, **Last 7 days**, **Last 30 days**, or
52
+ **Custom range**.
53
+ 3. For a custom range, enter **From (UTC)** and **To (UTC)**, then click
54
+ **Apply**. The start must be before the end, neither can be in the future,
55
+ and the range can be up to 366 days.
56
+
57
+ On a subscription's page, click **View customer usage history** to jump to that
58
+ customer's **Usage** tab.
@@ -118,7 +118,7 @@ jobs:
118
118
 
119
119
  - name: Deploy to Zuplo
120
120
  run:
121
- npx zuplo deploy --api-key "$ZUPLO_API_KEY" --environment "${{
121
+ npx zuplo deploy --api-key "$ZUPLO_API_KEY" --branch "${{
122
122
  github.ref_name }}"
123
123
  env:
124
124
  ZUPLO_API_KEY: ${{ secrets.ZUPLO_API_KEY }}
@@ -181,7 +181,7 @@ jobs:
181
181
  # pull_request events check out
182
182
  ENVIRONMENT: ${{ github.head_ref }}
183
183
  run: |
184
- OUTPUT=$(npx zuplo deploy --api-key "$ZUPLO_API_KEY" --environment "$ENVIRONMENT" 2>&1)
184
+ OUTPUT=$(npx zuplo deploy --api-key "$ZUPLO_API_KEY" --branch "$ENVIRONMENT" 2>&1)
185
185
  echo "$OUTPUT"
186
186
  DEPLOYMENT_URL=$(echo "$OUTPUT" | grep -oP 'Deployed to \K(https://[^ ]+)')
187
187
  echo "url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
@@ -215,37 +215,22 @@ jobs:
215
215
  - name: Install dependencies
216
216
  run: npm install
217
217
 
218
- - name: Get deployment URL
219
- id: get-url
220
- uses: actions/github-script@v7
221
- with:
222
- script: |
223
- const comments = await github.rest.issues.listComments({
224
- issue_number: context.issue.number,
225
- owner: context.repo.owner,
226
- repo: context.repo.repo,
227
- });
228
- const match = comments.data
229
- .map((c) => c.body.match(/Deployed to: (https:\/\/\S+)/))
230
- .find(Boolean);
231
- core.setOutput("url", match ? match[1] : "");
232
-
233
218
  - name: Delete environment
234
- if: steps.get-url.outputs.url != ''
219
+ env:
220
+ ENVIRONMENT: ${{ github.head_ref }}
235
221
  run: |
236
222
  npx zuplo delete \
237
- --url "${{ steps.get-url.outputs.url }}" \
238
- --api-key "$ZUPLO_API_KEY" \
239
- --wait
223
+ --branch "$ENVIRONMENT" \
224
+ --api-key "$ZUPLO_API_KEY"
240
225
  ```
241
226
 
242
227
  :::caution
243
228
 
244
- The deploy step passes `--environment` with the PR's source branch name
229
+ The deploy step passes `--branch` with the PR's source branch name
245
230
  (`github.head_ref`). Workflows triggered by `pull_request` check out the PR
246
- merge ref (`refs/pull/<number>/merge`), so without `--environment` the CLI names
247
- the environment after that ref instead of your branch — and any other deploy of
248
- the same branch creates a second environment with a different URL. See
231
+ merge ref (`refs/pull/<number>/merge`), so without `--branch` the CLI names the
232
+ environment after that ref instead of your branch — and any other deploy of the
233
+ same branch creates a second environment with a different URL. See
249
234
  [PR Preview Environments](./ci-cd-github/pr-preview-environments.mdx) for
250
235
  details.
251
236
 
@@ -130,6 +130,20 @@ You can set this property to `true` in order to hide a route from the Developer
130
130
  Portal. If you are using the [OpenAPI Spec Handler](../handlers/openapi.mdx),
131
131
  internal routes won't be present in the generated OpenAPI file.
132
132
 
133
+ The Developer Portal also supports `x-internal` on a whole path item, to hide
134
+ every operation on that path, and on a single parameter, to hide only that
135
+ parameter. See the Developer Portal
136
+ [`x-internal` reference](../dev-portal/zudoku/openapi-extensions/x-internal.md)
137
+ for details.
138
+
139
+ :::warning
140
+
141
+ `x-internal` hides documentation only. It doesn't secure the endpoint: the route
142
+ still exists on your gateway and anyone can call it. To block access to a route,
143
+ use the [Internal Only policy](../policies/internal-only-inbound.mdx).
144
+
145
+ :::
146
+
133
147
  ## Multiple File Support
134
148
 
135
149
  You can have multiple `.oas.json` files if you wish to break up your route