All guides

Run the Gateway in Your Own Network with the Edge Gateway

Deploy the Cloptima edge gateway inside your VPC so provider keys never leave your network, while policies, budgets, and reports keep working.

12 min read Updated October 2026LLM FinOps
On this page
  1. 01What you'll set up
  2. 02What runs where
  3. 03Register an edge instance
  4. 04Deploy with Helm
  5. 05Deploy with Docker Compose
  6. 06Confirm the first heartbeat
  7. 07Add an Edge BYOK credential
  8. 08Govern edge traffic
  9. 09What the edge does without the cloud
  10. 10Optional: a local semantic cache
  11. 11Health and metrics
  12. 12If something goes wrong

01

What you'll set up

Some workloads must keep provider keys and prompts inside your own network. The edge gateway is the Cloptima gateway running in your VPC. In about twelve minutes you will register it, deploy it, connect a provider key that never leaves your hosts, and confirm that policy and reporting work.

  • An edge instance registered in Cloptima
  • The edge gateway running in your Kubernetes cluster or on a Docker host
  • An Edge BYOK credential whose key stays on your side
  • A virtual key and policy that govern edge traffic

You need an owner or admin role and a place to run containers inside your network.

02

What runs where

The cloud keeps the control plane. The edge handles your requests.

In Cloptima's cloudIn your network, on the edge gateway
Policies, bindings, and virtual keys are authored hereYour requests are received and governed
Reports, the Explorer, and the audit logYour provider keys are held and used
Signed policy and pricing sent to the edgeBudgets, rate limits, and guardrails are enforced locally
Usage events received from the edgePrompts and answers stay in your network, unless you turn on trace retention in a policy

03

Register an edge instance

Registration gives the edge gateway an identity and a token.

  1. 1

    Open Edge Instances

    Go to AI → Credentials & Keys and find the Edge Instances card.

  2. 2

    Choose + Register Edge

    Enter an Instance Name such as prod-vpc-eu, a Region, and an Environment.

  3. 3

    Copy the edge token

    It is shown once. Store it in your secret manager.

AI → Credentials & Keys → Edge Instances → + Register Edge
2Instance Name *
prod-vpc-eu
2Region
eu-west-1
2Environment
production
Register
Name, region, environment, and a token shown once.

04

Deploy with Helm

On Kubernetes, one command installs the edge gateway.

bash
helm upgrade --install cloptima-edge oci://ghcr.io/cloptima/charts/cloptima-edge-gateway \
  --namespace cloptima --create-namespace \
  --set edge.pat="$CLOPTIMA_EDGE_PAT" \
  --set edge.controlPlaneUrl="https://api.cloptima.ai" \
  --set redis.embedded.enabled=true
  • edge.pat takes the token, or use edge.patSecret.name to read it from a Kubernetes secret
  • redis.embedded.enabled bundles the storage the edge needs; use redis.url to bring your own
  • semanticCache.enabled adds the optional local semantic cache

05

Deploy with Docker Compose

On a VM or a Docker host, download the production compose file and start it.

bash
curl -fsSL https://api.cloptima.ai/v1/edge/docker-compose.yml -o docker-compose.yml
cat > .env << 'EOF'
CLOPTIMA_EDGE_PAT=<your-edge-token>
CLOPTIMA_EDGE_CONTROL_PLANE_URL=https://api.cloptima.ai
EOF
docker compose up -d

The compose file starts the edge gateway and the storage it needs. If you run the processes yourself, the console's deploy assistant lists the environment variables to set.

06

Confirm the first heartbeat

The console shows when your edge gateway has connected.

  1. 1

    Watch the deploy assistant

    It waits for the first heartbeat after you deploy.

  2. 2

    Read the Heartbeat column

    The Edge Instances card shows the status and the last heartbeat time.

  3. 3

    Use Check Now

    If nothing arrives, confirm the container is running and can reach the control plane URL.

07

Add an Edge BYOK credential

The credential record lives in Cloptima. The secret lives only on your host.

  1. 1

    Choose + Add Credential

    On the Provider Credentials card.

  2. 2

    Choose Storage Mode: Edge BYOK (Stay in Your VPC)

    Pick the Edge Instance it belongs to.

  3. 3

    Enter a Key Reference ID

    A short name such as my-openai-prod.

  4. 4

    Save

    Cloptima stores the record with no secret.

  5. 5

    Set the key on the edge host

    Set CLOPTIMA_KEY_ followed by the reference id, in capitals, to the key. For Bedrock, set CLOPTIMA_BASE_ with the same suffix to the secret access key.

edge host
# Reference ID: my-openai-prod
export CLOPTIMA_KEY_MY_OPENAI_PROD=<your-api-key>

08

Govern edge traffic

Policies and keys work the same way as in the cloud.

  • Create a virtual key and send requests to your edge gateway's address instead of the cloud address
  • Bind a policy to the key, or to its team, app, and environment
  • Budgets, rate limits, tool rules, guardrails, and caches apply on the edge
  • Usage reaches your reports through the edge's uploads

Policy changes reach the edge in about a second.

09

What the edge does without the cloud

A cloud outage should not stop your traffic at once.

SituationWhat the edge does
The control plane is briefly unreachableIt keeps serving on its last signed policy and pricing
BudgetsLocal budget limits keep being enforced
Usage eventsThey are kept safely on the edge and uploaded when the connection returns
The signed state expires (one hour by default)The edge reports itself not ready, so your load balancer can route around it

10

Optional: a local semantic cache

The edge can run the semantic cache next to your traffic.

Turn on semanticCache.enabled in the Helm chart, or use the semantic profile in the compose file. Without it, the exact cache still works.

11

Health and metrics

The edge exposes the endpoints your platform team expects.

EndpointUse it for
/healthzLiveness: the process is running
/readyzReadiness: the edge holds current signed state and can serve
/statusA summary of the edge's state
/metricsPrometheus metrics, prefixed cloptima_edge

12

If something goes wrong

Most problems are connectivity or the key reference.

What you seeLikely causeFix
No heartbeatThe edge cannot reach the control plane, or the token is wrongCheck the control plane URL, outbound access, and the token
Requests fail with a missing credentialThe key environment variable is not set on the hostSet CLOPTIMA_KEY_ plus the reference id in capitals
/readyz failsThe signed state has expiredRestore the connection to the control plane
Spend is missing in reportsUploads are waiting for connectivityCheck outbound access; they resume on their own
Cloptima credits are refusedThe edge only uses your own keysAdd an Edge BYOK credential

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial