zuplo 7.1.1 → 7.1.2

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 (36) hide show
  1. package/docs/ai-gateway/apps.mdx +28 -10
  2. package/docs/ai-gateway/cookbooks/custom-fallback.mdx +96 -0
  3. package/docs/ai-gateway/cookbooks/dynamic-model-routing.mdx +119 -0
  4. package/docs/ai-gateway/custom-policies.mdx +213 -0
  5. package/docs/ai-gateway/custom-providers.mdx +10 -2
  6. package/docs/ai-gateway/fallback.mdx +48 -75
  7. package/docs/ai-gateway/getting-started.mdx +200 -132
  8. package/docs/ai-gateway/integrations/ai-sdk.mdx +71 -28
  9. package/docs/ai-gateway/integrations/claude-code.mdx +32 -8
  10. package/docs/ai-gateway/integrations/codex.mdx +28 -10
  11. package/docs/ai-gateway/integrations/goose.mdx +26 -19
  12. package/docs/ai-gateway/integrations/langchain.mdx +31 -15
  13. package/docs/ai-gateway/integrations/openai.mdx +28 -16
  14. package/docs/ai-gateway/introduction.mdx +73 -32
  15. package/docs/ai-gateway/managing-apps.mdx +62 -17
  16. package/docs/ai-gateway/managing-providers.mdx +23 -7
  17. package/docs/ai-gateway/managing-teams.mdx +29 -12
  18. package/docs/ai-gateway/policies/akamai-ai-firewall.mdx +92 -96
  19. package/docs/ai-gateway/policies/authentication.mdx +44 -0
  20. package/docs/ai-gateway/policies/comet-opik-tracing.mdx +40 -2
  21. package/docs/ai-gateway/policies/fallback-model.mdx +40 -0
  22. package/docs/ai-gateway/policies/galileo-tracing.mdx +36 -22
  23. package/docs/ai-gateway/policies/metering.mdx +47 -0
  24. package/docs/ai-gateway/policies/model-filtering.mdx +49 -0
  25. package/docs/ai-gateway/policies/overview.mdx +28 -0
  26. package/docs/ai-gateway/policies/semantic-cache.mdx +48 -0
  27. package/docs/ai-gateway/policy-chains.mdx +178 -0
  28. package/docs/ai-gateway/policy-templates.mdx +68 -0
  29. package/docs/ai-gateway/providers.mdx +23 -9
  30. package/docs/ai-gateway/source-control.mdx +88 -0
  31. package/docs/ai-gateway/teams.mdx +16 -10
  32. package/docs/ai-gateway/universal-api.mdx +39 -12
  33. package/docs/ai-gateway/usage-limits.mdx +87 -55
  34. package/docs/policies/cdn-cache-control-outbound/doc.md +13 -13
  35. package/package.json +5 -5
  36. package/docs/ai-gateway/guardrails.mdx +0 -65
@@ -1,12 +1,17 @@
1
1
  ---
2
2
  title: Managing Apps
3
+ description:
4
+ Create, edit, and delete AI Gateway apps. Apps are created with just a name
5
+ and a team; models, budgets, and other behavior live on the app's policy
6
+ chain.
3
7
  ---
4
8
 
