Skip to content
Start here

Get Workers AI tasks summary

client.Radar.AI.Inference.Summary.Task(ctx, query) (*AIInferenceSummaryTaskResponse, error)
GET/radar/ai/inference/summary/task

Retrieves the distribution of the number of inferences by task.

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 AIInferenceSummaryTaskParams
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[AIInferenceSummaryTaskParamsFormat]Optional

Format in which results will be returned.

const AIInferenceSummaryTaskParamsFormatJson AIInferenceSummaryTaskParamsFormat = "JSON"
const AIInferenceSummaryTaskParamsFormatCsv AIInferenceSummaryTaskParamsFormat = "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 AIInferenceSummaryTaskResponse struct{…}
Meta AIInferenceSummaryTaskResponseMeta

Metadata for the results.

ConfidenceInfo AIInferenceSummaryTaskResponseMetaConfidenceInfo
Annotations []AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotation
DataSource AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceAll AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceBGP AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceBots AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceCT AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceDNS AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceDos AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceFw AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceIQI AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceNet AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypeEvent AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypeOutage AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypePipeline AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AIInferenceSummaryTaskResponseMetaConfidenceInfoAnnotationsEventType = "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 []AIInferenceSummaryTaskResponseMetaDateRange
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 AIInferenceSummaryTaskResponseMetaNormalization

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

One of the following:
const AIInferenceSummaryTaskResponseMetaNormalizationPercentage AIInferenceSummaryTaskResponseMetaNormalization = "PERCENTAGE"
const AIInferenceSummaryTaskResponseMetaNormalizationMin0Max AIInferenceSummaryTaskResponseMetaNormalization = "MIN0_MAX"
const AIInferenceSummaryTaskResponseMetaNormalizationMinMax AIInferenceSummaryTaskResponseMetaNormalization = "MIN_MAX"
const AIInferenceSummaryTaskResponseMetaNormalizationRawValues AIInferenceSummaryTaskResponseMetaNormalization = "RAW_VALUES"
const AIInferenceSummaryTaskResponseMetaNormalizationPercentageChange AIInferenceSummaryTaskResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AIInferenceSummaryTaskResponseMetaNormalizationRollingAverage AIInferenceSummaryTaskResponseMetaNormalization = "ROLLING_AVERAGE"
const AIInferenceSummaryTaskResponseMetaNormalizationOverlappedPercentage AIInferenceSummaryTaskResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AIInferenceSummaryTaskResponseMetaNormalizationRatio AIInferenceSummaryTaskResponseMetaNormalization = "RATIO"
Units []AIInferenceSummaryTaskResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get Workers AI tasks 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.Task(context.TODO(), radar.AIInferenceSummaryTaskParams{

  })
  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": {
      "text generation": "10.274394",
      "text-to-image": "22.904"
    }
  },
  "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": {
      "text generation": "10.274394",
      "text-to-image": "22.904"
    }
  },
  "success": true
}