zuplo 7.8.7 → 7.8.8

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 (63) hide show
  1. package/docs/ai-gateway/custom-policies.mdx +2 -1
  2. package/docs/ai-gateway/usage-limits.mdx +2 -2
  3. package/docs/api-management/overview.md +2 -2
  4. package/docs/articles/add-api-to-backstage.mdx +4 -3
  5. package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +1 -1
  6. package/docs/articles/api-key-management.mdx +1 -1
  7. package/docs/articles/migrate-from-apigee.md +3 -3
  8. package/docs/articles/migrate-from-aws-api-gateway.md +3 -3
  9. package/docs/articles/migrate-from-azure-apim.md +3 -3
  10. package/docs/articles/migrate-from-kong.md +3 -3
  11. package/docs/articles/source-control-setup-github.mdx +2 -2
  12. package/docs/cli/create-zuplo-api.mdx +4 -4
  13. package/docs/cli/openapi-merge.mdx +1 -1
  14. package/docs/cli/openapi-merge.partial.mdx +1 -1
  15. package/docs/concepts/ai-gateway.mdx +1 -1
  16. package/docs/concepts/mcp.mdx +4 -4
  17. package/docs/dedicated/architecture.mdx +1 -1
  18. package/docs/errors/not-found.mdx +1 -1
  19. package/docs/getting-started/ai-gateway/portal.mdx +181 -0
  20. package/docs/getting-started/dev-portal/agent.mdx +148 -0
  21. package/docs/getting-started/dev-portal/index.mdx +26 -0
  22. package/docs/getting-started/dev-portal/local.mdx +213 -0
  23. package/docs/getting-started/dev-portal/portal.mdx +146 -0
  24. package/docs/{articles/step-3-add-api-key-auth.mdx → getting-started/gateway/add-api-key-auth/index.mdx} +30 -24
  25. package/docs/{articles/step-3-add-api-key-auth-local.mdx → getting-started/gateway/add-api-key-auth/local.mdx} +26 -21
  26. package/docs/{articles/step-2-add-rate-limiting.mdx → getting-started/gateway/add-rate-limiting/index.mdx} +20 -14
  27. package/docs/{articles/step-2-add-rate-limiting-local.mdx → getting-started/gateway/add-rate-limiting/local.mdx} +22 -15
  28. package/docs/getting-started/gateway/agent.mdx +198 -0
  29. package/docs/{articles/step-4-deploying-to-the-edge.mdx → getting-started/gateway/deploy-to-the-edge/index.mdx} +36 -27
  30. package/docs/{articles/step-4-deploying-to-the-edge-local.mdx → getting-started/gateway/deploy-to-the-edge/local.mdx} +46 -18
  31. package/docs/{articles/step-5-dynamic-rate-limiting.mdx → getting-started/gateway/dynamic-rate-limiting/index.mdx} +21 -12
  32. package/docs/{articles/step-5-dynamic-rate-limiting-local.mdx → getting-started/gateway/dynamic-rate-limiting/local.mdx} +21 -12
  33. package/docs/getting-started/gateway/index.mdx +24 -0
  34. package/docs/{articles/step-1-setup-basic-gateway.mdx → getting-started/gateway/setup-a-basic-gateway/index.mdx} +31 -22
  35. package/docs/{articles/step-1-setup-basic-gateway-local.mdx → getting-started/gateway/setup-a-basic-gateway/local.mdx} +22 -16
  36. package/docs/getting-started/index.mdx +25 -0
  37. package/docs/getting-started/mcp-gateway/agent.mdx +161 -0
  38. package/docs/getting-started/mcp-gateway/index.mdx +25 -0
  39. package/docs/{mcp-gateway/quickstart-local.mdx → getting-started/mcp-gateway/local.mdx} +35 -31
  40. package/docs/{mcp-gateway/quickstart.mdx → getting-started/mcp-gateway/portal.mdx} +64 -48
  41. package/docs/getting-started/mcp-server/agent.mdx +152 -0
  42. package/docs/getting-started/mcp-server/index.mdx +25 -0
  43. package/docs/{articles/mcp-quickstart-local.mdx → getting-started/mcp-server/local.mdx} +24 -13
  44. package/docs/{articles/mcp-quickstart.mdx → getting-started/mcp-server/portal.mdx} +35 -15
  45. package/docs/getting-started/migrate/agent.mdx +129 -0
  46. package/docs/getting-started/migrate/index.mdx +25 -0
  47. package/docs/getting-started/migrate/local.mdx +141 -0
  48. package/docs/getting-started/migrate/portal.mdx +129 -0
  49. package/docs/home.mdx +6 -0
  50. package/docs/mcp-gateway/connect-clients/chatgpt.mdx +2 -1
  51. package/docs/mcp-gateway/connect-clients/claude-code.mdx +2 -1
  52. package/docs/mcp-gateway/connect-clients/claude-desktop.mdx +2 -1
  53. package/docs/mcp-gateway/connect-clients/cursor.mdx +2 -1
  54. package/docs/mcp-gateway/connect-clients/vs-code.mdx +2 -1
  55. package/docs/mcp-gateway/how-it-works.mdx +2 -2
  56. package/docs/mcp-gateway/how-to/connect-upstream-api-key.mdx +4 -3
  57. package/docs/mcp-gateway/how-to/curate-tools.mdx +3 -2
  58. package/docs/mcp-gateway/overview.mdx +3 -3
  59. package/docs/policies/ai-gateway-smart-router-inbound/doc.md +14 -0
  60. package/docs/policies/akamai-ai-firewall-v2-inbound/doc.md +7 -0
  61. package/package.json +5 -5
  62. package/docs/ai-gateway/getting-started.mdx +0 -307
  63. package/docs/dev-portal/local-development.mdx +0 -72
