ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Getting Started
    Develop in the portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingDynamic MCP Server - Quickstart
    Develop locally with the CLI
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingDynamic MCP Server - Quickstart
Concepts
API Management
AI Gateway
    OverviewGetting StartedSource ControlUniversal API
    Providers
    Teams
    Apps
    Policies
    Cookbooks
    Integrations
MCP Gateway
MCP Server
Developer Portal
Development
Deploying & Source Control
Analytics
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsVersion Support PolicySecuritySupportTrust & ComplianceChangelog
powered by Zuplo
AI Gateway

AI Gateway Source Control

An AI Gateway is a Zuplo project configured for AI traffic. A new project deploys automatically, so you can configure providers, teams, and apps without connecting a Git repository. Connect one when you want to write custom policies, review gateway changes in Git, or deploy from your own CI/CD.

The repository contains the gateway's routes and policy declarations. Custom policies are plain TypeScript files you commit alongside them.

Connect a repository

Zuplo supports GitHub, GitLab, Bitbucket, and Azure DevOps—see Source Control and Deployment for what each provider supports.

Open Settings → Source Control and choose one of the following:

  • Create New Repo starts a new repository with the name prefilled. With GitHub, this opens GitHub directly; create the repository, then return to the portal to connect it.
  • Connect an existing repository. Use an empty one so the gateway's source has the repository to itself.

When you connect, Zuplo adds the gateway's source to the repository and pushes it. The first push rebuilds production from that source. After that, with GitHub, pushes to your default branch deploy to production.

Until you connect a repository, production runs the gateway template Zuplo deploys at project creation. Connecting a repository doesn't replace that production URL; the first source deploy reuses it.

To work with the source locally, clone the repository:

TerminalCode
git clone https://github.com/GITHUB_ORG/REPO_NAME.git

Replace GITHUB_ORG with your GitHub organization or user, and REPO_NAME with the repository name.

If your default branch requires pull requests, Zuplo pushes the gateway source to a setup branch and surfaces a pull request for you to merge. The project finishes connecting once the pull request lands on the default branch.

What the repository contains

The scaffolded gateway is a small, readable Zuplo project:

FilePurpose
config/ai.oas.jsonThe gateway's route, which the AI Gateway handler serves
config/policies.jsonThe menu of policies apps can add to their policy chains
zuplo.jsoncProject configuration
env.exampleExample environment variables
tsconfig.jsonTypeScript configuration for custom policy modules

Add custom policy modules under modules/ and declare them in config/policies.json—see Custom Policies.

How deployments work

After you connect a repository, its default branch is what production runs. With GitHub, every push to it deploys automatically. With GitLab, Bitbucket, and Azure DevOps, your own CI/CD pipeline deploys by calling zuplo deploy—see Source Control and Deployment.

After you connect, the Code tab opens the gateway's source. You can also clone the repository and edit it with your normal tools.

Three categories of changes take effect differently:

ChangeTakes effect
Repository changes (routes, policies.json, custom policy code)On the next deploy of the default branch
App policy chains, teams, budgets, and templates (portal changes)Within about a minute, no deploy needed
Provider settings and environment variablesAutomatically, via a rebuild and deploy Zuplo starts

Provider API keys are stored as environment variables, so saving provider settings or environment variables triggers an automatic production deployment.

Next steps

  • Policy Chains: how apps select policies from config/policies.json
  • Custom Policies: add your own policy to the repository
Edit this page
Last modified on September 1, 2026
Getting StartedUniversal API
On this page
  • Connect a repository
  • What the repository contains
  • How deployments work
  • Next steps