RequestRocketRequestRocketDocs
ControlMeters

Meters API

Create a meter on a proxy or an MCP server.

The body is the same on each parent. response_value requires extraction with a location of body or header. Path, header, query, body, and token matches are on Predicates. Meters attach to a proxy or a direct MCP server. A proxy-backed MCP server returns 409. Create the meter on the backing proxy.

Endpoints

MethodPathWhat it does
GET/api/clients/:clientId/proxies/:proxyId/metersList proxy meters
POST/api/clients/:clientId/proxies/:proxyId/metersCreate a proxy meter
GET/api/clients/:clientId/proxies/:proxyId/meters/:meterIdRead a proxy meter
PUT/api/clients/:clientId/proxies/:proxyId/meters/:meterIdUpdate a proxy meter
DELETE/api/clients/:clientId/proxies/:proxyId/meters/:meterIdDelete a proxy meter
GET/api/clients/:clientId/mcps/:mcpId/metersList MCP server meters
POST/api/clients/:clientId/mcps/:mcpId/metersCreate an MCP server meter

List meters

GET /api/clients/:clientId/proxies/:proxyId/meters returns the meters on that proxy. The MCP path returns the same shape. GET .../meters/:meterId returns one meter.

Query parameters

None.

Response attributes

AttributeTypeDescription
metersarrayOne or more meter objects.
meters[].sKeystringMeter id. Pass this as meterId on other endpoints.
meters[].pKey / parentIdstringProxy or direct MCP server id.
meters[].userIdstringCreator user id.
meters[].clientIdstringOrganisation id.
meters[].meterTypestring"request_count" or "response_value".
meters[].meterActivebooleanWhether the meter counts.
meters[].meterModestring"all" or "conditional". Absent means every call counts.
meters[].effectstring or null"include" or "exclude" when the mode is conditional.
meters[].limitsobjectWindow caps. Keys are minute, hour, day, and month.
meters[].extractionobject or nullHow a response_value meter reads a number. Contains location, path, headerName, and defaultValue.
meters[].methodsarray or nullHTTP methods the meter applies to, or null for all.
meters[].pathobject or nullPath predicate, or null.
meters[].queryarray or nullQuery-parameter predicates, or null.
meters[].headersarray or nullHeader predicates, or null.
meters[].bodyarray or nullJSON body predicates, or null.
meters[].tokenarray or nullJWT claim predicates, or null.
meters[].variablesarray or nullVariable bindings, or null.
meters[].notesstringFree-text note, or empty string.
meters[].alertsobject or nullDigest policy, or null.
meters[].meterRegionstringRegion copied from the parent.
meters[].createdAtstringISO 8601 creation time.
meters[].updatedAtstringISO 8601 last update time.
messagestring"Success".

Create a proxy meter

POST /api/clients/:clientId/proxies/:proxyId/meters creates a request counter. The MCP path takes the same body.

Request

curl -X POST "https://api.requestrocket.com/api/clients/:clientId/proxies/:proxyId/meters" \
  -H "Authorization: u-your-token" \
  -H "Content-Type: application/json" \
  -d '{
  "meterType": "request_count",
  "meterActive": true,
  "limits": {
    "minute": 100
  },
  "meterMode": "all"
}'
import axios from "axios";

const response = await axios.request({
  method: "POST",
  url: "https://api.requestrocket.com/api/clients/:clientId/proxies/:proxyId/meters",
  headers: {
    "Authorization": "u-your-token",
    "Content-Type": "application/json",
  },
  data: {
  "meterType": "request_count",
  "meterActive": true,
  "limits": {
    "minute": 100
  },
  "meterMode": "all"
}
});

console.log(response.status, response.data);
import requests

response = requests.request(
    "POST",
    "https://api.requestrocket.com/api/clients/:clientId/proxies/:proxyId/meters",
    headers={
        "Authorization": "u-your-token",
        "Content-Type": "application/json",
    },
    data="{\n  \"meterType\": \"request_count\",\n  \"meterActive\": true,\n  \"limits\": {\n    \"minute\": 100\n  },\n  \"meterMode\": \"all\"\n}"
)
print(response.status_code, response.json())
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    payload := strings.NewReader(`{
  "meterType": "request_count",
  "meterActive": true,
  "limits": {
    "minute": 100
  },
  "meterMode": "all"
}`)
    req, _ := http.NewRequest("POST", "https://api.requestrocket.com/api/clients/:clientId/proxies/:proxyId/meters", payload)
    req.Header.Set("Authorization", "u-your-token")
    req.Header.Set("Content-Type", "application/json")
    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(resp.StatusCode, string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.requestrocket.com/api/clients/:clientId/proxies/:proxyId/meters"))
            .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"meterType\": \"request_count\",\n  \"meterActive\": true,\n  \"limits\": {\n    \"minute\": 100\n  },\n  \"meterMode\": \"all\"\n}"))
            .header("Authorization", "u-your-token")
            .header("Content-Type", "application/json")
            .build();
        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode());
        System.out.println(response.body());
    }
}

