Skip to content
Start here

Get Workers AI inference distribution by dimension

client.Radar.AI.Inference.SummaryV2(ctx, dimension, query) (*AIInferenceSummaryV2Response, error)
GET/radar/ai/inference/summary/{dimension}

Retrieves an aggregated summary of the number of inferences run on Workers AI, grouped by the specified dimension.

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

Specifies the attribute by which to group the results.

One of the following:
const AIInferenceSummaryV2ParamsDimensionModel AIInferenceSummaryV2ParamsDimension = "MODEL"
const AIInferenceSummaryV2ParamsDimensionTask AIInferenceSummaryV2ParamsDimension = "TASK"
query AIInferenceSummaryV2Params
ASN param.Field[[]string]Optional

Filters results by Autonomous System. Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. Prefix with - to exclude ASNs from results. For example, -174, 3356 excludes results from AS174, but includes results from AS3356.

Continent param.Field[[]string]Optional

Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude continents from results. For example, -EU,NA excludes results from EU, but includes results from NA.

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[AIInferenceSummaryV2ParamsFormat]Optional

Format in which results will be returned.

const AIInferenceSummaryV2ParamsFormatJson AIInferenceSummaryV2ParamsFormat = "JSON"
const AIInferenceSummaryV2ParamsFormatCsv AIInferenceSummaryV2ParamsFormat = "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.

Location param.Field[[]string]Optional

Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude locations from results. For example, -US,PT excludes results from the US, but includes results from PT.

Name param.Field[[]string]Optional

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

ReturnsExpand Collapse
type AIInferenceSummaryV2Response struct{…}
Meta AIInferenceSummaryV2ResponseMeta

Metadata for the results.

ConfidenceInfo AIInferenceSummaryV2ResponseMetaConfidenceInfo
Annotations []AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotation
DataSource AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAll AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBGP AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBots AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceCT AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNS AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDos AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFw AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceIQI AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceNet AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeEvent AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeOutage AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePipeline AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AIInferenceSummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "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 []AIInferenceSummaryV2ResponseMetaDateRange
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 AIInferenceSummaryV2ResponseMetaNormalization

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

One of the following:
const AIInferenceSummaryV2ResponseMetaNormalizationPercentage AIInferenceSummaryV2ResponseMetaNormalization = "PERCENTAGE"
const AIInferenceSummaryV2ResponseMetaNormalizationMin0Max AIInferenceSummaryV2ResponseMetaNormalization = "MIN0_MAX"
const AIInferenceSummaryV2ResponseMetaNormalizationMinMax AIInferenceSummaryV2ResponseMetaNormalization = "MIN_MAX"
const AIInferenceSummaryV2ResponseMetaNormalizationRawValues AIInferenceSummaryV2ResponseMetaNormalization = "RAW_VALUES"
const AIInferenceSummaryV2ResponseMetaNormalizationPercentageChange AIInferenceSummaryV2ResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AIInferenceSummaryV2ResponseMetaNormalizationRollingAverage AIInferenceSummaryV2ResponseMetaNormalization = "ROLLING_AVERAGE"
const AIInferenceSummaryV2ResponseMetaNormalizationOverlappedPercentage AIInferenceSummaryV2ResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AIInferenceSummaryV2ResponseMetaNormalizationRatio AIInferenceSummaryV2ResponseMetaNormalization = "RATIO"
Units []AIInferenceSummaryV2ResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get Workers AI inference distribution by dimension

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.SummaryV2(
    context.TODO(),
    radar.AIInferenceSummaryV2ParamsDimensionModel,
    radar.AIInferenceSummaryV2Params{

    },
  )
  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
}