Docs

Quickstart

Deploy a Zuplo gateway in under five minutes. Define a route, add rate limiting, and send a live request through the gateway.

1

Install the CLI

Install the CLI with npm.

terminal
npm install -g @zuplo/cli
2

Initialize a project

Run zuplo init to scaffold a gateway project with its directory structure and minimal routes.json.

terminal
zuplo init my-gateway
cd my-gateway

Your project structure will look like this:

project structure
my-gateway/
  routes.json          # route + policy declarations
  zuplo.env.json       # environment-specific config
  modules/             # custom handler modules (optional)
3

Define a route

Open routes.json and add a route that proxies to an upstream with a rate-limiting policy.

routes.json
{
  "routes": [
    {
      "path": "/v1/chat/completions",
      "methods": ["POST"],
      "upstream": "https://api.openai.com/v1/chat/completions",
      "policies": {
        "inbound": [
          {
            "name": "api-key-auth",
            "policyType": "api-key-inbound"
          },
          {
            "name": "rate-limit",
            "policyType": "rate-limit-inbound",
            "options": {
              "rateLimitBy": "consumer",
              "requestsPerWindow": 60,
              "windowSizeInSeconds": 60
            }
          }
        ]
      }
    }
  ]
}
4

Deploy

Deploy with zuplo deploy --env production.

terminal
zuplo deploy --env production

# Output:
Deploying to https://my-gateway.zuplo.dev ... done
Gateway live in 12s
5

Send a request

Test with curl using your API key in the Authorization header. The gateway validates the key, applies rate limiting, and forwards the request.

terminal
curl https://my-gateway.zuplo.dev/v1/chat/completions \
  -H "Authorization: Bearer zpk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

A 200 response means the gateway works. A 429 means the rate limit was hit.