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.
- package/docs/ai-gateway/custom-pricing.mdx +54 -0
- package/docs/ai-gateway/jev.mdx +35 -0
- package/docs/ai-gateway/managing-apps.mdx +17 -0
- package/docs/ai-gateway/managing-providers.mdx +11 -0
- package/docs/ai-gateway/observability/analytics.mdx +2 -2
- package/docs/ai-gateway/openrouter.mdx +20 -0
- package/docs/ai-gateway/routing.mdx +40 -1
- package/docs/ai-gateway/universal-api.mdx +50 -6
- package/docs/ai-gateway/user-apps.mdx +44 -2
- package/docs/analytics/shared-controls.md +5 -0
- package/docs/analytics/tabs/consumers.md +36 -0
- package/docs/articles/api-key-api.mdx +16 -1
- package/docs/articles/api-key-buckets.mdx +1 -1
- package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +1 -1
- package/docs/articles/api-key-self-serve-integration.mdx +1 -1
- package/docs/articles/api-lint-configuration.mdx +21 -0
- package/docs/articles/api-lint-custom-rules.mdx +6 -0
- package/docs/articles/branch-based-deployments.mdx +11 -3
- package/docs/articles/ci-cd-azure/multi-stage-deployment.mdx +2 -2
- package/docs/articles/ci-cd-azure/pr-preview-environments.mdx +23 -4
- package/docs/articles/ci-cd-azure/tag-based-releases.mdx +1 -1
- package/docs/articles/ci-cd-bitbucket/multi-stage-deployment.mdx +3 -4
- package/docs/articles/ci-cd-bitbucket/pr-preview-environments.mdx +6 -5
- package/docs/articles/ci-cd-bitbucket/tag-based-releases.mdx +1 -1
- package/docs/articles/ci-cd-circleci/multi-stage-deployment.mdx +2 -3
- package/docs/articles/ci-cd-circleci/pr-preview-environments.mdx +6 -5
- package/docs/articles/ci-cd-circleci/tag-based-releases.mdx +1 -3
- package/docs/articles/ci-cd-github/basic-deployment.mdx +6 -6
- package/docs/articles/ci-cd-github/cleanup-on-branch-delete.mdx +8 -20
- package/docs/articles/ci-cd-github/deploy-and-test.mdx +3 -3
- package/docs/articles/ci-cd-github/local-testing.mdx +1 -1
- package/docs/articles/ci-cd-github/multi-stage-deployment.mdx +2 -3
- package/docs/articles/ci-cd-github/pr-preview-environments.mdx +20 -31
- package/docs/articles/ci-cd-github/tag-based-releases.mdx +5 -3
- package/docs/articles/ci-cd-gitlab/mr-preview-environments.mdx +10 -4
- package/docs/articles/ci-cd-gitlab/multi-stage-deployment.mdx +3 -3
- package/docs/articles/ci-cd-gitlab/tag-based-releases.mdx +1 -1
- package/docs/articles/custom-ci-cd-azure.mdx +2 -2
- package/docs/articles/custom-ci-cd-bitbucket.mdx +2 -2
- package/docs/articles/custom-ci-cd-circleci.mdx +2 -2
- package/docs/articles/custom-ci-cd-github.mdx +10 -11
- package/docs/articles/custom-ci-cd-gitlab.mdx +2 -2
- package/docs/articles/environment-variables.mdx +55 -0
- package/docs/articles/monetization/api-access.mdx +126 -9
- package/docs/articles/monetization/meters.mdx +49 -2
- package/docs/articles/monetization/subscription-lifecycle.md +117 -19
- package/docs/articles/monetization/usage.mdx +58 -0
- package/docs/articles/monorepo-deployment.mdx +10 -25
- package/docs/articles/openapi.mdx +14 -0
- package/docs/articles/support.mdx +35 -0
- package/docs/articles/testing-preview-environments.mdx +1 -1
- package/docs/cli/delete.mdx +50 -0
- package/docs/cli/delete.partial.mdx +52 -0
- package/docs/cli/deploy.mdx +35 -18
- package/docs/cli/deploy.partial.mdx +35 -18
- package/docs/cli/variable-delete.mdx +36 -0
- package/docs/cli/variable-delete.partial.mdx +37 -0
- package/docs/concepts/source-control-and-deployment.mdx +5 -5
- package/docs/dedicated/source-control.mdx +1 -1
- package/docs/dev-portal/dev-portal-create-consumer-on-auth.mdx +1 -1
- package/docs/dev-portal/overview.mdx +23 -0
- package/docs/dev-portal/zudoku/components/alert.mdx +1 -1
- package/docs/dev-portal/zudoku/configuration/api-reference.md +52 -0
- package/docs/dev-portal/zudoku/configuration/authentication-auth0.md +25 -0
- package/docs/dev-portal/zudoku/configuration/authentication-azure-ad.md +7 -0
- package/docs/dev-portal/zudoku/configuration/authentication-openid.md +48 -2
- package/docs/dev-portal/zudoku/configuration/authentication.md +4 -0
- package/docs/dev-portal/zudoku/configuration/build-configuration.mdx +4 -0
- package/docs/dev-portal/zudoku/configuration/navigation.mdx +15 -1
- package/docs/dev-portal/zudoku/configuration/overview.md +3 -0
- package/docs/dev-portal/zudoku/custom-plugins.md +38 -1
- package/docs/dev-portal/zudoku/guides/server-side-content-protection.md +7 -7
- package/docs/dev-portal/zudoku/openapi-extensions/x-enum-descriptions.md +85 -0
- package/docs/dev-portal/zudoku-partials/configuration/authentication-auth0.partial.md +24 -0
- package/docs/errors/build-error.mdx +58 -0
- package/docs/mcp-gateway/auth/configuring-entra.mdx +59 -0
- package/docs/mcp-gateway/auth/configuring-okta.mdx +30 -6
- package/docs/mcp-gateway/auth/configuring-workos.mdx +26 -0
- package/docs/mcp-gateway/auth/overview.mdx +2 -2
- package/docs/policies/request-validation-inbound/doc.md +54 -0
- package/docs/programmable-api/environment.mdx +10 -2
- package/package.json +5 -5
|
@@ -97,3 +97,57 @@ Setting prices requires the same **Edit** permission as
|
|
|
97
97
|
1. Click **Save**.
|
|
98
98
|
|
|
99
99
|
</Stepper>
|
|
100
|
+
|
|
101
|
+
## Import or export prices
|
|
102
|
+
|
|
103
|
+
To set many prices at once, or to keep them in a spreadsheet, use the **Import /
|
|
104
|
+
Export** menu beside **Available Models** when you edit a built-in provider. The
|
|
105
|
+
file can be CSV or JSON. Prices in the file are in dollars per 1M tokens, the
|
|
106
|
+
same unit as the price cells.
|
|
107
|
+
|
|
108
|
+
- **Export CSV** and **Export JSON** download the provider's models with their
|
|
109
|
+
prices. An exported file is a ready template for an import.
|
|
110
|
+
- **Import** reads a CSV or JSON file and fills in the price cells. Review the
|
|
111
|
+
summary above the table, then click **Save** to apply the prices. Nothing
|
|
112
|
+
changes until you save.
|
|
113
|
+
|
|
114
|
+
A file has one row per model, with these columns:
|
|
115
|
+
|
|
116
|
+
| Column | What it sets |
|
|
117
|
+
| ----------------------- | -------------------------------- |
|
|
118
|
+
| `model` | The model name. Required. |
|
|
119
|
+
| `input_per_1m` | **Input** price |
|
|
120
|
+
| `output_per_1m` | **Output** price |
|
|
121
|
+
| `cache_read_per_1m` | **Cache read** price |
|
|
122
|
+
| `cache_write_per_1m` | **Cache write (5 minute)** price |
|
|
123
|
+
| `cache_write_1h_per_1m` | **Cache write (1 hour)** price |
|
|
124
|
+
|
|
125
|
+
Only `model` is required. An empty cell leaves that price unchanged, so a file
|
|
126
|
+
can carry just the prices you want to change. For example, this file sets the
|
|
127
|
+
input and output prices for one model and the cache read price for another:
|
|
128
|
+
|
|
129
|
+
```csv
|
|
130
|
+
model,input_per_1m,output_per_1m,cache_read_per_1m,cache_write_per_1m,cache_write_1h_per_1m
|
|
131
|
+
claude-sonnet-5,2.4,12,,,
|
|
132
|
+
claude-haiku-5-5,,,0.08,,
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The same prices as JSON:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
[
|
|
139
|
+
{ "model": "claude-sonnet-5", "input_per_1m": 2.4, "output_per_1m": 12 },
|
|
140
|
+
{ "model": "claude-haiku-5-5", "cache_read_per_1m": 0.08 }
|
|
141
|
+
]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
A price that matches Zuplo's list price leaves the cell empty, so it keeps
|
|
145
|
+
following the list price. A model you haven't selected under **Available
|
|
146
|
+
Models** is selected for you when the file gives it a price, because only a
|
|
147
|
+
model the provider serves is billed at a price.
|
|
148
|
+
|
|
149
|
+
The portal rejects the whole file, and changes nothing, if it has a column it
|
|
150
|
+
doesn't recognize, a price that isn't a number of 0 or more, or the same model
|
|
151
|
+
twice. The message names the line or entry to fix. A model the provider doesn't
|
|
152
|
+
offer, or a price for a rate the model doesn't have, is left out, and the
|
|
153
|
+
summary lists what was skipped.
|
package/docs/ai-gateway/jev.mdx
CHANGED
|
@@ -236,6 +236,40 @@ curl https://my-gateway-main-2e18f50.zuplo.app/config_fe0a04972d2848e0a94ae4b8bc
|
|
|
236
236
|
|
|
237
237
|
The list has one entry for each enabled model, such as `jev/jev-latest`.
|
|
238
238
|
|
|
239
|
+
## Try Jev in the playground
|
|
240
|
+
|
|
241
|
+
You can try a Jev model in the Zuplo Portal without writing a request. Open your
|
|
242
|
+
app, click **Playground** in the page header, and pick a `jev/` model. The model
|
|
243
|
+
list labels it **System One: answers typed questions**. Instead of a chat, the
|
|
244
|
+
playground shows a System One workbench:
|
|
245
|
+
|
|
246
|
+
- **State.** Type the text the questions are about. Switch the format from
|
|
247
|
+
**Text** to **JSON** to send a JSON object, an array, or a string, as
|
|
248
|
+
`/v1/systemone` accepts.
|
|
249
|
+
- **Questions.** Build each question as a typed form: yes or no, choice, or
|
|
250
|
+
score. Start from the example, or switch from **Form** to **JSON** to edit the
|
|
251
|
+
request's `questions` directly.
|
|
252
|
+
- **Answers.** Each answer appears beside its question as a meter for a
|
|
253
|
+
yes-or-no question, a distribution across the options for a choice, and a
|
|
254
|
+
position on the scale for a score. Grey ticks mark where each answer was on
|
|
255
|
+
the previous run, so you can see what a change to the state or a question did.
|
|
256
|
+
|
|
257
|
+
Click **Ask**, or press Ctrl+Enter in the state, to send the request. **Ask as I
|
|
258
|
+
type** is on by default and asks again when you pause typing; turn it off to
|
|
259
|
+
send only when you click **Ask**. Each request goes through the app's policy
|
|
260
|
+
chain like any other, so it counts toward the app's budgets and shows up in its
|
|
261
|
+
analytics. **Copy cURL** copies the state and questions as a `/v1/systemone`
|
|
262
|
+
request.
|
|
263
|
+
|
|
264
|
+
## Classify prompts for Smart Router
|
|
265
|
+
|
|
266
|
+
Jev can also be the classifier for [Smart Router](./routing.mdx#smart-router),
|
|
267
|
+
which routes each chat request to a model by its intent and complexity. Create
|
|
268
|
+
an app for the classifier, then set Smart Router's `classifier.app.dialect` to
|
|
269
|
+
`system-one` and its `model` to a Jev model such as `jev/jev-latest`. Smart
|
|
270
|
+
Router asks Jev two typed questions and routes on the answers. See
|
|
271
|
+
[Choose a classifier model](./routing.mdx#choose-a-classifier-model).
|
|
272
|
+
|
|
239
273
|
## Pricing and budgets
|
|
240
274
|
|
|
241
275
|
The gateway prices each request from the model catalog at the rate on TypeSafe's
|
|
@@ -345,3 +379,4 @@ the model in `defaultModel` or in each call instead, or list the models with the
|
|
|
345
379
|
which models each app can call.
|
|
346
380
|
- [Usage limits](./usage-limits.mdx)—set budgets on tokens, requests, and
|
|
347
381
|
spending.
|
|
382
|
+
- [Routing and reliability](./routing.mdx)—use Jev as a Smart Router classifier.
|
|
@@ -97,6 +97,23 @@ doesn't include Budgets and Costs. See [Usage Limits](./usage-limits.mdx). The
|
|
|
97
97
|
people who can view the app are notified when it crosses a **Warn** or **Block**
|
|
98
98
|
amount; see [Budget Alerts](./budget-alerts.mdx).
|
|
99
99
|
|
|
100
|
+
## Playground
|
|
101
|
+
|
|
102
|
+
To try an app without writing code, open the app in the Zuplo Portal and click
|
|
103
|
+
**Playground** in the page header. The playground sends requests through the
|
|
104
|
+
app's gateway URL, so they run the app's policy chain, count toward its budgets,
|
|
105
|
+
and show up in its analytics. Pick a model from those the app can call, send a
|
|
106
|
+
message, and the playground shows the reply with the status, timing, and token
|
|
107
|
+
counts. **Copy cURL** copies the request it would send, so you can run it from a
|
|
108
|
+
terminal.
|
|
109
|
+
|
|
110
|
+
If the app serves a [Jev](./jev.mdx) model, picking it switches the playground
|
|
111
|
+
to a System One workbench. See
|
|
112
|
+
[Try Jev in the playground](./jev.mdx#try-jev-in-the-playground).
|
|
113
|
+
|
|
114
|
+
For personal keys, the **My Keys** tab has its own playground. See
|
|
115
|
+
[Manage your keys](./user-apps.mdx#manage-your-keys).
|
|
116
|
+
|
|
100
117
|
## Editing an App
|
|
101
118
|
|
|
102
119
|
To edit an app, open the
|
|
@@ -113,6 +113,17 @@ available fail with an error naming the model.
|
|
|
113
113
|
|
|
114
114
|
:::
|
|
115
115
|
|
|
116
|
+
### Deprecated models
|
|
117
|
+
|
|
118
|
+
When a vendor retires a model, Zuplo marks it deprecated in the model catalog
|
|
119
|
+
instead of deleting it. A deprecated model stops routing: a request that selects
|
|
120
|
+
it fails with a configuration error that says the model isn't active for that
|
|
121
|
+
provider and tells you to choose an active one. The Portal's model list shows
|
|
122
|
+
only active models, so a deprecated model no longer appears when you add or edit
|
|
123
|
+
a provider, and it's left out of `GET /v1/models`. To keep an app working,
|
|
124
|
+
change it to the vendor's replacement model, for example with a
|
|
125
|
+
[Model Override](../policies/ai-gateway-model-override-inbound.mdx) policy.
|
|
126
|
+
|
|
116
127
|
## Deleting an AI Provider
|
|
117
128
|
|
|
118
129
|
Providers that are no longer used within your Zuplo project can be deleted. To
|
|
@@ -21,8 +21,8 @@ Open your AI Gateway project and select the
|
|
|
21
21
|
[**Observability**](https://portal.zuplo.com/+/account/project/ai/analytics)
|
|
22
22
|
tab. It has two sub-tabs:
|
|
23
23
|
|
|
24
|
-
- **Logs** shows request logs and messages written by policies
|
|
25
|
-
[Logging](../../articles/logging.mdx
|
|
24
|
+
- **Logs** shows request logs and messages written by policies, and the details
|
|
25
|
+
of each AI request. See [Logging](../../articles/logging.mdx).
|
|
26
26
|
- **Analytics** holds the dashboards described on this page. A sidebar lists its
|
|
27
27
|
sections.
|
|
28
28
|
|
|
@@ -139,6 +139,26 @@ Two consequences worth knowing:
|
|
|
139
139
|
separate models, and the gateway's OpenRouter catalog doesn't include them, so
|
|
140
140
|
a request for one is rejected like any model outside your selections.
|
|
141
141
|
|
|
142
|
+
## Model catalog
|
|
143
|
+
|
|
144
|
+
The gateway's OpenRouter catalog follows OpenRouter's own model list, and Zuplo
|
|
145
|
+
refreshes it regularly. New models appear in the list when you add or edit the
|
|
146
|
+
provider. A model that OpenRouter removes is marked deprecated rather than
|
|
147
|
+
deleted, so the gateway can still price traffic it served earlier. A deprecated
|
|
148
|
+
model stops routing: a request for it fails with an error that says the model
|
|
149
|
+
isn't active for the provider. See
|
|
150
|
+
[What a deprecated model means](./managing-providers.mdx#deprecated-models).
|
|
151
|
+
|
|
152
|
+
The catalog also holds two kinds of entry you might not expect:
|
|
153
|
+
|
|
154
|
+
- **`~vendor/...-latest` aliases**, such as `~anthropic/claude-sonnet-latest`
|
|
155
|
+
and `~openai/gpt-sol-latest`. OpenRouter moves each alias to the vendor's
|
|
156
|
+
current model of that kind, so the model behind it can change without a change
|
|
157
|
+
on your side. Pin a specific model when you need the same answers over time.
|
|
158
|
+
- **`:extended` variants**, which OpenRouter lists as separate models with a
|
|
159
|
+
longer context window at a different price. They're in the catalog whenever
|
|
160
|
+
OpenRouter lists them.
|
|
161
|
+
|
|
142
162
|
## Call the models
|
|
143
163
|
|
|
144
164
|
Point any OpenAI-compatible client at your app URL with `/v1` appended:
|
|
@@ -11,11 +11,12 @@ applies_to:
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
An app's [policy chain](./policy-chains.mdx) decides which model serves each
|
|
14
|
-
request and what happens when that model fails or a budget runs out.
|
|
14
|
+
request and what happens when that model fails or a budget runs out. Four
|
|
15
15
|
policies cover this, and you can combine them in one chain:
|
|
16
16
|
|
|
17
17
|
| You want to | Use | How it picks or changes the model |
|
|
18
18
|
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| Decide the model on the gateway instead of letting clients choose | [Model Override](../policies/ai-gateway-model-override-inbound.mdx) | `force` sends every request to one model, and `default` supplies a model only when the request omits one |
|
|
19
20
|
| Spread requests across deployments, accounts, or providers to combine rate limits | [Model Load Balancing](../policies/ai-gateway-load-balancing-inbound.mdx) | Round robin through a list, or sticky routing that keeps a user or conversation on one model |
|
|
20
21
|
| Send simple prompts to a cheaper model and hard prompts to a stronger one | [Smart Router](../policies/ai-gateway-smart-router-inbound.mdx) | Classifies each prompt's complexity as `low`, `medium`, or `high` and routes to the model for that level |
|
|
21
22
|
| Keep serving when the model errors, is rate limited, or is slow to respond | [Fallback Model](../policies/ai-gateway-fallback-model-inbound.mdx) `fallback` | Moves the request to a backup model after a retryable failure or timeout |
|
|
@@ -134,6 +135,37 @@ have used without Smart Router. To try a classifier without changing any
|
|
|
134
135
|
routing, set `smartRoutingEnabled` to `false` and read the results in a later
|
|
135
136
|
policy.
|
|
136
137
|
|
|
138
|
+
### Choose a classifier model
|
|
139
|
+
|
|
140
|
+
Set `classifier.app` to the app that runs the classifier, and `model` to the
|
|
141
|
+
model that app routes the classifier request to. The optional `dialect` picks
|
|
142
|
+
the API Smart Router calls on that app:
|
|
143
|
+
|
|
144
|
+
| `dialect` | Calls | Use it for |
|
|
145
|
+
| ---------------------------- | ---------------------- | -------------------------------------------- |
|
|
146
|
+
| `chat-completions` (default) | `/v1/chat/completions` | OpenAI-compatible chat models |
|
|
147
|
+
| `messages` | `/v1/messages` | Claude models |
|
|
148
|
+
| `system-one` | `/v1/systemone` | [Jev](./jev.mdx) and other System One models |
|
|
149
|
+
|
|
150
|
+
A Claude classifier needs a model and a provider that support structured
|
|
151
|
+
outputs, because Smart Router constrains the reply to a JSON schema. Claude
|
|
152
|
+
Haiku 4.5 and the current Sonnet, Opus, and Fable models do. Anthropic, Google
|
|
153
|
+
Vertex AI, and Microsoft Foundry accept the request. Amazon Bedrock Mantle
|
|
154
|
+
doesn't, and rejects it with a `400`, so every classification would fail and the
|
|
155
|
+
requests would continue unclassified. Use another provider for the classifier
|
|
156
|
+
app. Larger Claude models always think before they answer, which makes each
|
|
157
|
+
classification slower and costlier, so start with Claude Haiku 4.5.
|
|
158
|
+
|
|
159
|
+
`classifierTimeoutMs` sets how long Smart Router waits for the classifier before
|
|
160
|
+
it forwards the request unclassified. It defaults to 8000 milliseconds.
|
|
161
|
+
|
|
162
|
+
The older `classifier.chatCompletions` and `classifier.jev` options call a
|
|
163
|
+
service directly with its own key. They're deprecated: they skip the classifier
|
|
164
|
+
app's policy chain, budgets, and analytics. Use `classifier.app` instead. See
|
|
165
|
+
the
|
|
166
|
+
[Smart Router policy reference](../policies/ai-gateway-smart-router-inbound.mdx)
|
|
167
|
+
for every option and how to migrate.
|
|
168
|
+
|
|
137
169
|
## Fallback Model
|
|
138
170
|
|
|
139
171
|
[Fallback Model](../policies/ai-gateway-fallback-model-inbound.mdx) adds two
|
|
@@ -173,6 +205,7 @@ and Costs and Semantic Cache:
|
|
|
173
205
|
|
|
174
206
|
```text
|
|
175
207
|
API Key Authentication
|
|
208
|
+
→ Model Override (optional, before any other model selection)
|
|
176
209
|
→ Model Load Balancing (or Model Filtering → Smart Router)
|
|
177
210
|
→ Fallback Model
|
|
178
211
|
→ Budgets and Costs
|
|
@@ -181,6 +214,12 @@ API Key Authentication
|
|
|
181
214
|
|
|
182
215
|
- **API Key Authentication** comes first, so sticky routing by `user` has a
|
|
183
216
|
caller to key on.
|
|
217
|
+
- **Model Override** goes before Model Filtering, Model Load Balancing, and
|
|
218
|
+
Fallback Model, because a model chosen by an earlier policy isn't overwritten.
|
|
219
|
+
A forced model needs no entry in a Model Filtering allow list. Model Load
|
|
220
|
+
Balancing does nothing for a request Model Override already routed. Add
|
|
221
|
+
Fallback Model after it for the backups, because Model Override accepts plain
|
|
222
|
+
`providerName/model` values only.
|
|
184
223
|
- **Model Load Balancing** doesn't need Model Filtering for the request types it
|
|
185
224
|
has a list for, because its list already limits which models clients reach. If
|
|
186
225
|
Model Filtering runs first, its selection stands and Model Load Balancing does
|
|
@@ -66,17 +66,61 @@ clients that can't set a model still work.
|
|
|
66
66
|
|
|
67
67
|
## Supported endpoints
|
|
68
68
|
|
|
69
|
-
| Endpoint
|
|
70
|
-
|
|
|
71
|
-
| `/v1/chat/completions`
|
|
72
|
-
| `/v1/embeddings`
|
|
73
|
-
| `/v1/responses`
|
|
74
|
-
| `/v1/messages`
|
|
69
|
+
| Endpoint | Notes |
|
|
70
|
+
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| `/v1/chat/completions` | Chat completions for every provider |
|
|
72
|
+
| `/v1/embeddings` | Embeddings for the providers marked in the [capability matrix](./providers.mdx#supported-providers) |
|
|
73
|
+
| `/v1/responses` | OpenAI Responses API: OpenAI, xAI, and the OpenAI-compatible models that serve it on [Azure AI](./azure-ai.mdx), [Bedrock Mantle](./bedrock-mantle.mdx) and [OpenRouter](./openrouter.mdx) |
|
|
74
|
+
| `/v1/messages` | Anthropic Messages API: Anthropic, and the Claude models of [Azure AI](./azure-ai.mdx), [Bedrock Mantle](./bedrock-mantle.mdx), [Vertex AI](./vertex-ai.mdx) and [OpenRouter](./openrouter.mdx) |
|
|
75
|
+
| `/v1/messages/count_tokens` | Counts the tokens of a Messages request without running it: Anthropic, [Vertex AI](./vertex-ai.mdx), and the Claude models of [Bedrock Mantle](./bedrock-mantle.mdx). Other providers return a `400` |
|
|
76
|
+
| `GET /v1/responses/{id}` | Retrieves a stored response from a provider that serves the Responses API |
|
|
77
|
+
| `DELETE /v1/responses/{id}` | Deletes a stored response |
|
|
78
|
+
| `GET /v1/models` | Lists the models the app can call. See [Listing models](#listing-models) |
|
|
75
79
|
|
|
76
80
|
Jev is the exception: it serves TypeSafe's System One API on `/v1/systemone`,
|
|
77
81
|
which takes a state and typed questions rather than chat messages. That endpoint
|
|
78
82
|
isn't part of the Universal API. See [Jev](./jev.mdx).
|
|
79
83
|
|
|
84
|
+
### Stored responses
|
|
85
|
+
|
|
86
|
+
Retrieving or deleting a stored response sends no body, so the gateway has no
|
|
87
|
+
`model` to route on. It uses the app's first configured completions model, which
|
|
88
|
+
has to be on a provider that serves the Responses API. A
|
|
89
|
+
`GET /v1/responses/{id}/input_items` request, which lists the input items of a
|
|
90
|
+
stored response, works the same way. For the setup each provider needs, see
|
|
91
|
+
[Azure AI](./azure-ai.mdx#supported-endpoints) and
|
|
92
|
+
[Bedrock Mantle](./bedrock-mantle.mdx).
|
|
93
|
+
|
|
94
|
+
## Listing models
|
|
95
|
+
|
|
96
|
+
`GET /v1/models` lists the models your app can call, as qualified IDs such as
|
|
97
|
+
`openai/gpt-5`. Send `GET /v1/models/{model}` to look up one of them. The list
|
|
98
|
+
holds only active models of providers that have credentials, that serve the
|
|
99
|
+
endpoint you ask about, and that the app's
|
|
100
|
+
[Model Filtering](../policies/ai-gateway-model-filtering-inbound.mdx) policy
|
|
101
|
+
allows.
|
|
102
|
+
|
|
103
|
+
A model list is per endpoint, because each endpoint serves different models. The
|
|
104
|
+
gateway picks the endpoint and the response format from the request:
|
|
105
|
+
|
|
106
|
+
- With an `anthropic-version` header, as the Anthropic SDK sends, the list holds
|
|
107
|
+
the models that serve `/v1/messages`, in the Messages format. It pages with
|
|
108
|
+
`limit` (1 to 1000, default 20) and one of `after_id` or `before_id`. The
|
|
109
|
+
response carries `first_id`, `last_id`, and `has_more`.
|
|
110
|
+
- Without it, the list holds the models that serve `/v1/chat/completions`, in
|
|
111
|
+
the OpenAI format, with no paging.
|
|
112
|
+
|
|
113
|
+
To list the models of another endpoint, set the `x-zuplo-models-endpoint` header
|
|
114
|
+
to `chat-completions`, `messages`, `responses`, `embeddings`, or `systemone`.
|
|
115
|
+
Any other value returns a `400`, and any method other than `GET` returns a
|
|
116
|
+
`405`.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
curl https://my-gateway-main-2e18f50.zuplo.app/config_fe0a04972d2848e0a94ae4b8bcd1497e/v1/models \
|
|
120
|
+
-H "Authorization: Bearer $ZUPLO_APP_API_KEY" \
|
|
121
|
+
-H "x-zuplo-models-endpoint: embeddings"
|
|
122
|
+
```
|
|
123
|
+
|
|
80
124
|
## Request headers
|
|
81
125
|
|
|
82
126
|
The gateway forwards your request headers to the provider. A header your client
|
|
@@ -87,8 +87,8 @@ Admins manage the User App on the AI Gateway project's
|
|
|
87
87
|
</Stepper>
|
|
88
88
|
|
|
89
89
|
**People** lists everyone on the project, how many personal keys each person
|
|
90
|
-
has, and what each person spent today and this month. **
|
|
91
|
-
App's
|
|
90
|
+
has, and what each person spent today and this month. **Configuration** shows
|
|
91
|
+
the User App's configuration ID and its URL. The name isn't editable.
|
|
92
92
|
|
|
93
93
|
### Personal budgets
|
|
94
94
|
|
|
@@ -157,6 +157,48 @@ you reach your allowance, the gateway refuses requests with
|
|
|
157
157
|
You're notified in the Zuplo Portal and by email when you reach your allowance;
|
|
158
158
|
see [Budget Alerts](./budget-alerts.mdx).
|
|
159
159
|
|
|
160
|
+
## Manage your keys
|
|
161
|
+
|
|
162
|
+
The **My Keys** tab lists every personal key you've created, one row per key,
|
|
163
|
+
with its name, when you created it, and its status. A key you've rolled keeps
|
|
164
|
+
its own row beside its replacement, under the same name, so tell them apart by
|
|
165
|
+
the end of the key and the status. Open a row's **...** menu, or right-click the
|
|
166
|
+
row, to act on it.
|
|
167
|
+
|
|
168
|
+
- **Try in playground** opens a chat with the User App signed with that key, so
|
|
169
|
+
you can check that the key works. You can also open the playground from the
|
|
170
|
+
header of the tab.
|
|
171
|
+
- **Roll key** creates a replacement key to copy right away. Under **Old key**,
|
|
172
|
+
choose what happens to the key you're replacing:
|
|
173
|
+
- **Invalidate immediately** stops the old key at once. Choose this if the key
|
|
174
|
+
may have leaked.
|
|
175
|
+
- **Keep it for 1 hour**, **Keep it for 1 day** (the default), or **Keep it
|
|
176
|
+
for 7 days** leaves the old key working for that long, so you can swap it
|
|
177
|
+
out of your tools first. The old key shows **Expires** and the time until it
|
|
178
|
+
stops, then **Expired**.
|
|
179
|
+
|
|
180
|
+
Copy the new key from the confirmation. Rolling doesn't change the key's name.
|
|
181
|
+
|
|
182
|
+
- **Delete key** removes a key you've rolled. It's available on a key still in
|
|
183
|
+
its grace period, which stops working right away instead of at its expiry, and
|
|
184
|
+
on an expired key, which leaves your list. The key that replaced it keeps
|
|
185
|
+
working. You can't undo a delete.
|
|
186
|
+
|
|
187
|
+
:::note
|
|
188
|
+
|
|
189
|
+
An active key has **Try in playground** and **Roll key**. **Delete key** appears
|
|
190
|
+
only once a key has been rolled.
|
|
191
|
+
|
|
192
|
+
:::
|
|
193
|
+
|
|
194
|
+
Below your keys, **My spend by model** lists the models you've sent the most
|
|
195
|
+
requests to with your personal keys, ordered by what they cost you. It shows the
|
|
196
|
+
**Model**, **Requests**, **Tokens**, and **Spend** for each over the last 30
|
|
197
|
+
days, or less if your plan keeps a shorter analytics history. Above it are your
|
|
198
|
+
totals for requests, tokens, and cost. These usage figures appear when your
|
|
199
|
+
account has analytics available. See
|
|
200
|
+
[Access and Entitlements](../analytics/access-and-entitlements.md#availability).
|
|
201
|
+
|
|
160
202
|
## Removing access
|
|
161
203
|
|
|
162
204
|
A personal key works only while its owner has access to the AI Gateway project.
|
|
@@ -47,6 +47,11 @@ filter from any breakdown table by clicking a value, or build one manually.
|
|
|
47
47
|
| startsWith | String prefix. |
|
|
48
48
|
| endsWith | String suffix. |
|
|
49
49
|
|
|
50
|
+
**Consumer details.** A pill that filters to one exact consumer has a **Consumer
|
|
51
|
+
details** icon. It opens the panel described in
|
|
52
|
+
[Consumer details](./tabs/consumers.md#consumer-details). The icon isn't shown
|
|
53
|
+
on AI Gateway projects.
|
|
54
|
+
|
|
50
55
|
**Clearing.** Remove a single pill with its **×**, or click **Clear all
|
|
51
56
|
filters** to reset.
|
|
52
57
|
|
|
@@ -54,6 +54,42 @@ The table is searchable and sortable on any column (default: requests
|
|
|
54
54
|
descending). Clicking a row filters the entire section to that consumer. **Show
|
|
55
55
|
more** loads the next 50.
|
|
56
56
|
|
|
57
|
+
## Consumer details
|
|
58
|
+
|
|
59
|
+
Select the **Consumer details** icon next to a consumer to open a panel that
|
|
60
|
+
shows who the consumer is, without leaving Analytics. The panel looks the
|
|
61
|
+
consumer up by name across your project's environments, and shows:
|
|
62
|
+
|
|
63
|
+
- **API key consumer**: the environment the consumer belongs to, its key
|
|
64
|
+
managers, and its tags. If the consumer exists in more than one environment,
|
|
65
|
+
pick the environment to view. **Open in API Keys** opens the API Keys list
|
|
66
|
+
filtered to the consumer, and **Edit consumer** opens its edit dialog.
|
|
67
|
+
- **Monetization customer**: when the consumer's key managers match a
|
|
68
|
+
[monetization](../../articles/monetization/index.mdx) customer, the customer's
|
|
69
|
+
plan and status, with links to **Open customer** and **Open subscription**. If
|
|
70
|
+
no customer matches, **Search customers** opens the Customers page filtered by
|
|
71
|
+
the key manager's email.
|
|
72
|
+
|
|
73
|
+
The panel also has **Show only this consumer's traffic**, which filters the
|
|
74
|
+
section to that consumer.
|
|
75
|
+
|
|
76
|
+
You can open the panel from:
|
|
77
|
+
|
|
78
|
+
- The consumer tables on **Overview** and **Consumers**.
|
|
79
|
+
- The **Consumers** breakdown on [Requests](./requests.md), and the consumer
|
|
80
|
+
tables on [GraphQL](./graphql.md) and [MCP](./mcp.md).
|
|
81
|
+
- A consumer filter pill. A pill that matches one exact consumer has a details
|
|
82
|
+
icon, so tabs without a consumer table, such as Cache and Origins, can open it
|
|
83
|
+
too. A pill that matches a pattern has none.
|
|
84
|
+
- A request's **User** field in the log details of a project's logs.
|
|
85
|
+
|
|
86
|
+
If no API key consumer has the name, the panel says so. The request may have
|
|
87
|
+
been authenticated another way, such as a JWT, or the consumer may have been
|
|
88
|
+
deleted. Anonymous requests have no details.
|
|
89
|
+
|
|
90
|
+
The panel isn't available on AI Gateway projects, whose consumers are apps, or
|
|
91
|
+
at account scope.
|
|
92
|
+
|
|
57
93
|
## Filters
|
|
58
94
|
|
|
59
95
|
The filter bar applies. `originHost` doesn't apply in this section. See
|
|
@@ -88,7 +88,7 @@ inside Zuplo)
|
|
|
88
88
|
# Your Zuplo Account Name
|
|
89
89
|
export ACCOUNT_NAME=my-account
|
|
90
90
|
# Your bucket ID (Found in Services > API Keys > Consumers)
|
|
91
|
-
export BUCKET_ID=
|
|
91
|
+
export BUCKET_ID=bckt_YOUR_BUCKET_ID
|
|
92
92
|
# Your Zuplo API Key (Found in Account Settings > Zuplo API Keys)
|
|
93
93
|
export API_KEY=zpka_YOUR_API_KEY
|
|
94
94
|
```
|
|
@@ -114,6 +114,21 @@ When a value matches both a bucket name and a bucket ID, the name wins.
|
|
|
114
114
|
|
|
115
115
|
</details>
|
|
116
116
|
|
|
117
|
+
### Consumer identifiers
|
|
118
|
+
|
|
119
|
+
Endpoints with a consumer in the path accept either the consumer's ID (for
|
|
120
|
+
example `csmr_sikZcE754kJu17X8yahPFO8J`) or its name (for example
|
|
121
|
+
`my-consumer`). Prefer the ID in new code, because a consumer's ID never
|
|
122
|
+
changes. When a value matches both a consumer name in the bucket and a consumer
|
|
123
|
+
ID, the name wins. Consumer IDs are case-sensitive.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
export CONSUMER_ID=csmr_sikZcE754kJu17X8yahPFO8J
|
|
127
|
+
curl \
|
|
128
|
+
https://dev.zuplo.com/v1/accounts/$ACCOUNT_NAME/key-buckets/$BUCKET_ID/consumers/$CONSUMER_ID \
|
|
129
|
+
--header "Authorization: Bearer $API_KEY"
|
|
130
|
+
```
|
|
131
|
+
|
|
117
132
|
### Creating a Consumer with a Key
|
|
118
133
|
|
|
119
134
|
When creating a new Consumer, it's a good idea to include some useful metadata
|
|
@@ -58,7 +58,7 @@ To use a custom bucket, specify its `bucketId` in your API Key policy options:
|
|
|
58
58
|
"export": "ApiKeyInboundPolicy",
|
|
59
59
|
"module": "$import(@zuplo/runtime)",
|
|
60
60
|
"options": {
|
|
61
|
-
"bucketId": "
|
|
61
|
+
"bucketId": "bckt_YOUR_BUCKET_ID",
|
|
62
62
|
"allowUnauthenticatedRequests": false
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -136,7 +136,7 @@ For a custom bucket, set `bucketId` on the policy so it checks the right one:
|
|
|
136
136
|
"export": "ApiKeyInboundPolicy",
|
|
137
137
|
"module": "$import(@zuplo/runtime)",
|
|
138
138
|
"options": {
|
|
139
|
-
"bucketId": "
|
|
139
|
+
"bucketId": "bckt_YOUR_BUCKET_ID",
|
|
140
140
|
"allowUnauthenticatedRequests": false
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -69,7 +69,7 @@ All examples in this guide use these environment variables:
|
|
|
69
69
|
# Your Zuplo Account Name
|
|
70
70
|
export ZUPLO_ACCOUNT=my-account
|
|
71
71
|
# Your bucket ID (found on the Services → API Keys → Consumers page)
|
|
72
|
-
export ZUPLO_BUCKET_ID=
|
|
72
|
+
export ZUPLO_BUCKET_ID=bckt_YOUR_BUCKET_ID
|
|
73
73
|
# Your Zuplo API Key (found in Account Settings > Zuplo API Keys)
|
|
74
74
|
export ZUPLO_API_KEY=zpka_YOUR_API_KEY
|
|
75
75
|
```
|
|
@@ -391,6 +391,27 @@ A route meets a requirement when its `x-zuplo-route.policies.inbound` (or
|
|
|
391
391
|
different policies, scope each requirement to its routes with a
|
|
392
392
|
[custom rule](./api-lint-custom-rules.mdx#require-a-policy-on-some-routes).
|
|
393
393
|
|
|
394
|
+
#### Migrate from `policyTypes`
|
|
395
|
+
|
|
396
|
+
Earlier versions of the linter identified a required policy with `policyTypes`,
|
|
397
|
+
a list of policy type prefixes. For example, `"policyTypes": ["api-key"]`
|
|
398
|
+
matched a policy of type `api-key-inbound`. `policyTypes` is deprecated and will
|
|
399
|
+
be removed in an upcoming release, after which a configuration that still uses
|
|
400
|
+
it fails to load. Until then it keeps working, and each run prints a
|
|
401
|
+
`DEPRECATED` warning.
|
|
402
|
+
|
|
403
|
+
To migrate, replace `policyTypes` with `policyName`, the exact `name` of the
|
|
404
|
+
policy in `config/policies.json`, and keep `direction` as it is. A requirement
|
|
405
|
+
can't set both `policyName` and `policyTypes`.
|
|
406
|
+
|
|
407
|
+
```jsonc
|
|
408
|
+
// Before
|
|
409
|
+
{ "id": "require-auth", "policyTypes": ["api-key"], "direction": "inbound" }
|
|
410
|
+
|
|
411
|
+
// After
|
|
412
|
+
{ "id": "require-auth", "policyName": "api-key-auth", "direction": "inbound" }
|
|
413
|
+
```
|
|
414
|
+
|
|
394
415
|
Requirements with `"severity": "error"` report under the rule ID
|
|
395
416
|
`zuplo/require-policy`. Requirements with `"severity": "warn"` report under
|
|
396
417
|
`zuplo/require-policy-warn`.
|
|
@@ -147,6 +147,12 @@ choose:
|
|
|
147
147
|
contain that exact policy name from `config/policies.json`. Add one rule per
|
|
148
148
|
requirement, each with its own ID and `paths`.
|
|
149
149
|
|
|
150
|
+
`zuplo:requirePolicy` used to take `policyTypes`, a list of policy type
|
|
151
|
+
prefixes. `policyTypes` is deprecated and will be removed in an upcoming
|
|
152
|
+
release. Replace it with `policyName`, the exact name of the policy in
|
|
153
|
+
`config/policies.json`. See
|
|
154
|
+
[Migrate from `policyTypes`](./api-lint-configuration.mdx#migrate-from-policytypes).
|
|
155
|
+
|
|
150
156
|
### Enforce a naming convention
|
|
151
157
|
|
|
152
158
|
```jsonc
|
|
@@ -128,8 +128,12 @@ of your project.
|
|
|
128
128
|
|
|
129
129
|
## Deleting Environments
|
|
130
130
|
|
|
131
|
-
When
|
|
132
|
-
|
|
131
|
+
When your project uses the GitHub integration, deleting a branch deletes the
|
|
132
|
+
corresponding Preview environment, including its
|
|
133
|
+
[Developer Portal](../dev-portal/overview.mdx), so the portal's hostnames stop
|
|
134
|
+
serving. Zuplo never deletes the Production environment or a protected
|
|
135
|
+
environment this way. With other source control providers, deleting a branch
|
|
136
|
+
doesn't delete the environment. To delete an environment yourself:
|
|
133
137
|
|
|
134
138
|
1. In your project, open the
|
|
135
139
|
[**Environments**](https://portal.zuplo.com/+/account/project/environments)
|
|
@@ -139,9 +143,13 @@ environment is **not automatically deleted**. To delete an environment:
|
|
|
139
143
|
Alternatively, use the [Zuplo CLI](../cli/delete.mdx):
|
|
140
144
|
|
|
141
145
|
```bash
|
|
142
|
-
npx zuplo delete --
|
|
146
|
+
npx zuplo delete --branch my-new-feature --api-key $ZUPLO_API_KEY
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
You can also delete an environment by its URL with
|
|
150
|
+
`zuplo delete --url https://your-environment-url.zuplo.app`. Pass either
|
|
151
|
+
`--branch` or `--url`, not both.
|
|
152
|
+
|
|
145
153
|
## Automatic Deployments on Push
|
|
146
154
|
|
|
147
155
|
With the Git integration enabled, every push to a branch triggers an automatic
|
|
@@ -34,7 +34,7 @@ stages:
|
|
|
34
34
|
|
|
35
35
|
- script: |
|
|
36
36
|
set -o pipefail
|
|
37
|
-
npx zuplo deploy --api-key $(ZUPLO_API_KEY) --
|
|
37
|
+
npx zuplo deploy --api-key $(ZUPLO_API_KEY) --branch staging 2>&1 | tee ./STAGING_STDOUT
|
|
38
38
|
STAGING_URL=$(grep -oP 'Deployed to \K(https://[^ ]+)' ./STAGING_STDOUT)
|
|
39
39
|
echo "##vso[task.setvariable variable=STAGING_URL;isOutput=true]$STAGING_URL"
|
|
40
40
|
name: deployStep
|
|
@@ -79,7 +79,7 @@ stages:
|
|
|
79
79
|
- script: npm install
|
|
80
80
|
|
|
81
81
|
- script:
|
|
82
|
-
npx zuplo deploy --api-key $(ZUPLO_API_KEY) --
|
|
82
|
+
npx zuplo deploy --api-key $(ZUPLO_API_KEY) --branch
|
|
83
83
|
production
|
|
84
84
|
displayName: "Deploy to production"
|
|
85
85
|
```
|