@@ -22,7 +22,8 @@ terms. By the end, one app on your gateway rejects a prompt containing
22
22
  ## Prerequisites
23
23
 
24
24
  - An AI Gateway project connected to a Git repository, with a provider, a team,
25
- and an app—the [Getting Started](./getting-started.mdx) guide covers this
25
+ and an app—the [Getting Started](../getting-started/ai-gateway/portal.mdx)
26
+ guide covers this
26
27
  - A local clone of the gateway's repository
27
28
 
28
29
  <Stepper>
@@ -357,8 +357,8 @@ Each app, team, and the gateway show current usage against their limits:
357
357
 
358
358
  ## Related Resources
359
359
 
360
- - [Getting Started](./getting-started.mdx) - Set up your first AI Gateway
361
- project with budget controls
360
+ - [Getting Started](../getting-started/ai-gateway/portal.mdx) - Set up your
361
+ first AI Gateway project with budget controls
362
362
  - [Managing Teams](./managing-teams.mdx) - Configure team-level budgets
363
363
  - [Managing Apps](./managing-apps.mdx) - Configure app-level limits
364
364
  - [Fallback Models](./fallback.mdx) - Serve a cheaper model instead of blocking
@@ -11,8 +11,8 @@ designed for developers. It offers fast deployment, GitOps-friendly workflows,
11
11
  and unlimited environments. Whether you're an individual developer or part of an
12
12
  engineering team, Zuplo makes it easy to:
13
13
 
14
- - [Add authentication and access control](../articles/step-3-add-api-key-auth.mdx)
15
- - [Implement rate limiting](../articles/step-2-add-rate-limiting.mdx)
14
+ - [Add authentication and access control](../getting-started/gateway/add-api-key-auth/index.mdx)
15
+ - [Implement rate limiting](../getting-started/gateway/add-rate-limiting/index.mdx)
16
16
  - Write custom logic to run at the gateway layer
17
17
  - Build a [rich developer portal](../dev-portal/overview.mdx) with self-serve
18
18
  tools for auth and monetization
@@ -26,9 +26,10 @@ Add a new route with the path `/openapi`, and select the `OpenAPI Spec Handler`
26
26
  from the Request Handler selector. Save your changes and commit them to your
27
27
  production branch. If you haven't already connected your Zuplo API to a GitHub
28
28
  repository, you can follow
29
- [these instructions](./step-4-deploying-to-the-edge.mdx) to do so. Once your
30
- Zuplo API is redeployed, you should now be able to retrieve your public-ready
31
- OpenAPI file by hitting `https://<your-prod-zuplo-api-domain>/openapi`.
29
+ [these instructions](../getting-started/gateway/deploy-to-the-edge/index.mdx) to
30
+ do so. Once your Zuplo API is redeployed, you should now be able to retrieve
31
+ your public-ready OpenAPI file by hitting
32
+ `https://<your-prod-zuplo-api-domain>/openapi`.
32
33
 
