---
title: Get a dataset (deprecated)
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[AI Gateway](https://developers.cloudflare.com/api/go/resources/ai_gateway)

[Datasets](https://developers.cloudflare.com/api/go/resources/ai_gateway/subresources/datasets)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Get a dataset (deprecated)

client.AIGateway.Datasets.Get(ctx, gatewayID, id, query) (\*[DatasetGetResponse](<https://developers.cloudflare.com/api/go/resources/ai_gateway#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/ai-gateway/gateways/{gateway\_id}/datasets/{id}

Retrieves a dataset and its log filters. Evaluations and datasets are deprecated and unavailable to new accounts.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`AI Gateway Write``AI Gateway Read`

##### ParametersExpand Collapse

gatewayID string

Unique identifier of the AI Gateway within the account.

maxLength64

minLength1

[Link to this property](<#(resource)%20ai_gateway.datasets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20gateway_id%20%3E%20(schema)>)

id string

[Link to this property](<#(resource)%20ai_gateway.datasets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20id%20%3E%20(schema)>)

<details>

<summary>

query DatasetGetParams

</summary>

AccountID param.Field\[string]

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_gateway.datasets%20%3E%20(method)%20get%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type DatasetGetResponse struct{…}

</summary>

ID string

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

CreatedAt Time

formatdate-time

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

Enable bool

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20enable">Link to this property</a>

<details>

<summary>

Filters \[]DatasetGetResponseFilter

</summary>

<details>

<summary>

Key DatasetGetResponseFiltersKey

</summary>

One of the following:

const DatasetGetResponseFiltersKeyCreatedAt DatasetGetResponseFiltersKey = "created\_at"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%200">Link to this property</a>

const DatasetGetResponseFiltersKeyRequestContentType DatasetGetResponseFiltersKey = "request\_content\_type"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%201">Link to this property</a>

const DatasetGetResponseFiltersKeyResponseContentType DatasetGetResponseFiltersKey = "response\_content\_type"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%202">Link to this property</a>

const DatasetGetResponseFiltersKeySuccess DatasetGetResponseFiltersKey = "success"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%203">Link to this property</a>

const DatasetGetResponseFiltersKeyCached DatasetGetResponseFiltersKey = "cached"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%204">Link to this property</a>

const DatasetGetResponseFiltersKeyProvider DatasetGetResponseFiltersKey = "provider"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%205">Link to this property</a>

const DatasetGetResponseFiltersKeyModel DatasetGetResponseFiltersKey = "model"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%206">Link to this property</a>

const DatasetGetResponseFiltersKeyCost DatasetGetResponseFiltersKey = "cost"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%207">Link to this property</a>

const DatasetGetResponseFiltersKeyTokens DatasetGetResponseFiltersKey = "tokens"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%208">Link to this property</a>

const DatasetGetResponseFiltersKeyTokensIn DatasetGetResponseFiltersKey = "tokens\_in"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%209">Link to this property</a>

const DatasetGetResponseFiltersKeyTokensOut DatasetGetResponseFiltersKey = "tokens\_out"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%2010">Link to this property</a>

const DatasetGetResponseFiltersKeyDuration DatasetGetResponseFiltersKey = "duration"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%2011">Link to this property</a>

const DatasetGetResponseFiltersKeyFeedback DatasetGetResponseFiltersKey = "feedback"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key%20%3E%20(member)%2012">Link to this property</a>

</details>

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20key">Link to this property</a>

<details>

<summary>

Operator DatasetGetResponseFiltersOperator

</summary>

One of the following:

const DatasetGetResponseFiltersOperatorEq DatasetGetResponseFiltersOperator = "eq"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20operator%20%3E%20(member)%200">Link to this property</a>

const DatasetGetResponseFiltersOperatorContains DatasetGetResponseFiltersOperator = "contains"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20operator%20%3E%20(member)%201">Link to this property</a>

const DatasetGetResponseFiltersOperatorLt DatasetGetResponseFiltersOperator = "lt"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20operator%20%3E%20(member)%202">Link to this property</a>

const DatasetGetResponseFiltersOperatorGt DatasetGetResponseFiltersOperator = "gt"

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20operator%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20operator">Link to this property</a>

<details>

<summary>

Value \[]DatasetGetResponseFiltersValueUnion

</summary>

One of the following:

UnionString

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20value%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

UnionFloat

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20value%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

UnionBool

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20value%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

</details>

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters%20%3E%20(items)%20%3E%20(property)%20value">Link to this property</a>

</details>

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20filters">Link to this property</a>

GatewayID string

Unique identifier of the AI Gateway within the account.

maxLength64

minLength1

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20gateway_id">Link to this property</a>

ModifiedAt Time

formatdate-time

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20modified_at">Link to this property</a>

Name string

<a href="#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_gateway.datasets%20%3E%20(model)%20DatasetGetResponse%20%3E%20(schema)>)

### Get a dataset (deprecated)

Go

HTTPTypeScriptPythonGoTerraform

```
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"),
  )
  dataset, err := client.AIGateway.Datasets.Get(
    context.TODO(),
    "my-gateway",
    "id",
    ai_gateway.DatasetGetParams{
      AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", dataset.ID)
}
```

200 example

```
{
  "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

200 example

```
{
  "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
}
```