Skip to content
Start here

List datasets (deprecated)

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

Lists the datasets defined for an AI Gateway. Evaluations and datasets are deprecated and unavailable to new accounts.

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

Unique identifier of the AI Gateway within the account.

maxLength64
minLength1
params DatasetListParams
AccountID param.Field[string]

Path param

Enable param.Field[bool]Optional

Query 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
ReturnsExpand Collapse
type DatasetListResponse struct{…}
ID string
CreatedAt Time
formatdate-time
Enable bool
Filters []DatasetListResponseFilter
Key DatasetListResponseFiltersKey
One of the following:
const DatasetListResponseFiltersKeyCreatedAt DatasetListResponseFiltersKey = "created_at"
const DatasetListResponseFiltersKeyRequestContentType DatasetListResponseFiltersKey = "request_content_type"
const DatasetListResponseFiltersKeyResponseContentType DatasetListResponseFiltersKey = "response_content_type"
const DatasetListResponseFiltersKeySuccess DatasetListResponseFiltersKey = "success"
const DatasetListResponseFiltersKeyCached DatasetListResponseFiltersKey = "cached"
const DatasetListResponseFiltersKeyProvider DatasetListResponseFiltersKey = "provider"
const DatasetListResponseFiltersKeyModel DatasetListResponseFiltersKey = "model"
const DatasetListResponseFiltersKeyCost DatasetListResponseFiltersKey = "cost"
const DatasetListResponseFiltersKeyTokens DatasetListResponseFiltersKey = "tokens"
const DatasetListResponseFiltersKeyTokensIn DatasetListResponseFiltersKey = "tokens_in"
const DatasetListResponseFiltersKeyTokensOut DatasetListResponseFiltersKey = "tokens_out"
const DatasetListResponseFiltersKeyDuration DatasetListResponseFiltersKey = "duration"
const DatasetListResponseFiltersKeyFeedback DatasetListResponseFiltersKey = "feedback"
Operator DatasetListResponseFiltersOperator
One of the following:
const DatasetListResponseFiltersOperatorEq DatasetListResponseFiltersOperator = "eq"
const DatasetListResponseFiltersOperatorContains DatasetListResponseFiltersOperator = "contains"
const DatasetListResponseFiltersOperatorLt DatasetListResponseFiltersOperator = "lt"
const DatasetListResponseFiltersOperatorGt DatasetListResponseFiltersOperator = "gt"
Value []DatasetListResponseFiltersValueUnion
One of the following:
UnionString
UnionFloat
UnionBool
GatewayID string

Unique identifier of the AI Gateway within the account.

maxLength64
minLength1
ModifiedAt Time
formatdate-time
Name string

List datasets (deprecated)

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.Datasets.List(
    context.TODO(),
    "my-gateway",
    ai_gateway.DatasetListParams{
      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",
      "enable": true,
      "filters": [
        {
          "key": "created_at",
          "operator": "eq",
          "value": [
            "string"
          ]
        }
      ],
      "gateway_id": "my-gateway",
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "name"
    }
  ],
  "success": true
}
Returns Examples
{
  "result": [
    {
      "id": "id",
      "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"
    }
  ],
  "success": true
}