33
34
  ![Zuplo route](../../public/media/add-api-to-backstage/image-3.png)
34
35
 
@@ -23,7 +23,7 @@ managers), see [Manage Keys in the Portal](./api-key-administration.mdx).
23
23
  ## Prerequisites
24
24
 
25
25
  - A Zuplo project with at least one deployed environment (see the
26
- [getting started tutorial](./step-1-setup-basic-gateway.mdx))
26
+ [getting started tutorial](../getting-started/gateway/setup-a-basic-gateway/index.mdx))
27
27
  - The [API Key Authentication policy](../policies/api-key-inbound.mdx)
28
28
  configured on your routes
29
29
  - Permission to manage API key consumers in your project
@@ -11,7 +11,7 @@ your backend.
11
11
  :::tip
12
12
 
13
13
  To start using Zuplo API Keys in only a few minutes
14
- [see the quickstart](../articles/step-3-add-api-key-auth.mdx).
14
+ [see the quickstart](../getting-started/gateway/add-api-key-auth/index.mdx).
15
15
 
16
16
  :::
17
17
 
@@ -401,8 +401,8 @@ between both gateways.
401
401
 
402
402
  ## Next steps
403
403
 
404
- - [Set up your first Zuplo gateway](./step-1-setup-basic-gateway.md)
405
- - [Add rate limiting](./step-2-add-rate-limiting.md)
406
- - [Add API key authentication](./step-3-add-api-key-auth.md)
404
+ - [Set up your first Zuplo gateway](../getting-started/gateway/setup-a-basic-gateway/index.mdx)
405
+ - [Add rate limiting](../getting-started/gateway/add-rate-limiting/index.mdx)
406
+ - [Add API key authentication](../getting-started/gateway/add-api-key-auth/index.mdx)
407
407
  - [Configure your developer portal](../dev-portal/overview.mdx)
408
408
  - [Set up source control](./source-control.md)
@@ -241,8 +241,8 @@ secrets to secure the connection between Zuplo and your AWS backends.
241
241
 
242
242
  ## Next steps
243
243
 
244
- - [Set up your first Zuplo gateway](./step-1-setup-basic-gateway.md)
245
- - [Add rate limiting](./step-2-add-rate-limiting.md)
246
- - [Add API key authentication](./step-3-add-api-key-auth.md)
244
+ - [Set up your first Zuplo gateway](../getting-started/gateway/setup-a-basic-gateway/index.mdx)
245
+ - [Add rate limiting](../getting-started/gateway/add-rate-limiting/index.mdx)
246
+ - [Add API key authentication](../getting-started/gateway/add-api-key-auth/index.mdx)
247
247
  - [Configure your developer portal](../dev-portal/overview.mdx)
248
248
  - [Set up source control](./source-control.md)
@@ -285,8 +285,8 @@ connection between Zuplo and your Azure backends.
285
285
 
286
286
  ## Next steps
287
287
 
288
- - [Set up your first Zuplo gateway](./step-1-setup-basic-gateway.md)
289
- - [Add rate limiting](./step-2-add-rate-limiting.md)
290
- - [Add API key authentication](./step-3-add-api-key-auth.md)
288
+ - [Set up your first Zuplo gateway](../getting-started/gateway/setup-a-basic-gateway/index.mdx)
289
+ - [Add rate limiting](../getting-started/gateway/add-rate-limiting/index.mdx)
290
+ - [Add API key authentication](../getting-started/gateway/add-api-key-auth/index.mdx)
291
291
  - [Configure your developer portal](../dev-portal/overview.mdx)
292
292
  - [Set up source control](./source-control.md)
@@ -293,8 +293,8 @@ configuration-as-code. Zuplo takes this further with native GitOps:
293
293
 
294
294
  ## Next steps
295
295
 
296
- - [Set up your first Zuplo gateway](./step-1-setup-basic-gateway.md)
297
- - [Add rate limiting](./step-2-add-rate-limiting.md)
298
- - [Add API key authentication](./step-3-add-api-key-auth.md)
296
+ - [Set up your first Zuplo gateway](../getting-started/gateway/setup-a-basic-gateway/index.mdx)
297
+ - [Add rate limiting](../getting-started/gateway/add-rate-limiting/index.mdx)
298
+ - [Add API key authentication](../getting-started/gateway/add-api-key-auth/index.mdx)
299
299
  - [Configure your developer portal](../dev-portal/overview.mdx)