5
- Apps in the AI Gateway represent any app or integration that will call the AI
6
- Gateway. For example, you might have a custom support chatbot on your website -
7
- that chatbot would be an App in the AI Gateway. Each App has its own API Key so
8
- that usage is tracked independently. Apps are owned by a specific
9
- [team](./teams.mdx) and can access the AI Providers assigned to that team.
9
+ An app represents one caller of your AI Gateway—a service, an agent, or a
10
+ feature in a larger codebase. Each app has its own API key, which the gateway
11
+ checks once you add the
12
+ [authentication policy](./policy-chains.mdx#authentication); usage is tracked
13
+ per app whether or not that policy applies. Each app belongs to a
14
+ [team](./teams.mdx) and can reach the AI providers assigned to that team.
10
15
 
11
16
  ## Creating an App
12
17
 
@@ -21,28 +26,68 @@ that usage is tracked independently. Apps are owned by a specific
21
26
 
22
27
  1. Select the team that will own the app.
23
28
 
24
- 1. Configure the AI Model that the app will use. You will select the provider,
25
- model, and embedding model (if applicable).
26
-
27
- 1. Optionally, you can set usage limits for the app. If you don't set limits,
28
- the app will use the limits for the team.
29
-
30
29
  1. Click **Create**
31
30
 
32
31
  </Stepper>
33
32
 
33
+ That's the whole dialog. The portal then takes you to the app's **Policies**
34
+ tab. If the app's team defines a [policy template](./policy-templates.mdx), the
35
+ new app starts with that chain; otherwise the chain is empty and the app is
36
+ unrestricted until you add policies.
37
+
38
+ ## Restricting models
39
+
40
+ By default an app isn't restricted to particular models: any model available
41
+ through the providers assigned to the app's [team](./teams.mdx) is accepted. An
42
+ unrestricted app has no default model, so every request must name one as
43
+ `providerName/model`. A request with no model, or a model without that prefix,
44
+ gets a `400`.
45
+
46
+ To limit an app to specific models, add the **Model Filtering** policy to the
47
+ app's [policy chain](./policy-chains.mdx)—models are controlled by that policy,
48
+ not by the app's settings. Open the app's **Policies** tab, add Model Filtering,
49
+ and configure each capability (completions, embeddings) in one of two modes:
50
+
51
+ - An **allow list** exposes a curated set of models. Only listed models are
52
+ accepted, and the first entry is the default when a request doesn't specify a
53
+ model.
54
+ - A **block list** permits every available model except the ones named. Each
55
+ request must name its model, because a block list supplies no default.
56
+
57
+ The two modes are mutually exclusive per capability: a capability takes an allow
58
+ list or a block list, never both.
59
+
60
+ | Request | Response |
61
+ | ---------------------------------------------------------------------------------------- | ----------------------------- |
62
+ | A model the rules don't allow | `403`, listing what's allowed |
63
+ | No `model` named, with no allow list to supply a default | `400` |
64
+ | A model with no `providerName/` prefix | `400` |
65
+ | A capability the policy doesn't configure at all | `403` |
66
+ | A provider name that isn't in the project's [provider catalog](./managing-providers.mdx) | `400` |
67
+
68
+ When model selection needs logic instead of a list, a custom policy can take
69
+ over—see [Dynamic model routing](./cookbooks/dynamic-model-routing.mdx).
70
+
71
+ ## Setting budgets
72
+
73
+ App budgets live on the **Budgets and Costs** policy in the app's chain. Open
74
+ the app's **Policies** tab and configure it with daily or monthly limits for
75
+ spending, tokens, or requests. If you don't set app limits, the team's and
76
+ gateway's limits still apply. See [Usage Limits](./usage-limits.mdx).
77
+
34
78
  ## Editing an App
35
79
 
36
80
  To edit an app, open the
37
81
  [Apps](https://portal.zuplo.com/+/account/project/ai/apps) tab of your AI
38
- Gateway project in the Zuplo Portal. Select the app you want to edit. Select the
39
- tab you want to edit (Policies or Settings). Make your changes and click the
40
- **Save** button.
82
+ Gateway project in the Zuplo Portal. Select the app you want to edit. The app's
83
+ behavior—models, budgets, caching, guardrails—is edited on the **Policies** tab;
84
+ the app's name lives on the **Settings** tab. Make your changes and click the
85
+ **Save** button. Policy chain changes apply within about a minute.
41
86
 
42
87
  ## Deleting an App
43
88
 
44
89
  To delete an app, open the
45
90
  [Apps](https://portal.zuplo.com/+/account/project/ai/apps) tab of your AI
46
- Gateway project in the Zuplo Portal. Select the app you want to delete and
47
- scroll to the bottom of the page and click the **Delete App** button. You will
48
- be prompted to confirm the deletion.
91
+ Gateway project in the Zuplo Portal. Select the app you want to delete, open its
92
+ **Settings** tab, and click the **Delete App** button. You will be prompted to
93
+ confirm the deletion.
@@ -1,11 +1,14 @@
1
1
  ---
2
2
  title: Managing AI Providers
3
3
  sidebar_label: Managing Providers
4
+ description:
5
+ Add, edit, and delete AI providers in your AI Gateway project, and understand
6
+ how provider names become model references and when changes deploy.
4
7
  ---
5
8
 
6
9
  Zuplo's AI Gateway supports integration with various
7
10
  [AI providers](./providers.mdx), allowing you to leverage different models and
8
- services for your AI applications.
11
+ services for your apps.
9
12
 
10
13
  ## Adding a New AI Provider
11
14
 
@@ -23,8 +26,11 @@ To add a new AI provider to your Zuplo AI Gateway, follow these steps:
23
26
  [supported providers](./providers.mdx), or
24
27
  [add a custom provider](./custom-providers.mdx).
25
28
 
26
- 1. Specify a label for the provider instance to easily identify it later. You
27
- can change the label later if required.
29
+ 1. Review the **Provider Name**, which fills in automatically based on the
30
+ provider you selected (a second OpenAI configuration becomes `openai-2`). You
31
+ can replace it with your own name, but only now—the name is permanent after
32
+ creation. Apps reference this provider's models as `providerName/model`—for
33
+ example, a provider named `openai` serves `openai/gpt-5-mini`.
28
34
 
29
35
  1. Enter the API Key for the selected provider. For instructions on how to
30
36
  create an API key for each provider see the
@@ -43,20 +49,30 @@ To add a new AI provider to your Zuplo AI Gateway, follow these steps:
43
49
 
44
50
  </Stepper>
45
51
 
52
+ :::note
53
+
54
+ Saving provider settings triggers an automatic production deployment of your
55
+ gateway, because provider credentials are part of the deployed gateway. The
56
+ change is live once the deployment completes.
57
+
58
+ :::
59
+
46
60
  ## Editing an AI Provider
47
61
 
48
62
  To modify an existing provider, open
49
63
  [**Settings → AI Providers**](https://portal.zuplo.com/+/account/project/ai/settings/data-models)
50
64
  and click the **Edit** button next to the provider you want to modify.
51
65
 
52
- You can modify the label, API key, and selected models for the provider. After
53
- making your changes, click **Save** to apply them. Changes are effective
54
- immediately.
66
+ You can modify the API key and selected models for the provider. The **Provider
67
+ Name** isn't editable: it's the routing address in every `providerName/model`
68
+ reference, so renaming it would orphan each stored reference to this provider.
69
+ After making your changes, click **Save** to apply them.
55
70
 
56
71
  :::caution
57
72
 
58
73
  Be careful removing models from a provider that's in use as it may break
59
- existing applications that rely on the provider.
74
+ existing apps that rely on the provider. Requests for a model that's no longer
75
+ available fail with an error naming the model.
60
76
 
61
77
  :::
62
78
 
@@ -1,13 +1,21 @@
1
1
  ---
2
2
  title: Managing Teams
3
+ description:
4
+ Create teams and sub-teams, add members, and set team-level policy templates
5
+ and usage limits in your AI Gateway project.
3
6
  ---
4
7
 
5
- Teams in the Zuplo AI Gateway are how users are granted access to AI Providers
6
- and Apps. Teams are hierarchical with access propagating downward. Teams are
7
- also where you define usage limits.
8
+ Teams in the Zuplo AI Gateway are how users are granted access to AI providers
9
+ and apps. Teams are hierarchical with access propagating downward. Teams are
10
+ also where you define usage limits and
11
+ [policy templates](./policy-templates.mdx).
8
12
 
9
13
  ## Creating a Team
10
14
 
15
+ Creating a team requires admin rights: on the project for a top-level team, or
16
+ on the parent team for a sub-team. Members without them see a disabled **Create
17
+ Team** button.
18
+
11
19
  <Stepper>
12
20
 
13
21
  1. Open the [Teams](https://portal.zuplo.com/+/account/project/ai/teams) tab of
@@ -21,10 +29,18 @@ also where you define usage limits.
21
29
 
22
30
  </Stepper>
23
31
 
32
+ After creating a team, use its tabs to configure it:
33
+
34
+ - **Policies**—the team's [policy template](./policy-templates.mdx), the
35
+ starting policy chain for apps created in the team.
36
+ - **Usage & Limits**—spending limits that apply to all of the team's apps
37
+ combined. See [Usage Limits](./usage-limits.mdx).
38
+ - **Members**—who belongs to the team.
39
+
24
40
  ## Adding Team Members
25
41
 
26
- Team members are the users who belong to a team and can access the AI Providers
27
- and Apps associated with that team.
42
+ Team members are the users who belong to a team and can access the AI providers
43
+ and apps associated with that team.
28
44
 
29
45
  <Stepper>
30
46
 
@@ -42,15 +58,16 @@ and Apps associated with that team.
42
58
  don't have an account, they will be invited to join the account and then
43
59
  added to the team.
44
60
 
45
- 1. Select the role for the user (if your plan supports RBAC). The available
46
- roles are:
47
- - **Member**: Can access AI Providers and Apps assigned to the team.
48
- - **Admin**: Can manage team settings, members, and access AI Providers and
49
- Apps assigned to the team.
61
+ 1. Select the role for the user:
62
+ - **Member**: Can access the AI providers and apps assigned to the team.
63
+ - **Admin**: Can manage team settings and members, and access the AI
64
+ providers and apps assigned to the team.
50
65
 
51
- :::note
66
+ :::caution{title="The Member role requires RBAC"}
52
67
 
53
- RBAC is an optional enterprise add-on. For more information see the
68
+ Role-based access control (RBAC) is an optional enterprise add-on on your
69
+ Zuplo account. Without it, only the **Admin** role is selectable—every user
70
+ you add to a team is an Admin. For more information see the
54
71
  [document on roles and permissions](../articles/accounts/roles-and-permissions.mdx).
55
72
 
56
73
  :::
@@ -1,125 +1,121 @@
1
1
  ---
2
2
  title: Akamai AI Firewall
3
3
  sidebar_label: Akamai AI Firewall
4
+ description:
5
+ Scan prompts and completions with Akamai Firewall for AI and block what your
6
+ Akamai configuration denies.
4
7
  ---
5
8
 
6
- The Akamai AI Firewall policy integrates
7
- [Akamai Firewall for AI](https://www.akamai.com/products/firewall-for-ai) with
8
- the Zuplo AI Gateway, providing enterprise-grade security for AI-powered
9
- applications, large language models (LLMs), and AI-driven APIs.
9
+ `akamai-ai-firewall-v2-inbound`
10
10
 
11
- The Akamai AI Firewall policy secures both inbound AI queries and outbound AI
12
- responses, protecting against emerging cyber threats specific to generative AI
13
- applications. By analyzing AI interactions in real-time, the policy detects and
14
- mitigates AI-specific vulnerabilities that traditional security tools can't
15
- address.
11
+ The Akamai AI Firewall policy sends an app's prompts and completions to
12
+ [Akamai Firewall for AI](https://www.akamai.com/products/firewall-for-ai) and
13
+ blocks a request or response that your Akamai configuration denies. It's the
14
+ gateway's guardrail policy: it can answer a request itself instead of letting it
15
+ reach the provider.
16
+
17
+ One entry covers both directions. The policy scans the prompt before the
18
+ provider call and the completion afterward, including streaming
19
+ responses—there's no separate outbound policy to add.
16
20
 
17
- ### Key Security Capabilities
21
+ Detection rules and their categories live in Akamai Control Center, not in
22
+ Zuplo. The policy forwards text and enforces the decision that comes back,
23
+ acting only on rules that deny. Rules set to alert are ignored.
18
24
 
19
- The Akamai AI Firewall provides comprehensive protection against AI-specific
20
- threats:
25
+ ## Adding the policy to an app
21
26
 
22
- - **Prompt injection defense**: Protects against attackers manipulating AI
23
- models through deceptive inputs
24
- - **Data loss prevention (DLP)**: Detects and blocks sensitive data leaks in
25
- AI-generated responses and incoming requests
26
- - **Toxic and harmful content filtering**: Flags hate speech, misinformation,
27
- and offensive content before delivery
28
- - **Adversarial AI security**: Protects against remote code execution, model
29
- back doors, and data poisoning attacks
30
- - **Denial-of-service mitigation**: Controls excessive query usage and model
31
- overload
27
+ <Stepper>
32
28
 
33
- ## Benefits with Zuplo AI Gateway
29
+ 1. In your gateway's repository, set the policy's credentials and push:
34
30
 
35
- Integrating Akamai AI Firewall with the Zuplo AI Gateway provides several
36
- advantages:
31
+ ```json title="config/policies.json"
32
+ {
33
+ "name": "akamai-ai-firewall-v2-inbound",
34
+ "policyType": "akamai-ai-firewall-v2-inbound",
35
+ "handler": {
36
+ "export": "AkamaiAIFirewallV2InboundPolicy",
37
+ "module": "$import(@zuplo/runtime)",
38
+ "options": {
39
+ "configurationId": "your-configuration-id",
40
+ "api-key": "your-akamai-api-key"
41
+ }
42
+ }
43
+ }
44
+ ```
37
45
 
38
- ### Unified Security Posture
46
+ 2. Open the app's **Policies** tab, click **Add Policy**, and add **Akamai AI
47
+ Firewall**. Leave the entry's options alone so it inherits the declaration's
48
+ configuration.
39
49
 
40
- Standardized AI security across your entire infrastructure, whether deployed at
41
- the edge, in the cloud, hybrid, or on-premises environments.
50
+ </Stepper>
42
51
 
43
- ### Automated Threat Detection
52
+ To protect every new app in a team, add the policy to the team's
53
+ [policy template](../policy-templates.mdx).
44
54
 
45
- AI-specific protections work automatically without manual rule tuning,
46
- leveraging Akamai's global threat intelligence to continuously adapt to emerging
47
- threats.
55
+ ## Options
48
56
 
49
- ### Seamless WAAP Integration
57
+ | Option | Default | What it does |
58
+ | --------------------------------------- | ---------- | ----------------------------------------------------------------------------------- |
59
+ | `configurationId` | — | Required. Your Akamai configuration |
60
+ | `api-key` | — | Required. Note the hyphen—`apiKey` is rejected |
61
+ | `applicationId` | — | Optional Akamai application identifier |
62
+ | `endpoints` | All shapes | Which API shapes to inspect |
63
+ | `onUnknownShape` | `deny` | What to do with a request shape the policy can't read |
64
+ | `streamingAccumulation.enabled` | `true` | Scan streaming completions. `false` stops scanning responses for streaming requests |
65
+ | `streamingAccumulation.eventsInterval` | `5` | How many streamed events to buffer between checks |
66
+ | `streamingAccumulation.checkIntervalMs` | none | Also check on a timer. Off unless set |
50
67
 
51
- Extends web application and API protection (WAAP) capabilities with AI-specific
52
- defenses, providing comprehensive security for your API gateway.
68
+ Unknown option keys are rejected.
53
69
 
54
- ### Compliance and Governance
70
+ ## What a blocked caller sees
55
71
 
56
- Helps meet security and compliance standards including data privacy regulations,
57
- ethical AI usage requirements, and corporate governance mandates through
58
- detailed audit logs and real-time security analytics.
72
+ A block returns `400` in the provider's own error format—not problem
73
+ details—with the Akamai rule ID in `code`:
59
74
 
60
- ### Zero Performance Impact
75
+ ```json
76
+ {
77
+ "error": {
78
+ "message": "Request blocked by AI Firewall during completion request. <rule message> (Rule: <ruleId>)",
79
+ "code": "<ruleId>"
80
+ }
81
+ }
82
+ ```
61
83
 
62
- The policy operates inline with minimal latency, preserving application
63
- performance while providing enterprise-grade security.
84
+ For a streaming response, the gateway withholds output until each check passes,
85
+ so blocked content never reaches the client. The stream then ends with a
86
+ content-filter stop rather than an HTTP error, so clients see a content-filter
87
+ finish reason. Holding events until a check returns adds to time to first token.
64
88
 
65
- ## How It Works
89
+ Blocked requests are counted against the app and appear in its Dashboard—see
90
+ [Monitoring usage](../usage-limits.mdx#monitoring-usage).
66
91
 
67
- ### AI Traffic Analysis
92
+ ## Failure modes
68
93
 
69
- The policy monitors and analyzes AI interactions by inspecting:
94
+ | Situation | Result |
95
+ | -------------------------------------------------------------- | ----------------------------------------- |
96
+ | Options are invalid or incomplete | Fails closed—request rejected |
97
+ | The request body can't be read | Fails closed—request rejected |
98
+ | An endpoint shape the policy can't inspect, such as embeddings | `400`, code `guardrail_uninspectable` |
99
+ | Akamai is unreachable, or returns an error | **Fails open**—traffic proceeds unguarded |
70
100
 
71
- 1. **Incoming user prompts**: Analyzed before reaching the AI model
72
- 2. **AI-generated outputs**: Inspected before delivery to end users
101
+ :::caution
73
102
 
74
- This dual-layer inspection prevents security risks while maintaining
75
- performance.
103
+ Because the policy fails open, an expired Akamai key silently disables the
104
+ firewall while the gateway keeps returning `200`s. Monitor blocked counts so a
105
+ sudden drop to zero doesn't go unnoticed.
76
106
 
77
- ### Risk Scoring
107
+ :::
78
108
 
79
- AI interactions are evaluated against multiple security indicators, including:
109
+ An endpoint the policy can't inspect is denied by default. That's different from
110
+ an endpoint you exclude with `endpoints`, which passes through silently. A
111
+ provider error response is never scanned.
112
+
113
+ If a request is rejected with a configuration error, the usual cause is a chain
114
+ entry that overrode `options` and dropped the credential—entry options replace
115
+ the declared ones wholesale rather than merging. Omit them to inherit. See
116
+ [Options and secrets](../policy-chains.mdx#options-and-secrets).
117
+
118
+ ## Additional resources
80
119
 
81
- - Prompt injection attempts
82
- - Sensitive data exposure
83
- - Adversarial exploits
84
- - Toxic content patterns
85
- - Abnormal query patterns
86
-
87
- ### Security Enforcement Actions
88
-
89
- Based on risk scores and configured policies, the firewall takes one of three
90
- actions:
91
-
92
- - **Monitor**: Logs detected threats for analysis without interfering with AI
93
- queries or responses
94
- - **Modify**: Adjusts AI-generated outputs inline, removing or altering unsafe
95
- content while maintaining natural conversation flow
96
- - **Deny**: Blocks high-risk inputs from reaching the AI model and prevents
97
- unsafe responses from being returned to users
98
-
99
- ## Use Cases
100
-
101
- ### Protecting Customer-Facing AI Chatbots
102
-
103
- Secure AI-powered customer service applications from prompt injection attacks
104
- and ensure responses don't leak sensitive customer data or generate toxic
105
- content.
106
-
107
- ### Safeguarding Internal AI Tools
108
-
109
- Protect internal AI assistants and copilots from adversarial exploits while
110
- preventing unauthorized access to proprietary information.
111
-
112
- ### Regulatory Compliance
113
-
114
- Maintain compliance with data protection regulations (GDPR, CCPA, etc.) by
115
- automatically detecting and blocking sensitive data leaks in AI interactions.
116
-
117
- ### API Security for AI Services
118
-
119
- Extend your API security posture to cover AI-specific threats that traditional
120
- API gateways can't detect.
121
-
122
- **Additional Resources**
123
-
124
- - [Akamai Firewall for AI Product Page](https://www.akamai.com/products/firewall-for-ai)
125
- - [Akamai AI Security Solutions](https://www.akamai.com/solutions/security/ai-security)
120
+ - [Akamai Firewall for AI](https://www.akamai.com/products/firewall-for-ai)
121
+ - [Akamai AI security solutions](https://www.akamai.com/solutions/security/ai-security)
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: API key authentication
3
+ sidebar_label: API key authentication
4
+ description:
5
+ Require an app's API key on every request and resolve the calling app from it.
6
+ ---
7
+
8
+ `ai-gateway-auth-v2`
9
+
10
+ Clients send the app's API key as a bearer token, and the gateway resolves the
11
+ calling app from the key. A missing or invalid key returns `401`. A valid key
12
+ whose app doesn't match the `{app_id}` in the URL returns `403`.
13
+
14
+ The policy applies per app: in an app's chain, it requires a key for that app
15
+ alone. A new team's [policy template](../policy-templates.mdx) includes it as a
16
+ locked entry, so apps created in the team require keys from the start. Placed on
17
+ the gateway's route instead—before the Configuration Executor, in the gateway's
18
+ repository—one entry requires a key for every app on that route.
19
+
20
+ ## Options
21
+
22
+ | Option | Default | What it does |
23
+ | ----------------- | --------------- | ----------------------------------------------------------------- |
24
+ | `cacheTtlSeconds` | `10` | How long the gateway caches a key check. `10` is also the minimum |
25
+ | `authHeader` | `Authorization` | The header to read the key from |
26
+ | `authScheme` | `Bearer` | The scheme prefix. Set it to `""` to use the raw header value |
27
+
28
+ For clients that send `x-api-key` instead of a bearer token, use
29
+ `{ "authHeader": "x-api-key", "authScheme": "" }`.
30
+
31
+ Because key checks are cached, a revoked key can keep working until the cache
32
+ expires.
33
+
34
+ :::caution{title="A gateway without this policy is open"}
35
+
36
+ When the policy sits neither on the route nor in an app's chain, the gateway
37
+ resolves the app from the `{app_id}` segment of the URL and serves the request
38
+ with no key at all. Anyone who knows the URL can spend against the app's
39
+ providers and budget. Only run an open gateway when something else, such as
40
+ network isolation, controls who can reach it.
41
+
42
+ :::
43
+
44
+ Each app's key appears on its app page—see [Apps](../apps.mdx).
@@ -1,6 +1,9 @@
1
1
  ---
2
- title: Comet Opik Tracing
3
- sidebar_label: Comet Opik Tracing
2
+ title: Comet Opik tracing
3
+ sidebar_label: Comet Opik tracing
4
+ description:
5
+ Send LLM traces from the Zuplo AI Gateway to Comet Opik for observability,
6
+ debugging, and evaluation of your AI applications.
4
7
  ---
5
8
 
6
9
  The Comet Opik Tracing policy integrates
@@ -30,6 +33,41 @@ features:
30
33
  - **High-volume ingestion**: Support for up to 40 million traces per day
31
34
  - **Dataset management**: Store and run evaluations on test datasets
32
35
 
36
+ ## Adding the policy to an app
37
+
38
+ The scaffolded gateway declares the Comet Opik Tracing policy in
39
+ `config/policies.json`. Configure it once for the gateway, then add it to each
40
+ app that should send traces:
41
+
42
+ <Stepper>
43
+
44
+ 1. In your Comet account, create (or pick) a project and workspace and generate
45
+ an API key.
46
+
47
+ 2. In your gateway's repository, set the policy's settings and push:
48
+
49
+ ```json title="config/policies.json"
50
+ {
51
+ "name": "comet-opik-tracing-v2-inbound",
52
+ "policyType": "comet-opik-tracing-v2-inbound",
53
+ "handler": {
54
+ "export": "CometOpikTracingV2InboundPolicy",
55
+ "module": "$import(@zuplo/runtime)",
56
+ "options": {
57
+ "apiKey": "your-opik-api-key",
58
+ "projectName": "your-project-name",
59
+ "workspace": "your-workspace"
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ 3. Open the app's **Policies** tab, click **Add Policy**, and add **Comet Opik
66
+ Tracing**. Place it at the end of the chain so traces reflect the request the
67
+ provider actually receives.
68
+
69
+ </Stepper>
70
+
33
71
  ## Benefits with Zuplo AI Gateway
34
72
 
35
73
  Integrating Comet Opik with the Zuplo AI Gateway provides several advantages:
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Fallback Model
3
+ sidebar_label: Fallback Model
4
+ description:
5
+ Add a backup model for provider errors and timeouts, and a cheaper model for
6
+ when a budget runs out.
7
+ ---
8
+
9
+ `ai-gateway-fallback-model-v2`
10
+
11
+ Fallback Model adds two kinds of backup to an app's model selection, per
12
+ capability:
13
+
14
+ - **`fallback`**—the model to try after a provider error that can be retried, or
15
+ after a timeout.
16
+ - **`quotaFallback`**—the model to use when a usage limit is hit, instead of
17
+ rejecting the request. [Budgets and Costs](./metering.mdx) is what applies
18
+ this.
19
+
20
+ `fallbackTimeoutSeconds` controls how long the gateway waits before giving up on
21
+ the main model and trying the fallback. It defaults to 60 seconds and accepts 1
22
+ to 300. A fallback that names the same model as the main one is skipped.
23
+
24
+ :::warning
25
+
26
+ This policy only enriches a model selection that already exists—it never creates
27
+ one. An app whose chain has Fallback Model but no
28
+ [Model Filtering](./model-filtering.mdx) does nothing at all: the policy logs a
29
+ warning and passes the request through unchanged. Place Fallback Model
30
+ immediately after Model Filtering.
31
+
32
+ :::
33
+
34
+ That ordering is also why a fallback can never widen what an app may reach—the
35
+ filter has already accepted or rejected the request by the time this policy
36
+ runs.
37
+
38
+ For the portal workflow and worked examples see
39
+ [Fallback Models](../fallback.mdx); for every option see the
40
+ [generated reference](/policies/ai-gateway-fallback-model-v2-inbound).