Gateway deployment
See which work your AI spend pays for. The AI Data Plane runs in your own Kubernetes cluster, between your applications and your AI gateway. Your requests still reach your gateway as they do today. CloudZero receives usage data with all prompt and response content removed.
Use this guide if your applications can send their AI requests through the AI Data Plane. If your AI tools call their providers directly, use AI Data Plane client telemetry instead.
Who you need: someone with admin access to your Kubernetes cluster runs Steps 1 to 5 and publishes the AI Data Plane in Step 6. The rest of Step 6 changes each application's base URL.
The AI Data Plane is in preview. Coverage and capabilities are expanding. To get started, reach out to your account manager.
Overview
Connecting the AI Data Plane to your gateway takes seven steps:
- Set your installation values
- Install the session cache operator
- Create the namespace and Secrets
- Install the chart
- Point your gateway at the AI Data Plane
- Route your applications through the AI Data Plane
- Verify the deployment
Prerequisites
- A Kubernetes cluster running version 1.29 or later, with at least two nodes, and capacity for about 1.9 CPU and 2.9 GiB of memory in requests.
kubectlaccess to the cluster, and Helm 3.- An ingress your cluster already provides, to publish an in-cluster Service at a TLS-terminated URL on your private network.
- Outbound network access from the cluster to
telemetry.cloudzero.com(telemetry ingest),ai-control-plane.discovery.cloudzero.com(control plane),docker.cloudsmith.io(images), and your classification model's host. Installing the Dragonfly operator in Step 2 also reachesraw.githubusercontent.comand the Dragonfly image registry. If you mirror images, mirror the Dragonfly image too. - An AI gateway in the cluster, or outside it at an HTTPS hostname the cluster can reach, that meets these requirements:
| Requirement | Why it matters |
|---|---|
| Serves Anthropic Messages, OpenAI Chat Completions, or OpenAI Responses | The AI Data Plane analyzes these formats over HTTP. Other traffic, including WebSocket traffic, is forwarded but not analyzed. |
| Accepts a credential for the AI Data Plane's own classification calls | After each turn, the AI Data Plane labels the work: the kind of work, plus the repository, branch, pull request, and work item when they appear. It does this with one small call per turn to a model you choose. CloudZero receives the labels, not the conversation. A turn is the set of requests to a model, and their responses, that one user prompt starts. The classification endpoint is your gateway, so use a credential scoped to that call, such as a LiteLLM virtual key. Classification makes one call per turn, and one per sub-agent, billed to your provider account. Measured turns average about 4,550 input tokens, about $0.0018 per turn on Claude Haiku 4.5. |
| Exports OpenTelemetry traces to an endpoint you set | Your gateway's token counts and costs reach CloudZero this way. |
This guide is tested with LiteLLM 1.98.0 or later.
Gather your credentials
| Credential | Where to get it | Where it is stored |
|---|---|---|
| CloudZero API key | In CloudZero, go to Settings > API Keys and create a key with the Send AI Telemetry scope | Secret cloudzero-api-key, data key value |
| Registry token | Your account manager, along with the chart version to install. CloudZero hosts the chart and images in a private registry, so you can't create this token yourself. | Used for helm registry login and the image pull Secret cloudsmith-pull |
| Classification credential | Created by you in your gateway | Secret context-engine-gateway, data key token |
Step 1: Set your installation values
This guide installs the AI Data Plane Helm chart in inline mode, where your AI requests pass through the AI Data Plane on their way to your gateway.
Every command in this guide uses these shell variables, so run every later step in the same terminal.
- Find your gateway's Service name and port. Replace
<GATEWAY_NAMESPACE>with the namespace your gateway runs in:
kubectl --namespace <GATEWAY_NAMESPACE> get service- Set the shell variables:
export NAMESPACE=cloudzero-data-plane
export RELEASE_NAME=czdp
export CHART=oci://docker.cloudsmith.io/cloudzero/cloudzero/cloudzero-data-plane
export CHART_VERSION=<CHART_VERSION>
export GATEWAY_TYPE=<GATEWAY_TYPE>
export GATEWAY_NAMESPACE=<GATEWAY_NAMESPACE>
export GATEWAY_SERVICE=<GATEWAY_SERVICE>
export GATEWAY_PORT=<GATEWAY_PORT>
export GATEWAY_HOST="$GATEWAY_SERVICE.$GATEWAY_NAMESPACE.svc.cluster.local"
export GATEWAY_TLS=false
export CLASSIFIER_CODEC=<CLASSIFIER_CODEC>
export MODEL=<MODEL>| Variable | What to set it to |
|---|---|
CHART_VERSION | The chart version your account manager provided with your registry token |
GATEWAY_TYPE | A short name for your gateway, such as bifrost or litellm. CloudZero files your gateway's telemetry under this name. |
GATEWAY_NAMESPACE, GATEWAY_SERVICE, GATEWAY_PORT | Your gateway's namespace, Service name, and port, from the listing above. LiteLLM's default port is 4000. |
GATEWAY_TLS | false for a gateway in this cluster. For a gateway outside it, see If your gateway runs outside the cluster. |
CLASSIFIER_CODEC | The format your gateway serves for classification calls: anthropic-messages (/v1/messages), openai-chat (/v1/chat/completions), or openai-responses (/v1/responses). |
MODEL | A model name your gateway serves, used for classification calls and the test request. Start with an inexpensive model, such as claude-haiku-4-5. |
Keep the other values as written.
- Store your registry token without printing it. Run this command, paste the token at the prompt, and press Enter:
read -rs REGISTRY_TOKENIf your gateway runs outside the cluster
Make these changes to the installation:
- Step 1: skip action 1. Set
GATEWAY_HOSTto the gateway's hostname,GATEWAY_TLStotrue, andGATEWAY_PORTto its HTTPS port, typically443. You don't needGATEWAY_NAMESPACEorGATEWAY_SERVICE. The chart requires TLS for any gateway that isn't an in-cluster Service, and the gateway's certificate must be publicly trusted and include the hostname as a DNS name. - Step 5: expose the egress collector's port
4318to your gateway at a TLS-terminated URL, using the same kind of ingress as in Step 6, and use thathttps://URL as<COLLECTOR_ENDPOINT>. The egress collector accepts telemetry without authentication, so make the URL reachable only from your gateway's network.
Step 2: Install the session cache operator
The AI Data Plane's session cache runs on Dragonfly, an in-memory data store. The Dragonfly operator installs once per cluster, before the chart.
- Check whether the operator is installed:
kubectl get crd dragonflies.dragonflydb.ioIf the command lists dragonflies.dragonflydb.io, skip to Step 3.
- If the command returns
NotFound, install the operator and wait for it to register:
kubectl apply -f https://raw.githubusercontent.com/dragonflydb/dragonfly-operator/v1.6.1/manifests/dragonfly-operator.yaml
kubectl wait --for=condition=Established crd/dragonflies.dragonflydb.io --timeout=120sThe wait command prints condition met when the operator is ready.
Step 3: Create the namespace and Secrets
The chart reads its credentials from three Secrets. Only the names and data keys are fixed, so any secret management tool works.
- Create the namespace:
kubectl create namespace "$NAMESPACE"- Store your CloudZero API key:
kubectl create secret generic cloudzero-api-key \
--namespace "$NAMESPACE" \
--from-literal=value='<CLOUDZERO_API_KEY>'- Create the image pull Secret. The username is always
cloudzero/cloudzero:
kubectl create secret docker-registry cloudsmith-pull \
--namespace "$NAMESPACE" \
--docker-server=docker.cloudsmith.io \
--docker-username=cloudzero/cloudzero \
--docker-password="$REGISTRY_TOKEN"- Store the classification credential. If your gateway doesn't require one, store any non-empty value:
kubectl create secret generic context-engine-gateway \
--namespace "$NAMESPACE" \
--from-literal=token='<CLASSIFICATION_CREDENTIAL>'| Placeholder | Value |
|---|---|
<CLOUDZERO_API_KEY> | Your CloudZero API key |
<CLASSIFICATION_CREDENTIAL> | The credential you created in your gateway for the AI Data Plane |
Step 4: Install the chart
- Log in to the registry:
helm registry login docker.cloudsmith.io \
--username cloudzero/cloudzero \
--password "$REGISTRY_TOKEN"- Write the values file:
cat > values.yaml <<EOF
unstable:
cloudZero:
existingSecretName: cloudzero-api-key
upstream:
type: $GATEWAY_TYPE
host: $GATEWAY_HOST
port: $GATEWAY_PORT
tls: $GATEWAY_TLS
defaults:
image:
pullSecrets:
- cloudsmith-pull
components:
contextEngine:
enabled: true
classifier:
target:
codec: $CLASSIFIER_CODEC
model: $MODEL
credentialSecret: context-engine-gateway
EOFSettings under
unstablecan change in any release. Before you install a different chart version, check this guide for changed settings.
- Install the chart:
helm upgrade --install "$RELEASE_NAME" "$CHART" \
--version "$CHART_VERSION" \
--namespace "$NAMESPACE" \
-f values.yamlHelm prints STATUS: deployed when the install succeeds.
Step 5: Point your gateway at the AI Data Plane
Your gateway's usage telemetry (tokens, models, and cost) reaches CloudZero through the AI Data Plane's egress collector. Your gateway must export its OpenTelemetry traces there with prompt and response content turned off. It must also keep the trace ID from the incoming W3C traceparent header on its usage spans and export them without sampling them out, because CloudZero uses that trace ID to connect usage to the classified work.
- Print the collector's endpoint:
echo "http://$RELEASE_NAME-egress-collector.$NAMESPACE.svc.cluster.local:4318"Then follow the option for your gateway. In each, replace <COLLECTOR_ENDPOINT> with the value you printed.
Option A: LiteLLM
- If you deploy LiteLLM with its official Helm chart, add these values to your LiteLLM release. If you use a proxy configuration file instead, add the same
litellm_settingsblock to it and set the two variables in the container's environment:
envVars:
OTEL_EXPORTER_OTLP_ENDPOINT: <COLLECTOR_ENDPOINT>
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
proxy_config:
litellm_settings:
callbacks: ["otel"]
turn_off_message_logging: true- Upgrade your LiteLLM release, or restart the proxy, to apply the change.
For the full callback reference, see LiteLLM's OpenTelemetry integration.
Option B: Bifrost
Bifrost's OpenTelemetry plugin doesn't read the OTEL_EXPORTER_* environment variables, so set the collector in the plugin's configuration.
- Add these values to your Bifrost Helm release. The collector URL takes the full path,
/v1/traces:
bifrost:
plugins:
otel:
enabled: true
config:
collector_url: <COLLECTOR_ENDPOINT>/v1/traces
protocol: http
disable_content_logging: trueFor an in-cluster install with the default names, the URL is http://czdp-egress-collector.cloudzero-data-plane.svc.cluster.local:4318/v1/traces.
- Upgrade your Bifrost release to apply the change.
Option C: Other gateways
- Set your gateway's OpenTelemetry trace export to the collector. Gateways built on an OpenTelemetry SDK read these environment variables:
OTEL_EXPORTER_OTLP_ENDPOINT: <COLLECTOR_ENDPOINT>
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf- Turn off prompt and response content in your gateway's telemetry. For the setting, see your gateway's documentation.
Step 6: Route your applications through the AI Data Plane
Applications outside the cluster reach the AI Data Plane at a hostname you publish with your ingress. Your ingress must:
- Route every path to the
<RELEASE_NAME>-context-engineService on port18000 - Terminate TLS for your hostname and forward plaintext to the Service
- Allow long-running streaming responses without buffering them
- Live in the AI Data Plane's namespace, if it is a Kubernetes
Ingress - Be reachable only from your own network, because the AI Data Plane doesn't authenticate the traffic it receives
-
Publish the
<RELEASE_NAME>-context-engineService with an ingress that meets these requirements. -
From a machine outside the cluster, send a test request through your hostname. If your gateway serves only OpenAI formats, send an equivalent OpenAI request to the same hostname:
curl https://<EXPOSED_URL>/v1/messages \
-H 'content-type: application/json' \
-H 'x-api-key: <CLIENT_GATEWAY_CREDENTIAL>' \
-H 'anthropic-version: 2023-06-01' \
-d '{"model":"<MODEL>","max_tokens":32,"messages":[{"role":"user","content":"Reply with one word."}]}'| Placeholder | Value |
|---|---|
<EXPOSED_URL> | The hostname you published the AI Data Plane at |
<CLIENT_GATEWAY_CREDENTIAL> | A gateway credential a client already uses |
<MODEL> | The MODEL value from Step 1 |
A JSON response with generated text means the path is open.
- Change each client's base URL to your hostname. Clients keep their existing gateway credentials. For example, Claude Code and the Anthropic SDKs read these environment variables:
export ANTHROPIC_BASE_URL=https://<EXPOSED_URL>
export ANTHROPIC_AUTH_TOKEN=<CLIENT_GATEWAY_CREDENTIAL>Clients built on the OpenAI API take a base URL the same way. Codex is supported over HTTP with the Responses API; its WebSocket traffic passes through without classification.
Step 7: Verify the deployment
-
Run one real turn from a client you routed in Step 6.
-
In AI Signals, open the Livestream tab and confirm the turn appears with its classified activity, model usage, and estimated cost.
What to expect
The AI Data Plane registers with CloudZero when it starts and appears in Settings > AI Settings > Control Plane within a few minutes. Viewing it requires read permission for AI Signals. Activity from each routed turn appears in the Livestream tab within seconds of the turn finishing. Once your test turn appears, setup is complete.
Uninstall
Remove the release's workloads:
helm uninstall "$RELEASE_NAME" --namespace "$NAMESPACE"This leaves the coordinator identity Secrets (<RELEASE_NAME>-coordinator-identity and <RELEASE_NAME>-coordinator-gateway), the Secrets you created in Step 3, the Dragonfly operator and its custom resource definition (CRD), and a runtime Lease in the namespace. Delete those to remove everything. The device stays registered in CloudZero after you uninstall.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
helm registry login fails | The username isn't cloudzero/cloudzero, or the registry token is wrong or has been rotated | Log in with the username cloudzero/cloudzero. If it still fails, ask your account manager for a new token, and recreate the cloudsmith-pull Secret with it. |
Pods stay in ImagePullBackOff | The cloudsmith-pull Secret is missing or has the wrong username, or unstable.defaults.image.pullSecrets doesn't list it | Delete the Secret with kubectl delete secret cloudsmith-pull -n "$NAMESPACE", recreate it with the username cloudzero/cloudzero as in Step 3, and list it under unstable.defaults.image.pullSecrets. If you mirror images, also mirror cloudzero.com/envoy and the Dragonfly image. |
Clients get 502 responses from your ingress | Your ingress can't reach the AI Data Plane | Confirm the ingress targets the <RELEASE_NAME>-context-engine Service on port 18000 from the AI Data Plane's namespace, and that the context engine pods are ready. |
If you need help, contact your account manager.
Related resources
- AI Data Plane: what the AI Data Plane does and how to monitor your deployment
- AI Data Plane architecture: how the AI Data Plane is deployed and what it touches, for your operations team to review
- AI Data Plane client telemetry: the installation for AI tools that call their providers directly
- AI Data Plane telemetry schema: every field the AI Data Plane sends to CloudZero
Have questions or feedback? Reach out to your account manager.
Updated 1 day ago

