ZeroCopyZeroCopy
ReferenceManagement API

Retrieve customer usage

GET
/customer-keys/usage

Requires the partner:read scope. Returns usage grouped by the enrolled partner team's exact customer references for the selected window. Keys without a reference share a null group. live_keys counts currently active keys. Landed rate is a percentage; tips are integer lamports from landed transactions. last_seen_at can precede the selected window. range defaults to 24h; customer_ref optionally selects one exact group. The response is an unpaginated JSON collection.

Authorization

managementKey
headerAuthorizationBearer <zc_mgmt_>

Query Parameters

range?string

Trailing analytics window

Default"24h"
Value in"24h""7d""30d"
customer_ref?string

Return only this exact customer reference

Length1 <= length <= 100

Response Body

Its figures

application/json
  1. response
window*string
Value in"24h""7d""30d"
data*array<>
Example request
// src/bin/management_customer_usage.rs
// Builds on the example project (/reference/json-rpc#example-project).
use swqos_examples::swqos::{Result, required};

#[tokio::main]
async fn main() -> Result<()> {
    let mut endpoint = reqwest::Url::parse("https://console.zerocopy.sh/api/v1/customer-keys/usage")?;
    endpoint.query_pairs_mut().append_pair("range", "7d");
    if let Ok(customer_ref) = std::env::var("CUSTOMER_REF") {
        endpoint.query_pairs_mut().append_pair("customer_ref", &customer_ref);
    }
    let request = reqwest::Client::new()
        .get(endpoint)
        .bearer_auth(required("MANAGEMENT_API_KEY")?);
    let response = request.send().await?;
    let status = response.status();
    let request_id = response.headers().get("Request-Id")
        .map(|value| value.to_str()).transpose()?.unwrap_or("<missing>").to_owned();
    if let Some(etag) = response.headers().get("ETag") {
        eprintln!("ETag: {}", etag.to_str()?);
    }
    let body = response.text().await?;
    if !status.is_success() {
        return Err(format!("HTTP {status}; Request-Id: {request_id}; {body}").into());
    }
    eprintln!("Request-Id: {request_id}");
    println!("{body}");
    Ok(())
}
Example response
{
  "window": "7d",
  "data": [
    {
      "customer_ref": "acme-123",
      "live_keys": 2,
      "transactions": 1248,
      "landed_rate": 97.5,
      "p50_slots_to_land": 2,
      "tips_lamports": 3670000000,
      "last_seen_at": "2026-11-13T02:13:41Z"
    },
    {
      "customer_ref": null,
      "live_keys": 1,
      "transactions": 163,
      "landed_rate": 98.2,
      "p50_slots_to_land": 1,
      "tips_lamports": 414000000,
      "last_seen_at": "2026-11-13T01:42:19Z"
    }
  ]
}