Skip to content
Start here

Get Workers AI models time series

client.Radar.AI.Inference.TimeseriesGroups.Summary.Model(ctx, query) (*AIInferenceTimeseriesGroupSummaryModelResponse, error)
GET/radar/ai/inference/timeseries_groups/model

Retrieves the distribution of the number of inferences by model over time.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query AIInferenceTimeseriesGroupSummaryModelParams

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

const AIInferenceTimeseriesGroupSummaryModelParamsAggInterval15m AIInferenceTimeseriesGroupSummaryModelParamsAggInterval = "15m"
const AIInferenceTimeseriesGroupSummaryModelParamsAggInterval1h AIInferenceTimeseriesGroupSummaryModelParamsAggInterval = "1h"
const AIInferenceTimeseriesGroupSummaryModelParamsAggInterval1d AIInferenceTimeseriesGroupSummaryModelParamsAggInterval = "1d"
const AIInferenceTimeseriesGroupSummaryModelParamsAggInterval1w AIInferenceTimeseriesGroupSummaryModelParamsAggInterval = "1w"
DateEnd param.Field[[]Time]Optional

End of the date range (inclusive).

DateRange param.Field[[]string]Optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range.

Format in which results will be returned.

const AIInferenceTimeseriesGroupSummaryModelParamsFormatJson AIInferenceTimeseriesGroupSummaryModelParamsFormat = "JSON"
const AIInferenceTimeseriesGroupSummaryModelParamsFormatCsv AIInferenceTimeseriesGroupSummaryModelParamsFormat = "CSV"
LimitPerGroup param.Field[int64]Optional

Limits the number of objects per group to the top items within the specified time range. When item count exceeds the limit, extra items appear grouped under an “other” category.

Name param.Field[[]string]Optional

Array of names used to label the series in the response.

ReturnsExpand Collapse
type AIInferenceTimeseriesGroupSummaryModelResponse struct{…}
Meta AIInferenceTimeseriesGroupSummaryModelResponseMeta

Metadata for the results.

AggInterval AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval

Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to Aggregation intervals.

One of the following:
const AIInferenceTimeseriesGroupSummaryModelResponseMetaAggIntervalFifteenMinutes AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval = "FIFTEEN_MINUTES"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaAggIntervalOneHour AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval = "ONE_HOUR"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaAggIntervalOneDay AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval = "ONE_DAY"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaAggIntervalOneWeek AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval = "ONE_WEEK"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaAggIntervalOneMonth AIInferenceTimeseriesGroupSummaryModelResponseMetaAggInterval = "ONE_MONTH"
ConfidenceInfo AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfo
Annotations []AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotation
DataSource AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAll AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceBGP AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceBots AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceCT AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNS AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDos AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceFw AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceIQI AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceNet AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeEvent AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeOutage AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypePipeline AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AIInferenceTimeseriesGroupSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []AIInferenceTimeseriesGroupSummaryModelResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationPercentage AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "PERCENTAGE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationMin0Max AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "MIN0_MAX"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationMinMax AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "MIN_MAX"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationRawValues AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "RAW_VALUES"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationPercentageChange AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationRollingAverage AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "ROLLING_AVERAGE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationOverlappedPercentage AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalizationRatio AIInferenceTimeseriesGroupSummaryModelResponseMetaNormalization = "RATIO"
Units []AIInferenceTimeseriesGroupSummaryModelResponseMetaUnit

Measurement units for the results.

Name string
Value string
Serie0 AIInferenceTimeseriesGroupSummaryModelResponseSerie0
Timestamps []Time

Get Workers AI models time series

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.AI.Inference.TimeseriesGroups.Summary.Model(context.TODO(), radar.AIInferenceTimeseriesGroupSummaryModelParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2023-08-08T10:15:00Z"
      ]
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "aggInterval": "FIFTEEN_MINUTES",
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "serie_0": {
      "timestamps": [
        "2023-08-08T10:15:00Z"
      ]
    }
  },
  "success": true
}