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
| Method | Path | What it does |
|---|---|---|
| GET | /api/clients/:clientId/proxies/:proxyId/meters | List proxy meters |
| POST | /api/clients/:clientId/proxies/:proxyId/meters | Create a proxy meter |
| GET | /api/clients/:clientId/proxies/:proxyId/meters/:meterId | Read a proxy meter |
| PUT | /api/clients/:clientId/proxies/:proxyId/meters/:meterId | Update a proxy meter |
| DELETE | /api/clients/:clientId/proxies/:proxyId/meters/:meterId | Delete a proxy meter |
| GET | /api/clients/:clientId/mcps/:mcpId/meters | List MCP server meters |
| POST | /api/clients/:clientId/mcps/:mcpId/meters | Create 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
| Attribute | Type | Description |
|---|---|---|
meters | array | One or more meter objects. |
meters[].sKey | string | Meter id. Pass this as meterId on other endpoints. |
meters[].pKey / parentId | string | Proxy or direct MCP server id. |
meters[].userId | string | Creator user id. |
meters[].clientId | string | Organisation id. |
meters[].meterType | string | "request_count" or "response_value". |
meters[].meterActive | boolean | Whether the meter counts. |
meters[].meterMode | string | "all" or "conditional". Absent means every call counts. |
meters[].effect | string or null | "include" or "exclude" when the mode is conditional. |
meters[].limits | object | Window caps. Keys are minute, hour, day, and month. |
meters[].extraction | object or null | How a response_value meter reads a number. Contains location, path, headerName, and defaultValue. |
meters[].methods | array or null | HTTP methods the meter applies to, or null for all. |
meters[].path | object or null | Path predicate, or null. |
meters[].query | array or null | Query-parameter predicates, or null. |
meters[].headers | array or null | Header predicates, or null. |
meters[].body | array or null | JSON body predicates, or null. |
meters[].token | array or null | JWT claim predicates, or null. |
meters[].variables | array or null | Variable bindings, or null. |
meters[].notes | string | Free-text note, or empty string. |
meters[].alerts | object or null | Digest policy, or null. |
meters[].meterRegion | string | Region copied from the parent. |
meters[].createdAt | string | ISO 8601 creation time. |
meters[].updatedAt | string | ISO 8601 last update time. |
message | string | "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": "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
| Parameter | Type | Required | Description |
|---|---|---|---|
meterType | string | ✓ | "request_count" counts calls. "response_value" reads a number from the response. |
meterActive | boolean | ✓ | When true, the meter counts. |
limits | object | ✓ | 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. |
meterMode | string | — | "all" counts every call. "conditional" uses the predicate. Omit and the meter counts every call. |
effect | string | — | "include" counts calls that match. "exclude" counts calls that do not match. Used when meterMode is "conditional". Defaults to include. |
extraction | object | — | 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. |
methods | string[] | — | HTTP methods: "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", or "OPTIONS". Omit to match every method. |
path | object | — | Path check. Same shape as Predicates. |
query | object[] | — | Query-parameter checks. Same shape as Predicates. |
headers | object[] | — | Header checks. Same shape as Predicates. |
body | object[] | — | JSON body checks. Same shape as Predicates. |
token | object[] | — | JWT claim checks. Same shape as Predicates. |
variables | object[] | — | { name, source, key } bindings. source is "headers", "params", "body", "static", or "jwtClaim". See Predicates. |
notes | string | — | Free-text note. Defaults to an empty string. |
alerts | object | — | 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
| Parameter | Type | Required | Description |
|---|---|---|---|
meterType | string | — | "request_count" or "response_value". |
meterActive | boolean | — | Whether the meter counts. |
limits | object | — | { minute?, hour?, day?, month? }. Replaces every window on the meter. |
meterMode | string | — | "all" or "conditional". |
effect | string | — | "include" or "exclude". |
extraction | object | — | { location, path?, headerName?, defaultValue? }. location is "body" or "header". |
methods | string[] | — | HTTP methods: "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", or "OPTIONS". |
path | object | — | Path check. Same shape as Predicates. |
query | object[] | — | Query-parameter checks. Same shape as Predicates. |
headers | object[] | — | Header checks. Same shape as Predicates. |
body | object[] | — | JSON body checks. Same shape as Predicates. |
token | object[] | — | JWT claim checks. Same shape as Predicates. |
variables | object[] | — | { name, source, key } bindings. See Predicates. |
notes | string | — | Free-text note. |
alerts | object | — | 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.