---
title: "Examples"
description:
  "Tutorials and templates to help you deploy a Zuplo API gateway in minutes,
  covering authentication, rate limiting, MCP servers, routing, caching, and
  more."
canonicalUrl: "https://zuplo.com/examples"
sourceUrl: "https://zuplo.com/examples"
pageType: "product"
generatedAt: "2026-04-22"
---

# Examples

> A curated library of 27 working Zuplo projects — starters, tutorials, and
> templates — covering authentication, rate limiting, routing, MCP servers,
> caching, validation, and more. Each example lives in the
> [zuplo/zuplo GitHub repo](https://github.com/zuplo/zuplo/tree/main/examples)
> and can be bootstrapped locally with `npx create-zuplo-api@latest`.

## Starter Examples

These three examples are the recommended starting points for new Zuplo projects.

### Basic API Gateway ⚡ Starter

**Slug:** `basic-api-gateway` | **Categories:** Authentication, Rate Limiting,
Validation

Protect your backend API with authentication, rate limiting, and request
validation. Demonstrates how to build a production-ready API gateway
declaratively without writing code. Proxies a sample Todo API and applies API
key auth, rate limiting, request validation, and request size limits.

- [View example](/examples/basic-api-gateway)
- [GitHub](https://github.com/zuplo/zuplo/tree/main/examples/basic-api-gateway)

---

### Remote MCP Server with OAuth ⚡ Starter

**Slug:** `remote-mcp-server-with-oauth` | **Categories:** MCP

Create a remote MCP Server that supports OAuth authentication via Auth0. Many
MCP consumers (like Claude Desktop) require remote MCP servers to authenticate
users via OAuth. Zuplo's built-in MCP support keeps the implementation simple.

- [View example](/examples/remote-mcp-server-with-oauth)
- [GitHub](https://github.com/zuplo/zuplo/tree/main/examples/remote-mcp-server-with-oauth)

---

### Dev Portal with API Keys ⚡ Starter

**Slug:** `dev-portal-with-api-keys` | **Categories:** Authentication

Let developers sign up and create their own API keys through a self-serve
portal. Adds end-to-end API key creation, rolling, and deletion to the Zuplo Dev
Portal via the API Keys settings tab.

- [View example](/examples/dev-portal-with-api-keys)
- [GitHub](https://github.com/zuplo/zuplo/tree/main/examples/dev-portal-with-api-keys)

---

## All Examples by Category

### Model Context Protocol (MCP)

| Example            | Description                                                                                                                                                                         | Link                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| Remote MCP Server  | Expose your API to AI assistants like Claude and ChatGPT with built-in security. Implements `/mcp` path, CRUD tools, API key auth, prompt injection detection, and secret masking.  | [/examples/remote-mcp-server](/examples/remote-mcp-server)                   |
| MCP Custom Tools   | Create AI tools that combine multiple API calls into a single action. Implements a Travel Advisor with a `plan-trip` tool aggregating weather, activities, and packing suggestions. | [/examples/mcp-server-custom-tools](/examples/mcp-server-custom-tools)       |
| GraphQL MCP Server | Make your GraphQL API available to AI assistants. Exposes `graphql_introspect` and `graphql_execute` tools using the Rick & Morty API as a demo.                                    | [/examples/mcp-server-graphql](/examples/mcp-server-graphql)                 |
| OpenAI App         | Build a ChatGPT App that connects to your API using MCP. Uses the OpenAI Apps SDK to render interactive GitHub profile stats widgets inside ChatGPT.                                | [/examples/mcp-server-openai-apps-sdk](/examples/mcp-server-openai-apps-sdk) |
| MCP Server Prompts | Improve AI assistant interactions by adding guided prompts to your MCP Server. Implements a Bookmark Manager with `list-bookmarks` tool and curated MCP prompts.                    | [/examples/mcp-server-prompts](/examples/mcp-server-prompts)                 |

### Routing

| Example                   | Description                                                                                                                                                                                 | Link                                                           |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Circuit Breaker           | Protect your backend from cascading failures by automatically blocking traffic when error rates exceed a threshold. Returns 503 immediately during open state; self-heals after a cooldown. | [/examples/circuit-breaker](/examples/circuit-breaker)         |
| HTTP Deprecation          | Signal deprecated endpoints and sunset dates with standards-based `Deprecation`, `Sunset`, and `Link` headers per RFC 8594.                                                                 | [/examples/http-deprecation](/examples/http-deprecation)       |
| Geolocation Routing       | Route requests to regional backends based on user location for data residency and latency optimization. Zuplo detects country at the edge and maps it to regional backends.                 | [/examples/geolocation-routing](/examples/geolocation-routing) |
| Canary Routing            | Gradually roll out new backend versions by routing a configurable percentage of traffic to canary. Supports user allow-lists and `x-stage` header overrides.                                | [/examples/canary-routing](/examples/canary-routing)           |
| Environment-Based Routing | Route requests to sandbox or production backends based on API key metadata — the same pattern used by Stripe for test vs. live keys.                                                        | [/examples/environment-routing](/examples/environment-routing) |

### Authentication & Authorization

| Example                         | Description                                                                                                                                                     | Link                                     |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| Backend for Frontend (BFF) Auth | Secure your web app by handling authentication server-side. Keeps tokens server-side and uses secure HTTP-only cookies, protecting against XSS and token theft. | [/examples/bff-auth](/examples/bff-auth) |
| OpenFGA Authorization           | Implement fine-grained authorization with relationship-based access control using OpenFGA from a custom Zuplo policy.                                           | [/examples/openfga](/examples/openfga)   |

### Rate Limiting

| Example              | Description                                                                                                                                                          | Link                                                           |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Dynamic Rate Limits  | Set different rate limits based on user subscription tier or API key metadata. Common pattern for tiered API access — free, pro, enterprise.                         | [/examples/dynamic-rate-limits](/examples/dynamic-rate-limits) |
| Custom Rate Limiting | Customize the error response users see when they hit your API rate limits. Intercepts the default 429 and adds rate limit config, remaining count, and retry timing. | [/examples/custom-429-response](/examples/custom-429-response) |

### Caching

| Example          | Description                                                                                                                                                                                                                 | Link                                                     |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Idempotency Keys | Prevent duplicate API requests and ensure safe retries for payments and critical operations using custom inbound and outbound policies.                                                                                     | [/examples/idempotency-keys](/examples/idempotency-keys) |
| Semantic Caching | Reduce AI API costs by caching responses for semantically similar queries. Uses Zuplo's Semantic Cache Policy so "What is the capital of France?" and "Tell me the capital city of France" return the same cached response. | [/examples/semantic-caching](/examples/semantic-caching) |

### Programmability & Customization

| Example                | Description                                                                                                                                                                   | Link                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| Log Request & Response | Debug API issues by capturing full request and response bodies in your logs. Uses the `OnResponseSendingFinal` runtime hook to register a global logging handler.             | [/examples/log-request-response](/examples/log-request-response) |
| Custom Modules         | Use npm packages and third-party libraries in your Zuplo handlers and policies. Requires connecting to source control and cloning the project locally.                        | [/examples/custom-module](/examples/custom-module)               |
| Rewrite Request Body   | Transform request bodies before forwarding to your backend API. Demonstrates how to rewrite incoming JSON request bodies in a custom policy.                                  | [/examples/rewrite-request-body](/examples/rewrite-request-body) |
| Route Custom Data      | Add custom metadata to routes and use it in your policies and handlers.                                                                                                       | [/examples/route-custom-data](/examples/route-custom-data)       |
| Custom Base Path       | Remove or rewrite URL paths when forwarding requests to your backend. Reads base path and backend server config from the OpenAPI `servers` object and applies it dynamically. | [/examples/oas-base-path](/examples/oas-base-path)               |

### Validation

| Example                          | Description                                                                                                                                                     | Link                                                                         |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| Schema Validation with File Refs | Validate requests against JSON schemas stored in separate files using `$ref`. Keeps route definitions clean and enables schema reuse across multiple endpoints. | [/examples/schema-validation-file-ref](/examples/schema-validation-file-ref) |

### API Governance

| Example     | Description                                                                                                                                                                                                                                        | Link                                           |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| API Linting | Enforce API design standards and consistency across your team with automated linting using [Vacuum](https://quobix.com/vacuum/). Includes built-in OpenAPI rules and Zuplo-specific custom rules (e.g., requiring certain policies on all routes). | [/examples/api-linting](/examples/api-linting) |

### Testing

| Example             | Description                                                                                                                                              | Link                                         |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| Mocking & Unit Test | Test your Zuplo handlers and policies with mocked `ZuploRequest` and `ZuploContext` objects. Uses Mocha and Sinon; concepts apply to any test framework. | [/examples/test-mocks](/examples/test-mocks) |

---

## Bootstrapping an Example Locally

Any example can be cloned into a new project with:

```bash
npx create-zuplo-api@latest my-api --example <slug>
```

For example:

```bash
npx create-zuplo-api@latest my-api --example basic-api-gateway
```

All examples are also available directly in the GitHub monorepo:

```
https://github.com/zuplo/zuplo/tree/main/examples/<slug>
```

## Next steps

- [Browse all examples on GitHub](https://github.com/zuplo/zuplo/tree/main/examples)
- [Read the Zuplo docs](https://zuplo.com/docs)
- [Start a free Zuplo account](https://portal.zuplo.com/signup)