Responses

{
  "meters": [
    {
      "pKey": "5d8a1c30-4e72-4b19-8f6a-0c3d9e7b1a25",
      "sKey": "4b7c2e95-1a60-4d38-9f2b-8c5e0a3d7b16",
      "userId": "0f8e6c1a-2b7d-4c3e-9a55-1d2e3f4a5b6c",
      "clientId": "b3a1c7d2-5e44-4f0a-9c1e-7d2f8a6b1c90",
      "parentId": "5d8a1c30-4e72-4b19-8f6a-0c3d9e7b1a25",
      "meterRegion": "us-east-2",
      "notes": "",
      "meterType": "request_count",
      "meterActive": true,
      "extraction": null,
      "limits": {
        "minute": 100
      },
      "meterMode": "all",
      "alerts": null,
      "createdAt": "2026-11-02T07:30:00.000Z",
      "updatedAt": "2026-11-02T07:30:00.000Z"
    }
  ],
  "message": "Success"
}
{
  "message": "Input failed data validation",
  "errors": [
    "/limits: must have required property 'limits'"
  ]
}
{
  "message": "Unauthorized"
}
{
  "Message": "User is not authorized to access this resource with an explicit deny in an identity-based policy"
}
{
  "message": "method / endpoint not supported"
}

Returns a meters array containing the created meter, with message set to "Success".

Request body

ParameterTypeRequiredDescription
meterTypestring✓"request_count" counts calls. "response_value" reads a number from the response.
meterActiveboolean✓When true, the meter counts.
limitsobject✓Window caps. Shape: { minute?, hour?, day?, month? }, each a number. A configured window is counted and enforced. A threshold-alert window is also counted. Window counters are on Meter limits.
meterModestring—"all" counts every call. "conditional" uses the predicate. Omit and the meter counts every call.
effectstring—"include" counts calls that match. "exclude" counts calls that do not match. Used when meterMode is "conditional". Defaults to include.
extractionobject—Required when meterType is "response_value". Shape: { location, path?, headerName?, defaultValue? }. location is "body" or "header". path is a dot path into the JSON body, such as usage.total_tokens. headerName is the response header. defaultValue is the number used when the value is missing.
methodsstring[]—HTTP methods: "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", or "OPTIONS". Omit to match every method.
pathobject—Path check. Same shape as Predicates.
queryobject[]—Query-parameter checks. Same shape as Predicates.
headersobject[]—Header checks. Same shape as Predicates.
bodyobject[]—JSON body checks. Same shape as Predicates.
tokenobject[]—JWT claim checks. Same shape as Predicates.
variablesobject[]—{ name, source, key } bindings. source is "headers", "params", "body", "static", or "jwtClaim". See Predicates.
notesstring—Free-text note. Defaults to an empty string.
alertsobject—Digest policy. Shape: { enabled, cadence?, notifyTrigger?, alertThreshold?, alertNote? }. enabled is required inside the object. When enabled is true, cadence ("minute", "hour", "day", or "month") and notifyTrigger ("exceed", "predicate_match", or "threshold") are required. When notifyTrigger is "threshold", alertThreshold must set at least one of minute, hour, day, or month. alertNote is at most 500 characters.

The server sets pKey, sKey, userId, clientId, parentId, meterRegion, createdAt, and updatedAt.

Returns a meters array. The attributes match List meters. Window counters are on Meter limits.

Update a meter

PUT /api/clients/:clientId/proxies/:proxyId/meters/:meterId updates one meter. The MCP path takes the same body.

All fields are optional. Omit a field to leave it unchanged; send null to clear it. Sending limits replaces the whole limits object.

Request body

ParameterTypeRequiredDescription
meterTypestring—"request_count" or "response_value".
meterActiveboolean—Whether the meter counts.
limitsobject—{ minute?, hour?, day?, month? }. Replaces every window on the meter.
meterModestring—"all" or "conditional".
effectstring—"include" or "exclude".
extractionobject—{ location, path?, headerName?, defaultValue? }. location is "body" or "header".
methodsstring[]—HTTP methods: "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", or "OPTIONS".
pathobject—Path check. Same shape as Predicates.
queryobject[]—Query-parameter checks. Same shape as Predicates.
headersobject[]—Header checks. Same shape as Predicates.
bodyobject[]—JSON body checks. Same shape as Predicates.
tokenobject[]—JWT claim checks. Same shape as Predicates.
variablesobject[]—{ name, source, key } bindings. See Predicates.
notesstring—Free-text note.
alertsobject—Same shape as on create. When the saved policy has enabled: true, cadence and notifyTrigger are required, and "threshold" requires alertThreshold.

Returns a meters array with the updated meter. The attributes match List meters. updatedAt is the time of this call.

Delete a meter

DELETE /api/clients/:clientId/proxies/:proxyId/meters/:meterId removes the meter. The response message is "Meter deleted successfully from all tables".

Window counters are on Meter limits.

Next

On this page