zuplo 7.15.18 → 7.15.20
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/docs/ai-gateway/observability/tracing.mdx +8 -1
- package/docs/articles/logging.mdx +29 -3
- package/docs/articles/monetization/developer-portal.md +137 -9
- package/docs/articles/monetization/monetization-policy.md +37 -21
- package/docs/articles/monetization/stripe-integration.md +4 -20
- package/docs/articles/monetization/troubleshooting.md +57 -15
- package/docs/articles/opentelemetry.mdx +8 -1
- package/docs/articles/routing.mdx +12 -0
- package/docs/guides/proxying-between-zuplo-gateways.mdx +16 -3
- package/docs/mcp-gateway/auth/upstream-oauth.mdx +10 -0
- package/docs/mcp-gateway/observability/analytics.mdx +6 -0
- package/docs/mcp-gateway/reference.mdx +19 -5
- package/docs/mcp-gateway/troubleshooting.mdx +18 -0
- package/docs/mcp-server/configuration-migration-guide.mdx +8 -0
- package/docs/mcp-server/troubleshooting.mdx +3 -3
- package/docs/programmable-api/zuplo-json.mdx +22 -0
- package/docs/programmable-api/zuplo-request.mdx +17 -0
- package/package.json +5 -5
|
@@ -380,13 +380,20 @@ trace context.
|
|
|
380
380
|
|
|
381
381
|
Where you view traces depends on the plugin configuration:
|
|
382
382
|
|
|
383
|
-
- **Zuplo**: with no `exporter`, open
|
|
383
|
+
- **Zuplo**: with no `exporter`, open the **Traces** tab in your project, next
|
|
384
|
+
to **Logs** and **Analytics**, and use the **Environment** filter to choose an
|
|
385
|
+
environment. To see every project in one place, open
|
|
384
386
|
[**Observability → Traces**](https://portal.zuplo.com/+/account/observability/traces)
|
|
385
387
|
at the account level and filter by **service**, which defaults to the project
|
|
386
388
|
name.
|
|
387
389
|
- **Your own backend**: traces arrive at the `exporter` URL. Open them in that
|
|
388
390
|
tool, for example Honeycomb, Grafana Tempo, Jaeger, or Dynatrace.
|
|
389
391
|
|
|
392
|
+
The **Traces** tab lists one row per HTTP request, even when an MCP client
|
|
393
|
+
reuses one trace context across several requests. Expand a row to see that
|
|
394
|
+
request's spans. When your project has MCP traffic, **MCP method** and **MCP
|
|
395
|
+
tool** filters appear in the filter sidebar.
|
|
396
|
+
|
|
390
397
|
To send traces to Zuplo and your own backend at once, or to export logs as well,
|
|
391
398
|
see
|
|
392
399
|
[OpenTelemetry](../../articles/opentelemetry.mdx#send-traces-to-zuplo-and-your-own-backend).
|
|
@@ -35,9 +35,11 @@ How far back you can search depends on your plan. See
|
|
|
35
35
|
[Data retention](../analytics/access-and-entitlements.md#data-retention).
|
|
36
36
|
|
|
37
37
|
The viewer supports time-range presets, drag-to-zoom on the histogram, free-text
|
|
38
|
-
search, and filters for severity, status, method, and route.
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
search, and filters for severity, status, method, and route. Once your project
|
|
39
|
+
has [MCP](../mcp-gateway/overview.mdx) traffic, **MCP method** and **MCP tool**
|
|
40
|
+
filters appear too. Live mode plays entries back in order, about 15 seconds
|
|
41
|
+
behind real time, and pauses automatically, for example when you select a
|
|
42
|
+
request to inspect it.
|
|
41
43
|
|
|
42
44
|
Each request row shows the path the client called, such as `/users/42`. Hover
|
|
43
45
|
the path to see the full URL and the route it matched, such as `/users/:id`.
|
|
@@ -55,6 +57,30 @@ Select a request to open its details, which list:
|
|
|
55
57
|
don't count toward the property limit and replace properties of the same name
|
|
56
58
|
that your code sets.
|
|
57
59
|
|
|
60
|
+
### AI Gateway requests
|
|
61
|
+
|
|
62
|
+
For an [AI Gateway](../ai-gateway/overview.mdx) project, each request row
|
|
63
|
+
summarizes the call instead of showing only the path. A row shows:
|
|
64
|
+
|
|
65
|
+
- The endpoint, provider, and model the request used.
|
|
66
|
+
- The app, or the person who made the request when a personal key made it. The
|
|
67
|
+
viewer shows **You** for your own requests.
|
|
68
|
+
- Input and output tokens, the estimated or recorded cost, and the duration.
|
|
69
|
+
|
|
70
|
+
A request that didn't go the usual way carries an icon beside its status code.
|
|
71
|
+
Hover the icon to read the outcome:
|
|
72
|
+
|
|
73
|
+
- **Budget exceeded**, **Budget warning**, or **Budget fallback**
|
|
74
|
+
- **Blocked by input guardrail** or **Blocked by output guardrail**
|
|
75
|
+
- **Guardrail unavailable** or **Guardrail unable to inspect request**
|
|
76
|
+
- **Cache hit**, for a response served from the semantic cache
|
|
77
|
+
|
|
78
|
+
Select a request to open an **AI Request** section in its details with the
|
|
79
|
+
**Endpoint**, **Model**, **Provider**, **App**, **User**, **Input tokens**,
|
|
80
|
+
**Output tokens**, **Cost**, **Cache**, and **Outcome** that apply. An estimated
|
|
81
|
+
cost is marked **estimated**. A request with no authenticated consumer shows its
|
|
82
|
+
consumer as **Anonymous** with a **No auth** tag.
|
|
83
|
+
|
|
58
84
|
When your code calls another route with
|
|
59
85
|
[`context.invokeRoute`](../programmable-api/zuplo-context.mdx#invokeroute), the
|
|
60
86
|
called route gets a log row of its own with the same request ID. The viewer
|
|
@@ -35,7 +35,7 @@ visual progress indicators.
|
|
|
35
35
|
|
|
36
36
|
**API key management** — API keys are displayed within the context of their
|
|
37
37
|
subscription. Each subscription has its own key, making it clear which key
|
|
38
|
-
corresponds to which plan. Customers can
|
|
38
|
+
corresponds to which plan. Customers can roll keys from this page.
|
|
39
39
|
|
|
40
40
|
## Prerequisites
|
|
41
41
|
|
|
@@ -71,6 +71,128 @@ Save and deploy. Once the plugin is enabled, ensure:
|
|
|
71
71
|
1. Stripe is connected (see [Stripe Integration](./stripe-integration.md))
|
|
72
72
|
2. At least one plan is published
|
|
73
73
|
|
|
74
|
+
## Plugin options
|
|
75
|
+
|
|
76
|
+
Pass options to `zuploMonetizationPlugin()` in `docs/zudoku.config.tsx`. All
|
|
77
|
+
options are optional.
|
|
78
|
+
|
|
79
|
+
| Option | Type | Description |
|
|
80
|
+
| ------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `pricing.title` | `string` | Heading of the pricing page. Defaults to `"Pricing"`. |
|
|
82
|
+
| `pricing.subtitle` | `string` | Text under the heading. Defaults to `"See our pricing options and choose the one that best suits your needs."`. |
|
|
83
|
+
| `pricing.units` | `Record<string, string>` | Unit names for usage in plan cards, keyed by rate card or feature key. Defaults to `"unit"`. |
|
|
84
|
+
| `checkout.renderBeforeCheckout` | `(props) => ReactNode \| null` | Renders your own step on `/checkout` before the customer goes to Stripe. See below. |
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
zuploMonetizationPlugin({
|
|
88
|
+
pricing: {
|
|
89
|
+
title: "Plans and pricing",
|
|
90
|
+
subtitle: "Start free and upgrade as your traffic grows.",
|
|
91
|
+
units: { api_requests: "request" },
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Names ending in `s` are used as written; any other name is pluralized by adding
|
|
97
|
+
an `s` (`request` becomes `requests`).
|
|
98
|
+
|
|
99
|
+
### Ask questions before checkout
|
|
100
|
+
|
|
101
|
+
Use `checkout.renderBeforeCheckout` to collect information, such as company size
|
|
102
|
+
or use case, before the customer reaches payment. The function receives these
|
|
103
|
+
props:
|
|
104
|
+
|
|
105
|
+
| Prop | Description |
|
|
106
|
+
| ------------ | ---------------------------------------------------------------------------- |
|
|
107
|
+
| `plan` | The plan the customer chose on the pricing page. |
|
|
108
|
+
| `onComplete` | Call it after your own submit succeeds to continue to checkout. |
|
|
109
|
+
| `onCancel` | Call it to abandon the purchase and return the customer to the pricing page. |
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
zuploMonetizationPlugin({
|
|
113
|
+
checkout: {
|
|
114
|
+
renderBeforeCheckout: ({ plan, onComplete, onCancel }) => {
|
|
115
|
+
// Free plans that need no payment method skip the form.
|
|
116
|
+
if (plan.paymentRequired === false) return null;
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<form
|
|
120
|
+
onSubmit={async (event) => {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
const data = new FormData(event.currentTarget);
|
|
123
|
+
const response = await fetch("/api/qualify", {
|
|
124
|
+
method: "POST",
|
|
125
|
+
body: data,
|
|
126
|
+
});
|
|
127
|
+
// Only continue when the submit worked.
|
|
128
|
+
if (response.ok) onComplete();
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<h1>Tell us about {plan.name}</h1>
|
|
132
|
+
<input name="companySize" placeholder="Company size" required />
|
|
133
|
+
<button type="submit">Continue</button>
|
|
134
|
+
<button type="button" onClick={onCancel}>
|
|
135
|
+
Cancel
|
|
136
|
+
</button>
|
|
137
|
+
</form>
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
- Returning `null` skips the form and goes straight to checkout.
|
|
145
|
+
- The `/checkout` route renders without the site layout, so what you return is
|
|
146
|
+
the whole page.
|
|
147
|
+
- The portal doesn't create a Stripe Checkout session until you call
|
|
148
|
+
`onComplete`. If your submit fails and you don't call it, the customer never
|
|
149
|
+
reaches Stripe.
|
|
150
|
+
- Saving the answers is up to you. The portal doesn't store them.
|
|
151
|
+
- This step runs only on the checkout page. It doesn't restrict API access, so
|
|
152
|
+
treat it as qualification rather than a requirement.
|
|
153
|
+
|
|
154
|
+
### Custom (contact sales) plans
|
|
155
|
+
|
|
156
|
+
A plan sold through your sales team shows a "Contact Sales" price line and a
|
|
157
|
+
button that links to your contact page instead of **Subscribe**. Set these keys
|
|
158
|
+
in the plan's **Metadata** field in the Zuplo Portal plan editor:
|
|
159
|
+
|
|
160
|
+
| Metadata key | Description |
|
|
161
|
+
| -------------- | ------------------------------------------------------------------------------------ |
|
|
162
|
+
| `isCustom` | Set to `"true"` to mark the plan as a contact-sales plan. |
|
|
163
|
+
| `contactUrl` | Where the button goes: a URL, an email address, or a portal path such as `/contact`. |
|
|
164
|
+
| `contactLabel` | Button text. Defaults to `Contact Sales`. |
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"isCustom": "true",
|
|
169
|
+
"contactUrl": "sales@example.com",
|
|
170
|
+
"contactLabel": "Talk to sales"
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
An email address opens the customer's mail client, a portal path stays inside
|
|
175
|
+
the portal, and a full URL opens in a new tab. Without a usable `contactUrl`,
|
|
176
|
+
the plan shows "Contact Sales" with no button. A customer who already holds the
|
|
177
|
+
plan sees **Manage Subscriptions** instead of the contact button.
|
|
178
|
+
|
|
179
|
+
### Checkout links
|
|
180
|
+
|
|
181
|
+
Link customers straight to checkout for a plan with `/checkout?planId=<id>`,
|
|
182
|
+
where `<id>` is the plan's ID. For example, use this from a pricing table on
|
|
183
|
+
your marketing site.
|
|
184
|
+
|
|
185
|
+
What happens next depends on the customer's current subscription:
|
|
186
|
+
|
|
187
|
+
- **No subscription:** Checkout starts for that plan.
|
|
188
|
+
- **A different plan:** The plan-change flow starts.
|
|
189
|
+
- **The same plan, or a subscription that's canceled:** The customer goes to
|
|
190
|
+
**Subscriptions** to manage it.
|
|
191
|
+
- **Multiple subscriptions enabled:** The link always starts a new subscription.
|
|
192
|
+
|
|
193
|
+
Visitors who aren't signed in are asked to sign in first, and a link without a
|
|
194
|
+
`planId` goes to the pricing page.
|
|
195
|
+
|
|
74
196
|
## Configuring the pricing page
|
|
75
197
|
|
|
76
198
|
### Plan display order
|
|
@@ -91,8 +213,9 @@ plans' rate cards and features. Each plan column shows:
|
|
|
91
213
|
|
|
92
214
|
### Highlighted plans
|
|
93
215
|
|
|
94
|
-
To highlight a plan
|
|
95
|
-
The pricing page
|
|
216
|
+
To highlight a plan, open it in the Zuplo Portal, expand the plan's advanced
|
|
217
|
+
settings, and turn on **Mark as Popular**. The pricing page shows a "Most
|
|
218
|
+
Popular" badge on the plan and emphasizes its button.
|
|
96
219
|
|
|
97
220
|
### Custom plan descriptions
|
|
98
221
|
|
|
@@ -103,7 +226,7 @@ these when creating or updating a plan via the API.
|
|
|
103
226
|
|
|
104
227
|
Free plans that don't require a payment method skip the Stripe Checkout flow
|
|
105
228
|
entirely. Whether a plan requires a payment method is controlled by the
|
|
106
|
-
`
|
|
229
|
+
`paymentRequired` property on the plan itself.
|
|
107
230
|
|
|
108
231
|
## Usage dashboard
|
|
109
232
|
|
|
@@ -141,12 +264,17 @@ plan.
|
|
|
141
264
|
Each subscription shows:
|
|
142
265
|
|
|
143
266
|
- The API key value (click to reveal/copy)
|
|
144
|
-
- Key creation date
|
|
145
|
-
- Key status (
|
|
146
|
-
- A
|
|
267
|
+
- Key creation date and last-updated time
|
|
268
|
+
- Key status ("Active" or "Expiring")
|
|
269
|
+
- A **Roll API Key** button
|
|
270
|
+
|
|
271
|
+
When a customer rolls a key, the portal creates a new current key. The old key
|
|
272
|
+
keeps working for 7 days and then expires, which gives the customer time to
|
|
273
|
+
update their API clients. The new key uses the same plan entitlements.
|
|
147
274
|
|
|
148
|
-
|
|
149
|
-
|
|
275
|
+
A key that is waiting to expire shows an "Expiring" badge. If the customer no
|
|
276
|
+
longer needs it, they can remove it before the 7 days pass with **Delete API
|
|
277
|
+
key**, which permanently deletes the key.
|
|
150
278
|
|
|
151
279
|
## Theming and branding
|
|
152
280
|
|
|
@@ -257,8 +257,17 @@ gating operations and enforcing quotas on runtime meters.
|
|
|
257
257
|
|
|
258
258
|
## Error responses
|
|
259
259
|
|
|
260
|
-
The policy
|
|
261
|
-
|
|
260
|
+
The policy separates credential problems from access problems:
|
|
261
|
+
|
|
262
|
+
- **`401 Unauthorized`** — the API key is missing, malformed, invalid, or
|
|
263
|
+
expired. When `authScheme` is set, the response includes a `WWW-Authenticate`
|
|
264
|
+
header with that scheme (for example, `WWW-Authenticate: Bearer`). If you set
|
|
265
|
+
`authScheme` to an empty string, the policy treats the whole header value as
|
|
266
|
+
the key and omits `WWW-Authenticate`.
|
|
267
|
+
- **`403 Forbidden`** — the API key is valid, but the subscription, payment
|
|
268
|
+
status, entitlements, or quota deny access.
|
|
269
|
+
|
|
270
|
+
Responses follow the RFC 7807 Problem Details format:
|
|
262
271
|
|
|
263
272
|
```json
|
|
264
273
|
{
|
|
@@ -275,25 +284,32 @@ the RFC 7807 Problem Details format:
|
|
|
275
284
|
}
|
|
276
285
|
```
|
|
277
286
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
| Condition
|
|
281
|
-
|
|
|
282
|
-
| No auth header
|
|
283
|
-
| Wrong auth scheme
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
| Invalid API key
|
|
287
|
-
| Expired API key
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
|
|
|
296
|
-
|
|
|
287
|
+
### 401 Unauthorized
|
|
288
|
+
|
|
289
|
+
| Condition | `detail` message |
|
|
290
|
+
| ------------------------------- | -------------------------------- |
|
|
291
|
+
| No auth header | `"No Authorization Header"` |
|
|
292
|
+
| Wrong auth scheme | `"Invalid Authorization Scheme"` |
|
|
293
|
+
| Malformed auth header | `"Invalid Authorization Header"` |
|
|
294
|
+
| Empty key after the auth scheme | `"No key present"` |
|
|
295
|
+
| Invalid or unrecognized API key | `"Authorization Failed"` |
|
|
296
|
+
| Expired API key | `"API Key has expired."` |
|
|
297
|
+
|
|
298
|
+
### 403 Forbidden
|
|
299
|
+
|
|
300
|
+
| Condition | `detail` message |
|
|
301
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------- |
|
|
302
|
+
| Key has no subscription | `"API Key does not have access to the API"` |
|
|
303
|
+
| Expired subscription | `"API Key has an expired subscription."` |
|
|
304
|
+
| Subscription blocked by an admin | `"Subscription access has been blocked by the administrator."` |
|
|
305
|
+
| Subscription has no payment status | `"Subscription payment status is not available."` |
|
|
306
|
+
| First payment not made | `"Payment has not been made."` |
|
|
307
|
+
| Payment overdue | `"Payment is overdue. Please update your payment method."` |
|
|
308
|
+
| Subscription has no entitlements | `"Subscription entitlements are not available."` |
|
|
309
|
+
| Meter not in subscription | `"API Key does not have \"X\" meter provided by the subscription."` |
|
|
310
|
+
| Quota exhausted | `"API Key has exceeded the allowed limit for \"X\" meter."` |
|
|
311
|
+
| Meter access denied | `"API Key does not have access to \"X\" meter."` |
|
|
312
|
+
| Required entitlement missing | `"The required \"X\" entitlement is not allowed or its quota has been exhausted."` |
|
|
297
313
|
|
|
298
314
|
## Pipeline ordering
|
|
299
315
|
|
|
@@ -210,26 +210,10 @@ for the detailed model and examples.
|
|
|
210
210
|
|
|
211
211
|
### Cancellation
|
|
212
212
|
|
|
213
|
-
When a customer cancels through the Developer Portal, the
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
subscription is scheduled to cancel at the end of the current billing period,
|
|
218
|
-
the customer retains access until then, and the API key stops working at
|
|
219
|
-
period end.
|
|
220
|
-
- **Free phases** — the portal sends `timing: "immediate"`. With nothing to
|
|
221
|
-
invoice at period end, there's no billing period to wait out, so the
|
|
222
|
-
subscription cancels and access is revoked right away. Two situations fall
|
|
223
|
-
into this branch:
|
|
224
|
-
- The customer is on a **free trial phase** (the first phase of a plan with a
|
|
225
|
-
later paid phase) and cancels before the trial converts.
|
|
226
|
-
- The customer is on a **free plan** — a plan whose only phase has no billable
|
|
227
|
-
rate cards (every rate card's `price` is `null`).
|
|
228
|
-
|
|
229
|
-
For programmatic cancellation, see
|
|
230
|
-
[Cancellation](./subscription-lifecycle.md#cancellation) in the Subscription
|
|
231
|
-
Lifecycle guide — the API endpoint accepts a `timing` parameter to control this
|
|
232
|
-
same behavior explicitly.
|
|
213
|
+
When a customer cancels through the Developer Portal, the customer chooses
|
|
214
|
+
whether the subscription ends at the end of the billing period or immediately.
|
|
215
|
+
See [Cancellation](./subscription-lifecycle.md#cancellation) in the Subscription
|
|
216
|
+
Lifecycle guide for what each choice does and for programmatic cancellation.
|
|
233
217
|
|
|
234
218
|
## Usage-based billing
|
|
235
219
|
|
|
@@ -8,10 +8,46 @@ applies_to:
|
|
|
8
8
|
|
|
9
9
|
## Common issues
|
|
10
10
|
|
|
11
|
+
### Customer gets 401 Unauthorized
|
|
12
|
+
|
|
13
|
+
**Symptom:** A customer's request returns `401 Unauthorized`. The policy returns
|
|
14
|
+
`401` when the API key is missing, malformed, invalid, or expired. When the
|
|
15
|
+
policy's `authScheme` is set, the response also includes a `WWW-Authenticate`
|
|
16
|
+
header. The `detail` message in the response body tells you which check failed.
|
|
17
|
+
See [Error responses](./monetization-policy.md#error-responses) for the full
|
|
18
|
+
list.
|
|
19
|
+
|
|
20
|
+
**Causes and fixes:**
|
|
21
|
+
|
|
22
|
+
1. **The request has no key, or sends it in the wrong format.** The `detail` is
|
|
23
|
+
`"No Authorization Header"`, `"Invalid Authorization Scheme"`,
|
|
24
|
+
`"Invalid Authorization Header"`, or `"No key present"`.
|
|
25
|
+
|
|
26
|
+
Fix: Send the key in the header the policy reads (`authorization` by default)
|
|
27
|
+
as `Bearer <key>`, or match your `authHeader` and `authScheme` options.
|
|
28
|
+
|
|
29
|
+
2. **The key is invalid.** The `detail` is `"Authorization Failed"`. Each
|
|
30
|
+
subscription generates its own key. If the customer has multiple
|
|
31
|
+
subscriptions or rolled their key, they may be using an old or unrelated key.
|
|
32
|
+
|
|
33
|
+
Fix: Have the customer copy their current key from the Developer Portal →
|
|
34
|
+
Subscriptions page.
|
|
35
|
+
|
|
36
|
+
3. **The key has expired.** The `detail` is `"API Key has expired."`. A rolled
|
|
37
|
+
key keeps working for 7 days and then expires.
|
|
38
|
+
|
|
39
|
+
Fix: Have the customer switch to their current key.
|
|
40
|
+
|
|
41
|
+
4. **The customer has no subscription.** A customer who never subscribed has no
|
|
42
|
+
API key, so requests to monetized routes return `401`.
|
|
43
|
+
|
|
44
|
+
Fix: Direct the customer to subscribe to a plan (even a free tier).
|
|
45
|
+
|
|
11
46
|
### Customer gets 403 Forbidden instead of expected access
|
|
12
47
|
|
|
13
|
-
**Symptom:**
|
|
14
|
-
`403
|
|
48
|
+
**Symptom:** A customer with a valid API key receives `403 Forbidden` instead of
|
|
49
|
+
a successful response. The `403` means the key was accepted, but the
|
|
50
|
+
subscription, payment status, or entitlements deny access.
|
|
15
51
|
|
|
16
52
|
**Causes and fixes:**
|
|
17
53
|
|
|
@@ -25,21 +61,22 @@ applies_to:
|
|
|
25
61
|
```
|
|
26
62
|
|
|
27
63
|
Fix: Either resolve the payment issue in Stripe, or adjust the grace period.
|
|
28
|
-
The window resolves customer metadata → plan metadata →
|
|
64
|
+
The window resolves customer metadata → plan metadata → bucket configuration
|
|
65
|
+
→ 3-day default. See
|
|
29
66
|
[Subscription and payment validation](./monetization-policy.md#subscription-and-payment-validation)
|
|
30
67
|
for details.
|
|
31
68
|
|
|
32
|
-
2. **
|
|
33
|
-
|
|
34
|
-
|
|
69
|
+
2. **The subscription has expired or was blocked.** The `detail` is
|
|
70
|
+
`"API Key has an expired subscription."` or
|
|
71
|
+
`"Subscription access has been blocked by the administrator."`.
|
|
35
72
|
|
|
36
|
-
Fix:
|
|
37
|
-
|
|
73
|
+
Fix: Check the subscription's status. Have the customer subscribe again if it
|
|
74
|
+
ended.
|
|
38
75
|
|
|
39
|
-
3. **
|
|
40
|
-
|
|
76
|
+
3. **The key has no active subscription.** The `detail` is
|
|
77
|
+
`"API Key does not have access to the API"`.
|
|
41
78
|
|
|
42
|
-
Fix:
|
|
79
|
+
Fix: Check that the key belongs to a current subscription.
|
|
43
80
|
|
|
44
81
|
### Customer gets 403 Forbidden for quota exceeded
|
|
45
82
|
|
|
@@ -170,7 +207,8 @@ curl -v -H "Authorization: Bearer ${CUSTOMER_API_KEY}" \
|
|
|
170
207
|
https://your-api.zuplo.dev/api/v1/resource
|
|
171
208
|
|
|
172
209
|
# Check the response status and body for error details
|
|
173
|
-
#
|
|
210
|
+
# 401 indicates a key problem; 403 indicates a subscription, payment, or quota
|
|
211
|
+
# problem. The detail message says which.
|
|
174
212
|
```
|
|
175
213
|
|
|
176
214
|
## FAQ
|
|
@@ -183,10 +221,14 @@ entirely — the customer gets access immediately after clicking "Start Free."
|
|
|
183
221
|
|
|
184
222
|
### Can a customer have multiple subscriptions?
|
|
185
223
|
|
|
186
|
-
|
|
187
|
-
|
|
224
|
+
Only when the bucket allows it. By default a customer can have one active
|
|
225
|
+
subscription. Turn on **Allow multiple subscriptions** under **Payment Provider
|
|
226
|
+
→ Billing & Subscriptions** to let a customer hold several at once. Each
|
|
227
|
+
subscription then has its own API key, and the customer uses the key for the
|
|
228
|
+
subscription a request belongs to. This supports scenarios like a primary
|
|
188
229
|
subscription plus a credit pack, or separate subscriptions for different API
|
|
189
|
-
products.
|
|
230
|
+
products. See
|
|
231
|
+
[Subscriptions per customer](./subscription-lifecycle.md#subscriptions-per-customer).
|
|
190
232
|
|
|
191
233
|
### What happens if Stripe is down?
|
|
192
234
|
|
|
@@ -74,7 +74,14 @@ export function runtimeInit(runtime: RuntimeExtensions) {
|
|
|
74
74
|
When you created your project, Zuplo added this plugin with a
|
|
75
75
|
[sampling ratio](#sample-a-percentage-of-traces) already set.
|
|
76
76
|
|
|
77
|
-
Deploy your project and open the **
|
|
77
|
+
Deploy your project and open the **Traces** tab in your project, next to
|
|
78
|
+
**Logs** and **Analytics**, to see traces. Use the **Environment** filter to
|
|
79
|
+
choose an environment. The tab lists one row per HTTP request, even when an MCP
|
|
80
|
+
client reuses one trace context across several requests, and expanding a row
|
|
81
|
+
shows that request's spans. Once your project has MCP traffic, **MCP method**
|
|
82
|
+
and **MCP tool** filters appear in the filter sidebar. The account-level
|
|
83
|
+
[**Observability → Traces**](https://portal.zuplo.com/+/account/observability/traces)
|
|
84
|
+
page shows traces from every project in the account.
|
|
78
85
|
|
|
79
86
|

|
|
80
87
|
|
|
@@ -153,6 +153,18 @@ Paths don't need to be defined using common REST principles. You are free to
|
|
|
153
153
|
structure your paths however you prefer. For example, `/users/get({userId})` is
|
|
154
154
|
a valid OpenAPI path and would still match the `userId` parameter.
|
|
155
155
|
|
|
156
|
+
:::caution{title="Text after a path parameter"}
|
|
157
|
+
|
|
158
|
+
From
|
|
159
|
+
[compatibility date `2026-11-06`](../programmable-api/compatibility-dates.mdx#openapi-path-parameters-end-at-the-closing-brace),
|
|
160
|
+
a path parameter ends at its closing `}`. A path such as `/items/{id}_details`
|
|
161
|
+
then matches `/items/42_details` with `id` set to `42`, and no longer matches
|
|
162
|
+
`/items/42`. Before that date, the letters, digits, `_`, or `$` after the `}`
|
|
163
|
+
became part of the parameter name. The build warns about each path that changes
|
|
164
|
+
meaning.
|
|
165
|
+
|
|
166
|
+
:::
|
|
167
|
+
|
|
156
168
|
:::caution{title="Special Characters"}
|
|
157
169
|
|
|
158
170
|
The handling of special characters in the path has changed with
|
|
@@ -50,6 +50,12 @@ public internet and providing lower latency.
|
|
|
50
50
|
|
|
51
51
|
## Choosing an approach
|
|
52
52
|
|
|
53
|
+
On Managed Edge, every pattern below that calls another Zuplo gateway by its
|
|
54
|
+
`zuplo.app` URL or a custom domain needs
|
|
55
|
+
[`allowSameZoneRequests`](../programmable-api/zuplo-json.mdx#allowsamezonerequests)
|
|
56
|
+
set to `true` in the calling project's `zuplo.jsonc`. Without it, the call fails
|
|
57
|
+
with a `522`.
|
|
58
|
+
|
|
53
59
|
### Pattern A: URL Forward Handler
|
|
54
60
|
|
|
55
61
|
The [URL Forward Handler](../handlers/url-forward.mdx) is the simplest option.
|
|
@@ -241,6 +247,10 @@ error, the issue is at the network or TLS layer, not the HTTP layer.
|
|
|
241
247
|
|
|
242
248
|
### Common causes of 522 between Zuplo projects
|
|
243
249
|
|
|
250
|
+
- **Missing `allowSameZoneRequests`** — On Managed Edge, a call to another Zuplo
|
|
251
|
+
gateway fails with a `522` unless the calling project sets
|
|
252
|
+
[`allowSameZoneRequests`](../programmable-api/zuplo-json.mdx#allowsamezonerequests)
|
|
253
|
+
to `true` in `zuplo.jsonc`. Check this first.
|
|
244
254
|
- **DNS resolution failure** — The downstream URL is incorrect or the
|
|
245
255
|
environment no longer exists.
|
|
246
256
|
- **TLS handshake failure** — Misconfigured custom domain or certificate issue
|
|
@@ -368,14 +378,17 @@ Requests to `httpbin.org` or other external services work fine, but requests to
|
|
|
368
378
|
|
|
369
379
|
**Checklist:**
|
|
370
380
|
|
|
371
|
-
1.
|
|
381
|
+
1. On Managed Edge, confirm the calling project sets
|
|
382
|
+
[`allowSameZoneRequests`](../programmable-api/zuplo-json.mdx#allowsamezonerequests)
|
|
383
|
+
to `true` in `zuplo.jsonc`. This is the most common cause.
|
|
384
|
+
2. Check that the downstream Zuplo project's environment is not a development
|
|
372
385
|
environment (ending in `.zuplo.dev`). Development environments have stricter
|
|
373
386
|
rate limits (1,000 requests per minute) and may reject connections under
|
|
374
387
|
load.
|
|
375
|
-
|
|
388
|
+
3. Verify TLS is working — the outer gateway connects to the downstream over
|
|
376
389
|
HTTPS. If the downstream has a custom domain with certificate issues, the TLS
|
|
377
390
|
handshake fails and produces a 522.
|
|
378
|
-
|
|
391
|
+
4. Look at the outer gateway's logs for connection error details. The Zuplo
|
|
379
392
|
runtime logs include the error message when an outbound `fetch` fails.
|
|
380
393
|
|
|
381
394
|
### Caller receives the upstream 401 directly
|
|
@@ -265,6 +265,16 @@ option overrides the default. The canonical source of truth is the
|
|
|
265
265
|
`resource_metadata=` parameter on the upstream's `WWW-Authenticate` challenge to
|
|
266
266
|
an unauthenticated request.
|
|
267
267
|
|
|
268
|
+
## How the authorization server is discovered
|
|
269
|
+
|
|
270
|
+
After it reads the upstream's Protected Resource Metadata, the gateway looks up
|
|
271
|
+
the metadata of the authorization server. It tries the OAuth authorization
|
|
272
|
+
server metadata path (`/.well-known/oauth-authorization-server`) first, then
|
|
273
|
+
falls back to OpenID Connect discovery (`/.well-known/openid-configuration`).
|
|
274
|
+
The gateway moves on to the next path when a provider answers one with a 4xx
|
|
275
|
+
status, so a provider that serves only `/.well-known/openid-configuration`, such
|
|
276
|
+
as Salesforce, still connects.
|
|
277
|
+
|
|
268
278
|
## Related
|
|
269
279
|
|
|
270
280
|
- [Connect a gateway to an upstream OAuth provider](../how-to/connect-upstream-oauth.mdx)
|
|
@@ -71,6 +71,12 @@ network error, malformed response) is a `failure`. The operator sees the same
|
|
|
71
71
|
red chart slice in all three cases but can pivot to the right next question by
|
|
72
72
|
clicking the slice.
|
|
73
73
|
|
|
74
|
+
A call the client got wrong counts as a failure with `failureOrigin` `client`,
|
|
75
|
+
not `upstream`. That covers invalid arguments, an unknown tool, prompt, or
|
|
76
|
+
resource, and invalid params. Zuplo records these for routes that use the
|
|
77
|
+
[MCP Server handler](../../handlers/mcp-server.mdx), so they stay out of the
|
|
78
|
+
upstream failure count.
|
|
79
|
+
|
|
74
80
|
## Dimensions you'll filter by
|
|
75
81
|
|
|
76
82
|
Each event carries the route and identity fields that scope it:
|
|
@@ -116,11 +116,25 @@ DCR requests that include any other scope value are rejected with
|
|
|
116
116
|
|
|
117
117
|
### Required on requests to MCP routes
|
|
118
118
|
|
|
119
|
-
| Header | Required | Notes
|
|
120
|
-
| --------------------------------------------- | ----------------------- |
|
|
121
|
-
| `Authorization: Bearer <token>` | Yes (after initial 401) | Opaque access token issued by `/__zuplo/oauth/token`. Tokens in query strings are rejected.
|
|
122
|
-
| `Accept: application/json, text/event-stream` | Yes | Per the Streamable HTTP transport spec. The gateway forwards the body as-is.
|
|
123
|
-
| `MCP-Protocol-Version` | Yes after `initialize` | The version the client negotiated, for example `2025-11-25`. See [Supported MCP protocol versions](#supported-mcp-protocol-versions).
|
|
119
|
+
| Header | Required | Notes |
|
|
120
|
+
| --------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| `Authorization: Bearer <token>` | Yes (after initial 401) | Opaque access token issued by `/__zuplo/oauth/token`. Tokens in query strings are rejected. |
|
|
122
|
+
| `Accept: application/json, text/event-stream` | Yes | Per the Streamable HTTP transport spec. The gateway forwards the body as-is, except on sampled requests. See [the note below](#forwarded-request-changes). |
|
|
123
|
+
| `MCP-Protocol-Version` | Yes after `initialize` | The version the client negotiated, for example `2025-11-25`. See [Supported MCP protocol versions](#supported-mcp-protocol-versions). |
|
|
124
|
+
|
|
125
|
+
### Forwarded request changes
|
|
126
|
+
|
|
127
|
+
The gateway forwards the request body to the upstream unchanged, with two
|
|
128
|
+
exceptions:
|
|
129
|
+
|
|
130
|
+
- **Sampled requests.** When the request's trace is sampled, the gateway
|
|
131
|
+
re-serializes the JSON body to set `params._meta.traceparent` (and
|
|
132
|
+
`tracestate`) so the upstream can continue the trace. The body carries the
|
|
133
|
+
same values, but whitespace and number formatting can differ. Requests that
|
|
134
|
+
aren't sampled, and bodies larger than 256 KiB, are forwarded as received. See
|
|
135
|
+
[Trace context from MCP clients](../articles/opentelemetry.mdx#trace-context-from-mcp-clients).
|
|
136
|
+
- **Compression.** The gateway sends `Accept-Encoding: gzip, br` to the
|
|
137
|
+
upstream, whatever the client sent.
|
|
124
138
|
|
|
125
139
|
### Honored when present
|
|
126
140
|
|
|
@@ -19,6 +19,7 @@ the fix. Jump straight to a symptom:
|
|
|
19
19
|
| [403 with `error="insufficient_scope"`](#403-with-errorinsufficient_scope) | Token issued for the wrong scope |
|
|
20
20
|
| [Connect-required errors](#connect-required-errors) | Expected — upstream OAuth not yet completed |
|
|
21
21
|
| [Reconsent prompts](#reconsent-prompts) | Upstream credential revoked or expired |
|
|
22
|
+
| [No OAuth tokens from the upstream](#the-upstream-connection-returned-no-oauth-tokens) | Upstream authorized but returned no tokens |
|
|
22
23
|
| [Compatibility date too old](#compatibility-date-too-old) | `compatibilityDate` older than `2026-03-01` |
|
|
23
24
|
| [Auth0 policy rejects domain with `https://` prefix](#auth0-policy-rejects-domain-with-https-prefix) | `auth0Domain` set to a URL, not a hostname |
|
|
24
25
|
| [Custom domain → wrong issuer in AS metadata](#custom-domain--wrong-issuer-in-as-metadata) | Edge proxy not forwarding `Host` |
|
|
@@ -98,6 +99,23 @@ still exists, but its tokens are no longer usable.
|
|
|
98
99
|
the upstream and the gateway replaces the stored tokens. No admin action is
|
|
99
100
|
required.
|
|
100
101
|
|
|
102
|
+
## The upstream connection returned no OAuth tokens
|
|
103
|
+
|
|
104
|
+
**Symptom.** A tool call fails with a JSON-RPC error with `code: -32603` and the
|
|
105
|
+
message "The upstream connection returned no OAuth tokens." The HTTP status is
|
|
106
|
+
`200`, because the error is in the JSON-RPC response. When the message has no
|
|
107
|
+
`id`, such as a notification, the gateway responds with HTTP `500` instead.
|
|
108
|
+
|
|
109
|
+
**Likely cause.** The user authorized the upstream, but the upstream provider
|
|
110
|
+
returned no tokens for the connection. The gateway doesn't treat this as an
|
|
111
|
+
authentication problem with the client's own credentials, so it doesn't respond
|
|
112
|
+
with a `401`.
|
|
113
|
+
|
|
114
|
+
**Fix.** Reconnect the upstream: have the user complete the upstream OAuth flow
|
|
115
|
+
again so the gateway stores new tokens. If the error returns, check that the
|
|
116
|
+
upstream provider's OAuth server returns an access token for the scopes the
|
|
117
|
+
gateway requests.
|
|
118
|
+
|
|
101
119
|
## Compatibility date too old
|
|
102
120
|
|
|
103
121
|
**Symptom.** Calls work most of the time, but a request that triggers an
|
|
@@ -306,6 +306,14 @@ gets schema, query, and mutation tools instead, and `introspectionTool` and
|
|
|
306
306
|
tools with `schemaTool`, `queryTool`, and `mutationTool`. See
|
|
307
307
|
[Schema, query, and mutation tools](./graphql.mdx#schema-query-and-mutation-tools).
|
|
308
308
|
|
|
309
|
+
The deprecated `x-zuplo-mcp-graphql` extension keeps its introspection and
|
|
310
|
+
execute tools whatever the compatibility date. Moving the same configuration to
|
|
311
|
+
`x-zuplo-route.mcp` on compatibility date `2026-11-06` or later therefore
|
|
312
|
+
changes the tools your MCP clients see: `{operationId}_schema`,
|
|
313
|
+
`{operationId}_query`, and `{operationId}_mutation` replace the introspection
|
|
314
|
+
and execute tools. Update any client, prompt, or allowlist that refers to the
|
|
315
|
+
old tool names when you migrate.
|
|
316
|
+
|
|
309
317
|
:::
|
|
310
318
|
|
|
311
319
|
## New Features
|
|
@@ -183,9 +183,9 @@ So if a client doesn't receive the `outputSchema` or `structuredContent` that
|
|
|
183
183
|
reaches the client depends on the `MCP-Protocol-Version` header the client
|
|
184
184
|
sends:
|
|
185
185
|
|
|
186
|
-
- **`2025-11-25
|
|
187
|
-
message as its only text content. The model reads the
|
|
188
|
-
with corrected arguments.
|
|
186
|
+
- **`2025-11-25` or later** — the call returns a tool result with
|
|
187
|
+
`isError: true` and the message as its only text content. The model reads the
|
|
188
|
+
message and can retry with corrected arguments.
|
|
189
189
|
- **`2025-06-18` or earlier, or no header** — the call fails with JSON-RPC error
|
|
190
190
|
`-32602` and the message. `error.data` carries the validation details when
|
|
191
191
|
there are any.
|
|
@@ -107,6 +107,28 @@ when to use it and an example.
|
|
|
107
107
|
}
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
## `allowSameZoneRequests`
|
|
111
|
+
|
|
112
|
+
Send outbound requests through Zuplo's public edge so they can reach other Zuplo
|
|
113
|
+
gateways, either by their `zuplo.app` URL or by a custom domain. This
|
|
114
|
+
configuration defaults to `false`. Only Managed Edge projects read it; Managed
|
|
115
|
+
Dedicated and self-hosted projects already reach other gateways.
|
|
116
|
+
|
|
117
|
+
Without it, a Managed Edge project that calls another gateway's `zuplo.app` URL
|
|
118
|
+
or custom domain fails with a `522`. Set it to `true` on the project that makes
|
|
119
|
+
the call. A call to another gateway counts as a request on the gateway it
|
|
120
|
+
reaches. See
|
|
121
|
+
[Proxying between Zuplo gateways](../guides/proxying-between-zuplo-gateways.mdx)
|
|
122
|
+
for patterns and troubleshooting.
|
|
123
|
+
|
|
124
|
+
```jsonc
|
|
125
|
+
{
|
|
126
|
+
"version": 1,
|
|
127
|
+
"projectType": "managed-edge",
|
|
128
|
+
"allowSameZoneRequests": true,
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
110
132
|
## `devPortal`
|
|
111
133
|
|
|
112
134
|
Configure the developer portal with the `devPortal` object. The
|
|
@@ -103,6 +103,23 @@ const foo = url.searchParams.getAll("foo");
|
|
|
103
103
|
// foo will be an array here
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
## Request signal
|
|
107
|
+
|
|
108
|
+
`request.signal` is the standard `AbortSignal` of the `Request` class. From
|
|
109
|
+
[compatibility date `2026-11-06`](./compatibility-dates.mdx#mcp-protocol-2026-07-28-in-the-mcp-gateway-and-mcp-server-handler),
|
|
110
|
+
on Managed Edge and in local development (`zuplo dev`), `request.signal` aborts
|
|
111
|
+
when the client disconnects. Use it to stop work, such as a long upstream call,
|
|
112
|
+
that nobody is waiting for:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
request.signal.addEventListener("abort", () => {
|
|
116
|
+
context.log.info("Client disconnected");
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Work you pass to [`context.waitUntil`](./zuplo-context.mdx#waituntil) still
|
|
121
|
+
completes after the client disconnects.
|
|
122
|
+
|
|
106
123
|
## Cloning and Modifying Requests
|
|
107
124
|
|
|
108
125
|
When you need to create a modified version of an existing request, you can use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zuplo",
|
|
3
|
-
"version": "7.15.
|
|
3
|
+
"version": "7.15.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The official Zuplo CLI for local development and platform management",
|
|
6
6
|
"homepage": "https://zuplo.com/docs/cli/overview",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"zuplo": "zuplo.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zuplo/cli": "7.15.
|
|
36
|
-
"@zuplo/core": "7.15.
|
|
37
|
-
"@zuplo/runtime": "7.15.
|
|
38
|
-
"@zuplo/test": "7.15.
|
|
35
|
+
"@zuplo/cli": "7.15.20",
|
|
36
|
+
"@zuplo/core": "7.15.20",
|
|
37
|
+
"@zuplo/runtime": "7.15.20",
|
|
38
|
+
"@zuplo/test": "7.15.20"
|
|
39
39
|
}
|
|
40
40
|
}
|