logo
开发者文档
搜索
Get Organization Peak RPM

Get Organization Peak RPM

Get the organization's peak RPM (requests per minute) over a time period: first sum the requests of all Agents under the organization in the same minute, then take the maximum among those minutes in the period, and also return the time at which the peak occurred, the average RPM, and the total number of requests.

Note: You can query up to 31 days of data; only channels in the development space are counted. See the "Statistical Scope" below for details.

Request Method

GET

Endpoint

https://api-${endpoint}.gptbots.ai/v1/org/stat/rpm

Authentication

Use Basic authentication with account-level DevKey / DevSecret: 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_id and have "View Usage" permission (Organization Owner and Admin have it by default).
  • Please call the data center address where the organization is located; ${endpoint} should be the region returned by Query Organization List (SG → sg, TH → th, JP → jp). Calling other data centers 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 plan "Statistics API" per-minute quota, shared with Agent API Key calls to statistical interfaces.
  • Data is updated hourly; repeated queries within the same hour return the same result. It is recommended to call once per hour.

Request

Request Example

curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/org/stat/rpm?org_id=${org_id}&start_time=1788192000000&end_time=1788796800000' \ -H 'Authorization: Basic ${BASIC_TOKEN}'
                      
                      curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/org/stat/rpm?org_id=${org_id}&start_time=1788192000000&end_time=1788796800000' \
  -H 'Authorization: Basic ${BASIC_TOKEN}'

                    
此代码块在浮窗中显示

Request Header

Field Type Description
Authorization Basic ${BASIC_TOKEN} Use the Basic Token encoded with DevKey:DevSecret in Base64.

Request Parameters

Field Type Required Description
org_id String Yes Organization ID.
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.

Response

Response Example

{ "code": 0, "message": "OK", "data": { "org_id": "65f0c2a1b4e8d93a1c7e5b20", "range_start": 1788192000000, "range_end": 1788796800000, "data_until": 1788793200000, "data_since": 1786125600000, "peak_rpm": 186, "peak_at": 1788512460000, "avg_rpm": 12.40, "total_requests": 2083411 } }
                      
                      {
    "code": 0,
    "message": "OK",
    "data": {
        "org_id": "65f0c2a1b4e8d93a1c7e5b20",
        "range_start": 1788192000000,
        "range_end": 1788796800000,
        "data_until": 1788793200000,
        "data_since": 1786125600000,
        "peak_rpm": 186,
        "peak_at": 1788512460000,
        "avg_rpm": 12.40,
        "total_requests": 2083411
    }
}

                    
此代码块在浮窗中显示

Successful Response

Field Type Description
org_id String Organization ID.
range_start Long Start of the actual statistical interval: start_time, millisecond timestamp aligned down to the nearest hour.
range_end Long End of the actual statistical interval (exclusive): end_time, millisecond timestamp aligned up to the nearest hour.
data_until Long Timestamp up to which data has been collected (millisecond timestamp). Parts of the interval later than this time have no data yet.
data_since Long The earliest whole hour from which the organization has RPM data (millisecond timestamp, same for all organizations in the same data center, approximately 31 days before feature launch). Parts of the interval earlier than this time have no data; if there is no data at all, it is null.
peak_rpm Long Peak RPM: the sum of requests from all Agents under the organization in the same minute, the maximum requests in one minute within the interval.
peak_at Long Start of the minute in which the peak occurs (millisecond timestamp). If multiple minutes are tied, the earliest one is taken; if there are no requests in the interval, it is 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 within the interval.

Failed Response

Field Type Description
code Integer Error code.
message String Error details.

Error Codes

The first three digits of the HTTP status code are used as 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 Calls too frequent: The developer key has exceeded the per-minute limit for this API.
40008 Exceeded the per-minute quota for "Statistics APIs" in the organization plan.
40010 API temporarily closed, please try again later.
40100 No permission: missing usage viewing permission.
40105 Not a member of this organization, or called an address of another data center.
40324 DevKey or DevSecret error.
403132 Invalid time range: start time is not earlier than end time, or exceeds the maximum query range.

Statistical Criteria

  • Requests: User-submitted question messages, plus conversation errors (including requests rejected due to exceeding call frequency), consistent with the console's "Agent Insights → Requests per Minute." This is not the number of HTTP requests, and may differ from the package rate limiting count.
  • Statistics Scope: Only counts requests made by Developer Space Agents through the Developer Space channels, including API, shared pages, web embedding, bubble components, LiveDesk, and various instant messaging and telephone channels; does not include debugging previews within Developer Space, Workflow (including Workflow API calls rejected due to exceeding call frequency), workspace AI search, or usage of published Agents in the workspace.
  • Data Scope: Data is available from 31 days before the feature launch; for earlier periods, use data_since.
  • Update Frequency: Data is aggregated hourly on the hour, with about a 1-hour delay, based on data_until.
  • Difference from the console "Organization → Usage → RPM" page: The console displays 24-hour segments for each day, while this API returns a single peak value for the entire period and the time it occurred.