Skip to content
Start here

Get Workers AI models summary

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

Retrieves the distribution of the number of inferences by model.

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 AIInferenceSummaryModelParams
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 param.Field[AIInferenceSummaryModelParamsFormat]Optional

Format in which results will be returned.

const AIInferenceSummaryModelParamsFormatJson AIInferenceSummaryModelParamsFormat = "JSON"
const AIInferenceSummaryModelParamsFormatCsv AIInferenceSummaryModelParamsFormat = "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 AIInferenceSummaryModelResponse struct{…}
Meta AIInferenceSummaryModelResponseMeta

Metadata for the results.

ConfidenceInfo AIInferenceSummaryModelResponseMetaConfidenceInfo
Annotations []AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotation
DataSource AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAll AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceBGP AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceBots AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceCT AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNS AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceDos AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceFw AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceIQI AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceNet AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeEvent AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeOutage AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypePipeline AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AIInferenceSummaryModelResponseMetaConfidenceInfoAnnotationsEventType = "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 []AIInferenceSummaryModelResponseMetaDateRange
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 AIInferenceSummaryModelResponseMetaNormalization

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

One of the following:
const AIInferenceSummaryModelResponseMetaNormalizationPercentage AIInferenceSummaryModelResponseMetaNormalization = "PERCENTAGE"
const AIInferenceSummaryModelResponseMetaNormalizationMin0Max AIInferenceSummaryModelResponseMetaNormalization = "MIN0_MAX"
const AIInferenceSummaryModelResponseMetaNormalizationMinMax AIInferenceSummaryModelResponseMetaNormalization = "MIN_MAX"
const AIInferenceSummaryModelResponseMetaNormalizationRawValues AIInferenceSummaryModelResponseMetaNormalization = "RAW_VALUES"
const AIInferenceSummaryModelResponseMetaNormalizationPercentageChange AIInferenceSummaryModelResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AIInferenceSummaryModelResponseMetaNormalizationRollingAverage AIInferenceSummaryModelResponseMetaNormalization = "ROLLING_AVERAGE"
const AIInferenceSummaryModelResponseMetaNormalizationOverlappedPercentage AIInferenceSummaryModelResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AIInferenceSummaryModelResponseMetaNormalizationRatio AIInferenceSummaryModelResponseMetaNormalization = "RATIO"
Units []AIInferenceSummaryModelResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get Workers AI models summary

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.Summary.Model(context.TODO(), radar.AIInferenceSummaryModelParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "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"
        }
      ]
    },
    "summary_0": {
      "@cf/meta/llama-3-8b-instruct": "8.381743",
      "@cf/meta/m2m100-1.2b": "22.904",
      "@cf/stabilityai/stable-diffusion-xl-base-1.0": "10.274394"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "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"
        }
      ]
    },
    "summary_0": {
      "@cf/meta/llama-3-8b-instruct": "8.381743",
      "@cf/meta/m2m100-1.2b": "22.904",
      "@cf/stabilityai/stable-diffusion-xl-base-1.0": "10.274394"
    }
  },
  "success": true
}