300
300
  - [Set up source control](./source-control.md)
@@ -11,8 +11,8 @@ configuration required.
11
11
 
12
12
  This guide assumes you have a Zuplo project created. If you don't have one yet,
13
13
  follow the steps in
14
- [Step 1 - Setup a Basic Gateway](./step-1-setup-basic-gateway.mdx) to create a
15
- new Zuplo project.
14
+ [Step 1 - Setup a Basic Gateway](../getting-started/gateway/setup-a-basic-gateway/index.mdx)
15
+ to create a new Zuplo project.
16
16
 
17
17
  <Stepper>
18
18
 
@@ -42,7 +42,7 @@ npx create-zuplo-api@latest
42
42
  (`claude`, `copilot`, `cursor`, `windsurf`, `codex`), or `none` to skip agent
43
43
  setup. See [Configuring AI coding agents](#configuring-ai-coding-agents)
44
44
  - `--template <template-name>` - A built-in template to bootstrap the API with
45
- (`default`, `default-empty`, or `ai-gateway-v2`). Can't be combined with
45
+ (`default`, `default-empty`, or `ai-gateway`). Can't be combined with
46
46
  `--example` or `--empty`. See [Choosing a template](#choosing-a-template)
47
47
  - `-e, --example <example-name|github-url>` - An example to bootstrap the API
48
48
  with. You can use an example name from the official Zuplo repository or a
@@ -88,18 +88,18 @@ flag you get the `default` template.
88
88
  | --------------- | --------------------------------------------------------------------------------------------- |
89
89
  | `default` | Sample `/todos` routes, a `hello-world` module, a dev portal in `docs/`, and VS Code settings |
90
90
  | `default-empty` | The same project with no routes defined and no VS Code settings |
91
- | `ai-gateway-v2` | An [AI Gateway](../ai-gateway/overview.mdx) project, without a dev portal |
91
+ | `ai-gateway` | An [AI Gateway](../ai-gateway/overview.mdx) project, without a dev portal |
92
92
 
93
93
  `--empty` is shorthand for `--template default-empty`.
94
94
 
95
- The `ai-gateway-v2` template scaffolds `config/ai.oas.json`, which routes
95
+ The `ai-gateway` template scaffolds `config/ai.oas.json`, which routes
96
96
  `/:app_id/v1/*` to the AI Gateway handler, and `config/policies.json`, which
97
97
  declares the policies an application's policy chain can select. It ships no
98
98
  `docs/` directory, so the CLI skips the
99
99
  [dev portal](../dev-portal/overview.mdx) workspace:
100
100
 
101
101
  ```bash
102
- npx create-zuplo-api@latest my-gateway --template ai-gateway-v2
102
+ npx create-zuplo-api@latest my-gateway --template ai-gateway
103
103
  ```
104
104
 
105
105
  `--template` names a built-in template, which is why it can't be combined with
@@ -125,7 +125,7 @@ To rename the destination file, use the `--destination` option.
125
125
  ```bash
126
126
  zuplo openapi merge \
127
127
  --source https://example.com/path/to/openapi.json \
128
- --destination new-name
128
+ --destination ./config/new-name.oas.json
129
129
  ```
130
130
 
131
131
  </CliCommand>
@@ -25,5 +25,5 @@ To rename the destination file, use the `--destination` option.
25
25
  ```bash
26
26
  zuplo openapi merge \
27
27
  --source https://example.com/path/to/openapi.json \
28
- --destination new-name
28
+ --destination ./config/new-name.oas.json
29
29
  ```
@@ -64,7 +64,7 @@ are the same ones described in [How Zuplo Works](./how-zuplo-works.mdx).
64
64
 
65
65
  ## Next steps
66
66
 
67
- - [Get started with the AI Gateway](../ai-gateway/getting-started.mdx)
67
+ - [Get started with the AI Gateway](../getting-started/ai-gateway/portal.mdx)
68
68
  - [Browse the SDK integrations](../ai-gateway/integrations/openai.mdx) for
69
69
  OpenAI, the Vercel AI SDK, LangChain, Claude Code, Codex, and Goose
70
70
  - Explore the [AI Gateway policies](../ai-gateway/policies/overview.mdx)
@@ -55,9 +55,9 @@ apply to any other route.
55
55
 
56
56
  ## Next steps
57
57
 
58
- - [MCP Gateway quickstart](../mcp-gateway/quickstart.mdx) — expose an upstream
59
- MCP server and connect Claude Desktop
60
- - [MCP quickstart for the MCP Server handler](../articles/mcp-quickstart.mdx) —
61
- turn an API into MCP tools
58
+ - [MCP Gateway quickstart](../getting-started/mcp-gateway/portal.mdx) — expose
59
+ an upstream MCP server and connect Claude Desktop
60
+ - [MCP quickstart for the MCP Server handler](../getting-started/mcp-server/portal.mdx)
61
+ — turn an API into MCP tools
62
62
  - [Connect MCP clients](../mcp-gateway/connect-clients/overview.mdx) — Claude,
63
63
  ChatGPT, Cursor, VS Code, and others
@@ -19,7 +19,7 @@ A managed dedicated instance of Zuplo consists of the following components:
19
19
  authorization, rate limiting, and other features.
20
20
  - **Gateway Services**: Zuplo, being a highly distributed gateway, uses services
21
21
  to facilitate features such as
22
- [Rate Limiting](../articles/step-2-add-rate-limiting.mdx) and
22
+ [Rate Limiting](../getting-started/gateway/add-rate-limiting/index.mdx) and
23
23
  [API Key Authentication](../articles/api-key-management.mdx).
24
24
  - **Control Plane**: The Control Plane manages the configuration of the Zuplo
25
25
  Gateway. It deploys new configurations, manages the lifecycle of the Zuplo
@@ -40,4 +40,4 @@ response when no route matches. See
40
40
  ## Related resources
41
41
 
42
42
  - [Routes Designer](../articles/local-development-routes-designer.mdx)
43
- - [Deploying to the Edge](../articles/step-4-deploying-to-the-edge.mdx)
43
+ - [Deploying to the Edge](../getting-started/gateway/deploy-to-the-edge/index.mdx)
@@ -0,0 +1,181 @@
1
+ ---
2
+ category: AI Gateway
3
+ showLastModified: false
4
+ suggestEdit: false
5
+ sidebar_label: Portal
6
+ title: Getting Started with AI Gateway - Portal
7
+ description:
8
+ Create an AI Gateway in the Portal, try the free demo model, and send an
9
+ authenticated chat request with cURL or the OpenAI SDK.
10
+ ---
11
+
12
+ <WizardSteps build="ai-gateway" method="portal" />
13
+
14
+ Create an AI Gateway, send a chat request through it, and connect an OpenAI SDK
15
+ client. This tutorial uses the free Zuplo Demo provider, so you don't need a
16
+ provider API key.
17
+
18
+ ## Prerequisites
19
+
20
+ - A [Zuplo account](https://portal.zuplo.com).
21
+ - A terminal with cURL to test the gateway from outside the Portal.
22
+
23
+ ## Create and test your AI Gateway
24
+
25
+ <Stepper>
26
+
27
+ 1. **Create an AI Gateway project**
28
+
29
+ Open [**Projects**](https://portal.zuplo.com/+/account/projects), click **New
30
+ Project**, and select **AI Gateway**. Name the project `my-ai-gateway` and
31
+ click **Create Project**.
32
+
33
+ <ModalScreenshot>
34
+
35
+ ![New project dialog with AI Gateway selected](/media/ai-gateway-getting-started/create-project.png)
36
+
37
+ </ModalScreenshot>
38
+
39
+ When setup finishes, the project opens with **Create your first app**. The
40
+ gateway is already deployed.
41
+
42
+ 2. **Check the demo provider**
43
+
44
+ Open
45
+ [**Settings → AI Providers**](https://portal.zuplo.com/+/account/project/ai/settings/data-models).
46
+ The new project includes **Zuplo Demo**, which provides test models without a
47
+ provider API key. This tutorial uses `zuplodemo/pirate`.
48
+
49
+ <ModalScreenshot>
50
+
51
+ ![AI provider settings with the Zuplo Demo provider](/media/ai-gateway-getting-started/providers.png)
52
+
53
+ </ModalScreenshot>
54
+
55
+ The part before `/` names the provider; the part after `/` names the model.
56
+ Later, use **Add Provider** to configure your own provider and its models.
57
+ See [AI Providers](../../ai-gateway/providers.mdx).
58
+
59
+ 3. **Create an app**
60
+
61
+ Open [**Apps**](https://portal.zuplo.com/+/account/project/ai/apps) and click
62
+ **Create App**. Enter `Tutorial app` as the **App name**. Keep the
63
+ **Default** pool selected and click **Create app**.
64
+
65
+ <ModalScreenshot>
66
+
67
+ ![New app dialog with an app name and the Default pool](/media/ai-gateway-getting-started/create-app.png)
68
+
69
+ </ModalScreenshot>
70
+
71
+ An app represents the software that calls your gateway. Each app has its own
72
+ URL and API key. The first app also creates the Default pool, which groups
73
+ apps and supplies shared policy settings.
74
+
75
+ 4. **Review authentication**
76
+
77
+ Open the app's **Policies** tab. The new app inherits **API Key
78
+ Authentication** from its pool. Keep this policy in place: requests must send
79
+ the app's key in the `Authorization` header.
80
+
81
+ <ModalScreenshot>
82
+
83
+ ![App policy chain with inherited API Key Authentication](/media/ai-gateway-getting-started/policies.png)
84
+
85
+ </ModalScreenshot>
86
+
87
+ You can add policies for model filtering, budgets, and other controls here.
88
+ For this first request, keep the default chain. See
89
+ [Policy Chains](../../ai-gateway/policy-chains.mdx).
90
+
91
+ 5. **Send a request in the Playground**
92
+
93
+ Click **Playground** in the app header. Select `zuplodemo/pirate`, enter
94
+ `Say hello`, and send the message. A pirate-themed reply confirms that the
95
+ app can reach the provider through the gateway.
96
+
97
+ <ModalScreenshot>
98
+
99
+ ![AI Playground showing a successful response from the pirate demo model](/media/ai-gateway-getting-started/playground.png)
100
+
101
+ </ModalScreenshot>
102
+
103
+ 6. **Call the gateway from a terminal**
104
+
105
+ In the **Playground**, click **Copy cURL**. Paste the copied command into
106
+ your terminal and run it. The command includes the selected model, your
107
+ conversation, and the app's API key. The response streams into the terminal
108
+ as it arrives.
109
+
110
+ Treat the copied command as a credential because it contains your API key.
111
+
112
+ </Stepper>
113
+
114
+ ## Connect the OpenAI SDK
115
+
116
+ Copy **API URL** from the app header and the app's key from its **API Key** tab.
117
+ The URL includes the app ID after the hostname. Copy the complete URL without
118
+ adding `/v1` yet.
119
+
120
+ <ModalScreenshot>
121
+
122
+ ![App API Key tab with the key concealed](/media/ai-gateway-getting-started/api-key.png)
123
+
124
+ </ModalScreenshot>
125
+
126
+ Set these values in your terminal, replacing the placeholders:
127
+
128
+ ```bash
129
+ export ZUPLO_APP_URL="https://YOUR_GATEWAY.zuplo.app/YOUR_APP_ID"
130
+ export ZUPLO_APP_API_KEY="YOUR_APP_API_KEY"
131
+ ```
132
+
133
+ With Node.js 24 or later installed, create a directory for the sample and
134
+ install the SDK in the same terminal:
135
+
136
+ ```bash
137
+ mkdir ai-gateway-client
138
+ cd ai-gateway-client
139
+ npm init -y
140
+ npm install openai
141
+ ```
142
+
143
+ Save this as `sample.mjs` and run `node sample.mjs` from the terminal where you
144
+ set the environment variables:
145
+
146
+ ```javascript title="sample.mjs"
147
+ import OpenAI from "openai";
148
+
149
+ const client = new OpenAI({
150
+ baseURL: `${process.env.ZUPLO_APP_URL}/v1`,
151
+ apiKey: process.env.ZUPLO_APP_API_KEY,
152
+ });
153
+
154
+ const result = await client.chat.completions.create({
155
+ model: "zuplodemo/pirate",
156
+ messages: [{ role: "user", content: "Say hello" }],
157
+ });
158
+
159
+ console.log(result.choices[0].message.content);
160
+ ```
161
+
162
+ The OpenAI SDK uses the app URL with `/v1` appended. It sends the app key to
163
+ Zuplo; provider credentials stay in the gateway. See the
164
+ [OpenAI SDK integration](../../ai-gateway/integrations/openai.mdx) for more
165
+ examples.
166
+
167
+ ## Troubleshooting
168
+
169
+ | Result | What to check |
170
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------- |
171
+ | `401 Unauthorized` | Use the app's API key, not a provider key. Include the `Bearer` prefix. |
172
+ | `404` | Copy the complete app URL, including its app ID, then append `/v1/chat/completions`. |
173
+ | Model not found or not allowed | Use `zuplodemo/pirate` and confirm Zuplo Demo is enabled. If you added Model Filtering, allow this model. |
174
+
175
+ ## Next steps
176
+
177
+ - [Add providers](../../ai-gateway/providers.mdx) to connect your own models.
178
+ - [Configure policy chains](../../ai-gateway/policy-chains.mdx) to restrict
179
+ models or add budgets and guardrails.
180
+ - [Connect source control](../../ai-gateway/source-control.mdx) to deploy code
181
+ changes from Git.
@@ -0,0 +1,148 @@
1
+ ---
2
+ category: Developer Portal
3
+ showLastModified: false
4
+ suggestEdit: false
5
+ sidebar_label: Agent
6
+ title: Getting Started with Developer Portal - Agent
7
+ description:
8
+ Build a developer portal with a coding agent, review its API key
9
+ configuration, and verify a signed-in request from the API playground.
10
+ ---
11
+
12
+ <WizardSteps build="dev-portal" method="agent" />
13
+
14
+ <MethodTabs build="dev-portal" method="agent" />
15
+
16
+ Have a coding agent build a developer portal with an introduction, interactive
17
+ API reference, and API key management. You'll assign a test key and verify the
18
+ portal yourself.
19
+
20
+ ## Prerequisites
21
+
22
+ - [Node.js](https://nodejs.org/en/download) 24 or later and Git.
23
+ - A [Zuplo account](https://portal.zuplo.com).
24
+ - An installed coding agent and an email address for the portal sign-in test.
25
+
26
+ ## Build your developer portal with an agent
27
+
28
+ <Stepper>
29
+
30
+ 1. **Create the project**
31
+
32
+ Run:
33
+
34
+ ```bash
35
+ npx create-zuplo-api@latest my-api-project
36
+ cd my-api-project
37
+ ```
38
+
39
+ When prompted, choose **Yes** to create a matching Portal project, complete
40
+ sign-in, and select your Zuplo account. Select the coding agent you use when
41
+ asked. The CLI creates and links the hosted project. See
42
+ [`create-zuplo-api`](../../cli/create-zuplo-api.mdx).
43
+
44
+ :::tip{title="Zuplo skills"}
45
+
46
+ The scaffold installs Zuplo skills in this project for Codex and Cursor and
47
+ configures the Claude Code plugin. If setup fails, follow
48
+ [Agent Skills](../../build-with-ai.mdx#agent-skills) from this directory
49
+ before starting your agent.
50
+
51
+ :::
52
+
53
+ 2. **Ask the agent to build the portal**
54
+
55
+ Open your agent in the project directory and give it this prompt:
56
+
57
+ ```text
58
+ Read the project instructions and bundled Zuplo docs. Customize the default
59
+ developer portal for a Todo API. Keep the generated project structure.
60
+
61
+ In docs/zudoku.config.tsx, set site.title and metadata.title to
62
+ "Todo Developer Portal" and metadata.description to
63
+ "Explore the Todo API and manage your API keys." Keep the API reference
64
+ sourced from ../config/routes.oas.json at /api. Keep demo authentication
65
+ and apiKeys.enabled for this tutorial.
66
+
67
+ Replace docs/pages/introduction.mdx with a short introduction telling users
68
+ to sign in, find their assigned key under their profile's API Keys menu,
69
+ and try Get all todos in API Reference. Keep it in navigation. Explain
70
+ that an administrator assigns a consumer to the user's key manager email;
71
+ do not implement automatic provisioning.
72
+
73
+ In config/policies.json add api-key-auth, policyType api-key-inbound,
74
+ using ApiKeyInboundPolicy from $import(@zuplo/runtime) with
75
+ allowUnauthenticatedRequests false. Put it first in the inbound chain for
76
+ GET /todos in config/routes.oas.json. Preserve the existing URL forward
77
+ handler. Set this route's corsPolicy to anything-goes for the browser demo.
78
+ Update info.description so it says GET /todos requires a bearer API key.
79
+ Do not claim the other sample routes are protected.
80
+
81
+ Ensure .env and .env.zuplo are ignored and do not read or print credentials.
82
+ Run npm run dev. Report the gateway and Docs Server URLs. Verify GET /todos
83
+ without a key returns 401. Do not deploy; show me the diff and explain how
84
+ to finish the signed-in browser test with a Dev consumer.
85
+ ```
86
+
87
+ 3. **Review and open the result**
88
+
89
+ Review `git diff`. Confirm the reference still points to
90
+ `../config/routes.oas.json`, API keys remain enabled, and authentication is
91
+ attached to `GET /todos`.
92
+
93
+ With `npm run dev` running, open the **Docs Server** URL printed in the
94
+ terminal, normally `http://localhost:9200`. Open `/introduction` to check
95
+ your new page, then open **API Reference** to check the Todo API.
96
+
97
+ 4. **Assign a test key**
98
+
99
+ In the Zuplo Portal, open your project and go to
100
+ [**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services).
101
+ Select **Dev** and click **Create Consumer**. Enter `tutorial-consumer` for
102
+ **Subject**, your email under **Key managers**, and `{}` for **Metadata**.
103
+ Click **Save consumer**.
104
+
105
+ <ModalScreenshot>
106
+
107
+ ![Create a consumer and assign a key manager email](/media/api-key-consumer-bucket-portal-ui/create-consumer-modal.png)
108
+
109
+ </ModalScreenshot>
110
+
111
+ 5. **Verify the signed-in experience**
112
+
113
+ Sign in to the local developer portal with the key manager email. Open **API
114
+ Keys** from your profile menu and confirm the key appears. Then open **API
115
+ Reference → Get all todos**, click **Test**, expand **Authentication**,
116
+ select `tutorial-consumer`, and click **Send**. Expect `200 OK` and todos in
117
+ the response.
118
+
119
+ Test without credentials in a terminal:
120
+
121
+ ```bash
122
+ curl -i http://localhost:9000/todos
123
+ ```
124
+
125
+ Expect `401 Unauthorized`. If browser requests fail while cURL succeeds,
126
+ check the route's [CORS configuration](../../articles/cors.mdx). If the key
127
+ is missing, check the consumer's email and Dev bucket.
128
+
129
+ 6. **Publish after review**
130
+
131
+ Follow [Deploy to the edge](../gateway/deploy-to-the-edge/local.mdx), then
132
+ open **Deployment URLs → Dev Portal** in the Zuplo Portal. Create a consumer
133
+ in the **Prod** bucket to test the deployed portal.
134
+
135
+ Replace the demo authentication with your own
136
+ [identity provider](../../dev-portal/zudoku/configuration/authentication.md)
137
+ and restrict CORS to your portal's origin before inviting users.
138
+
139
+ </Stepper>
140
+
141
+ ## Next steps
142
+
143
+ - [Editor tutorial](./local.mdx) for the exact policy configuration and manual
144
+ walkthrough.
145
+ - [Create consumers on login](../../dev-portal/dev-portal-create-consumer-on-auth.mdx)
146
+ to automate key assignment with your own identity provider.
147
+ - [Customize navigation](../../dev-portal/zudoku/configuration/navigation.mdx)
148
+ and add pages for your API's users.
@@ -0,0 +1,26 @@
1
+ ---
2
+ category: Developer Portal
3
+ fullWidth: true
4
+ disablePager: true
5
+ showLastModified: false
6
+ suggestEdit: false
7
+ centered: false
8
+ toc: false
9
+ title: Getting Started with Developer Portal
10
+ description:
11
+ Publish docs and self-serve API keys with Zudoku with Zuplo, in the Portal,
12
+ locally with the CLI, or with an AI agent.
13
+ ---
14
+
15
+ <WizardSteps build="dev-portal" />
16
+
17
+ A developer portal gives your API's users a place to read documentation, sign
18
+ in, and test requests. This tutorial creates a portal with Zudoku, Zuplo's
19
+ open-source documentation framework, using a sample Todo API.
20
+
21
+ Choose a workflow to publish the reference docs and connect API key management.
22
+ You assign a key to a consumer (the person or application calling your API),
23
+ then sign in to test it. You need an email address you can access for the
24
+ sign-in step.
25
+
26
+ <MethodPicker build="dev-portal" />