Skip to content
Start here

List Evaluations

client.AIGateway.Evaluations.List(ctx, gatewayID, params) (*V4PagePaginationArray[EvaluationListResponse], error)
GET/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/evaluations

Lists all AI Gateway evaluator types configured for the account.

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)
AI Gateway WriteAI Gateway Read
ParametersExpand Collapse
gatewayID string

gateway id

maxLength64
minLength1
params EvaluationListParams
AccountID param.Field[string]

Path param

Name param.Field[string]optional

Query param

Page param.Field[int64]optional

Query param

minimum1
PerPage param.Field[int64]optional

Query param

maximum100
minimum1
Processed param.Field[bool]optional

Query param

ReturnsExpand Collapse
type EvaluationListResponse struct{…}
ID string
CreatedAt Time
formatdate-time
Datasets []EvaluationListResponseDataset
ID string
AccountID string
AccountTag string
CreatedAt Time
formatdate-time
Enable bool
Filters []EvaluationListResponseDatasetsFilter
Key EvaluationListResponseDatasetsFiltersKey
One of the following:
const EvaluationListResponseDatasetsFiltersKeyCreatedAt EvaluationListResponseDatasetsFiltersKey = "created_at"
const EvaluationListResponseDatasetsFiltersKeyRequestContentType EvaluationListResponseDatasetsFiltersKey = "request_content_type"
const EvaluationListResponseDatasetsFiltersKeyResponseContentType EvaluationListResponseDatasetsFiltersKey = "response_content_type"
const EvaluationListResponseDatasetsFiltersKeySuccess EvaluationListResponseDatasetsFiltersKey = "success"
const EvaluationListResponseDatasetsFiltersKeyCached EvaluationListResponseDatasetsFiltersKey = "cached"
const EvaluationListResponseDatasetsFiltersKeyProvider EvaluationListResponseDatasetsFiltersKey = "provider"
const EvaluationListResponseDatasetsFiltersKeyModel EvaluationListResponseDatasetsFiltersKey = "model"
const EvaluationListResponseDatasetsFiltersKeyCost EvaluationListResponseDatasetsFiltersKey = "cost"
const EvaluationListResponseDatasetsFiltersKeyTokens EvaluationListResponseDatasetsFiltersKey = "tokens"
const EvaluationListResponseDatasetsFiltersKeyTokensIn EvaluationListResponseDatasetsFiltersKey = "tokens_in"
const EvaluationListResponseDatasetsFiltersKeyTokensOut EvaluationListResponseDatasetsFiltersKey = "tokens_out"
const EvaluationListResponseDatasetsFiltersKeyDuration EvaluationListResponseDatasetsFiltersKey = "duration"
const EvaluationListResponseDatasetsFiltersKeyFeedback EvaluationListResponseDatasetsFiltersKey = "feedback"
Operator EvaluationListResponseDatasetsFiltersOperator
One of the following:
const EvaluationListResponseDatasetsFiltersOperatorEq EvaluationListResponseDatasetsFiltersOperator = "eq"
const EvaluationListResponseDatasetsFiltersOperatorContains EvaluationListResponseDatasetsFiltersOperator = "contains"
const EvaluationListResponseDatasetsFiltersOperatorLt EvaluationListResponseDatasetsFiltersOperator = "lt"
const EvaluationListResponseDatasetsFiltersOperatorGt EvaluationListResponseDatasetsFiltersOperator = "gt"
Value []EvaluationListResponseDatasetsFiltersValueUnion
One of the following:
UnionString
UnionFloat
UnionBool
GatewayID string

gateway id

maxLength64
minLength1
ModifiedAt Time
formatdate-time
Name string
GatewayID string

gateway id

maxLength64
minLength1
ModifiedAt Time
formatdate-time
Name string
Processed bool
Results []EvaluationListResponseResult
ID string
CreatedAt Time
formatdate-time
EvaluationID string
EvaluationTypeID string
ModifiedAt Time
formatdate-time
Result string
Status float64
StatusDescription string
TotalLogs float64
TotalLogs float64

List Evaluations

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/ai_gateway"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.AIGateway.Evaluations.List(
    context.TODO(),
    "my-gateway",
    ai_gateway.EvaluationListParams{
      AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "result": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "datasets": [
        {
          "id": "id",
          "account_id": "account_id",
          "account_tag": "account_tag",
          "created_at": "2019-12-27T18:11:19.117Z",
          "enable": true,
          "filters": [
            {
              "key": "created_at",
              "operator": "eq",
              "value": [
                "string"
              ]
            }
          ],
          "gateway_id": "my-gateway",
          "modified_at": "2019-12-27T18:11:19.117Z",
          "name": "name"
        }
      ],
      "gateway_id": "my-gateway",
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "processed": true,
      "results": [
        {
          "id": "id",
          "created_at": "2019-12-27T18:11:19.117Z",
          "evaluation_id": "evaluation_id",
          "evaluation_type_id": "evaluation_type_id",
          "modified_at": "2019-12-27T18:11:19.117Z",
          "result": "result",
          "status": 0,
          "status_description": "status_description",
          "total_logs": 0
        }
      ],
      "total_logs": 0
    }
  ],
  "success": true
}
Returns Examples
{
  "result": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "datasets": [
        {
          "id": "id",
          "account_id": "account_id",
          "account_tag": "account_tag",
          "created_at": "2019-12-27T18:11:19.117Z",
          "enable": true,
          "filters": [
            {
              "key": "created_at",
              "operator": "eq",
              "value": [
                "string"
              ]
            }
          ],
          "gateway_id": "my-gateway",
          "modified_at": "2019-12-27T18:11:19.117Z",
          "name": "name"
        }
      ],
      "gateway_id": "my-gateway",
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "processed": true,
      "results": [
        {
          "id": "id",
          "created_at": "2019-12-27T18:11:19.117Z",
          "evaluation_id": "evaluation_id",
          "evaluation_type_id": "evaluation_type_id",
          "modified_at": "2019-12-27T18:11:19.117Z",
          "result": "result",
          "status": 0,
          "status_description": "status_description",
          "total_logs": 0
        }
      ],
      "total_logs": 0
    }
  ],
  "success": true
}