Get Agent Peak RPM
Get Agent Peak RPM
Retrieve the peak RPM (requests per minute) of a specific Agent over a time period, while also returning the time when the peak occurred, the average RPM, and the total number of requests.
Note: You can query up to 31 days of data; statistics only cover developer space channels. For the scope of statistics, see "Statistical Caliber" below.
Request Method
GET
Endpoint
https://api-${endpoint}.gptbots.ai/v1/org/agent/stat/rpm
Authentication
Use account-level DevKey / DevSecret for Basic authentication: Authorization: Basic ${BASIC_TOKEN}, where ${BASIC_TOKEN} is the Base64 encoding of DevKey:DevSecret.
- The calling account must be a member of the organization corresponding to
org_idand have "View Usage" permission (organization Owners and administrators have this by default) and must be able to view this Agent: the Agent creator, organization Owner, or a member granted permission for this Agent (or all Agents). - Please call the endpoint of the data center where the organization is located.
${endpoint}is obtained from theregionreturned by Query Organization List (SG→sg,TH→th,JP→jp). Calling a different data center will return "Not a member of this organization."
Call Frequency
- Each developer key can call this API up to 60 times per minute.
- Each call counts toward the organization's package "Statistical API" per-minute quota, shared with Agent API Key calls for statistical interfaces.
- Data is updated hourly; repeated queries within the same hour return the same result, so it is recommended to call the API once per hour.
Request
Example Request
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/org/agent/stat/rpm?org_id=${org_id}&agent_id=${agent_id}&start_time=1788192000000&end_time=1788796800000' \
-H 'Authorization: Basic ${BASIC_TOKEN}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/org/agent/stat/rpm?org_id=${org_id}&agent_id=${agent_id}&start_time=1788192000000&end_time=1788796800000' \
-H 'Authorization: Basic ${BASIC_TOKEN}'
此代码块在浮窗中显示
Request Header
| Field | Type | Description |
|---|---|---|
| Authorization | Basic ${BASIC_TOKEN} | Basic Token after DevKey:DevSecret Base64 encoding. |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| org_id | String | Yes | Organization ID. |
| agent_id | String | Yes | Agent ID. Workflow is not supported. |
| start_time | Long | Yes | Start time, in milliseconds timestamp. Rounded down to the nearest hour. |
| end_time | Long | Yes | End time (exclusive), in milliseconds timestamp. Rounded up to the nearest hour. The aligned interval cannot exceed 31 days. |
| conversation_type | String | No | View only a specific channel, such as API, SHARE, EMBED, WIDGET, LIVEDESK. Can only be a channel from the development space; if not provided, all channels in the development space are counted. |
Response
Response Example
{
"code": 0,
"message": "OK",
"data": {
"agent_id": "65f0c2a1b4e8d93a1c7e5b21",
"range_start": 1788192000000,
"range_end": 1788796800000,
"data_until": 1788793200000,
"peak_rpm": 42,
"peak_at": 1788512460000,
"avg_rpm": 3.18,
"total_requests": 18234
}
}
{
"code": 0,
"message": "OK",
"data": {
"agent_id": "65f0c2a1b4e8d93a1c7e5b21",
"range_start": 1788192000000,
"range_end": 1788796800000,
"data_until": 1788793200000,
"peak_rpm": 42,
"peak_at": 1788512460000,
"avg_rpm": 3.18,
"total_requests": 18234
}
}
此代码块在浮窗中显示
Successful Response
| Field | Type | Description |
|---|---|---|
| agent_id | String | Agent ID. |
| range_start | Long | Start of the actual statistics interval: start_time, aligned down to the nearest whole hour in milliseconds timestamp. |
| range_end | Long | End of the actual statistics interval (exclusive): end_time, aligned up to the nearest whole hour in milliseconds timestamp. |
| data_until | Long | The time until which data has been counted (milliseconds timestamp). Parts of the interval after this time do not yet have data. |
| peak_rpm | Long | Peak RPM: the number of requests in the minute with the highest total requests across all channels within the interval. |
| peak_at | Long | Start of the minute with the peak (milliseconds timestamp). If multiple minutes tie, take the earliest; if there are no requests in the interval, null. |
| avg_rpm | Number | Average RPM: total requests ÷ number of minutes with requests, rounded to 2 decimal places. |
| total_requests | Long | Total number of requests in the interval. |
Failed Response
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code. |
| message | String | Error details. |
Error Codes
HTTP status code corresponds to the first three digits of the error code. For example, 40000 corresponds to 400, 40100 corresponds to 401, 403132 corresponds to 403.
| Error Code | Description |
|---|---|
| 40000 | Parameter error, such as missing required parameters or invalid parameter values. |
| 40001 | Too many requests: this developer key has exceeded the per-minute limit for this interface. |
| 40008 | Exceeded the organization's package "statistical API" per-minute quota. |
| 40010 | Interface temporarily closed, please try again later. |
| 40100 | No permission: Missing usage viewing permission, or no right to view this Agent (including the Agent not belonging to this organization). |
| 40105 | Not a member of this organization, or accessed an address from another data center. |
| 40324 | DevKey or DevSecret error. |
| 40378 | Agent has been deleted. |
| 403132 | Invalid time range: start time is not earlier than end time, or exceeds the maximum query range. |
Statistical Scope
- Requests: User-submitted question messages, plus dialogue errors (including requests rejected due to exceeding call frequency), consistent with "Agent Insights → Requests per Minute" in the console. It is not the number of HTTP requests, and may differ from the counting in package rate limits.
- Statistical Range: Only counts channels in the development space, including API, shared pages, web embedding, bubble components, LiveDesk, and various instant messaging and phone channels; does not include debugging previews in the development space, Workflow executions, or usage of the Agent in a workspace after deployment in that workspace.
- Update Frequency: Data is collected on the hour every hour, with about a 1-hour delay, based on
data_until. Data before 2026-03-09 has no minute-level details, and query results are 0.
