Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup go
uses: actions/setup-go@v5
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Setup go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Ensure we can check out the pull request base in the script below.
fetch-depth: ${{ env.FETCH_DEPTH }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "6.6.0"
".": "6.7.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2003
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-28b84a5db03b38290dfe7ef1de2c68feb68762d7a8f207bdbea4d39a7aeef1ea.yml
openapi_spec_hash: ba6bd61621e4be20b581f4f3bf0978d3
config_hash: 792d1c52dbd202202899d3af9ac09455
configured_endpoints: 2004
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c0d713a413cf8be82c2ba4c521c453a128f1bdc4038355f2a8176369f152c2f4.yml
openapi_spec_hash: 9b9b440902b29ee45ad21b9a22c24c40
config_hash: d1101915de2a8b526a1fe20a9f7314ca
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 6.7.0 (2026-01-26)

Full Changelog: [v6.6.0...v6.7.0](https://github.com/cloudflare/cloudflare-go/compare/v6.6.0...v6.7.0)

### Features

* feat(fraud): public docs for fraud API ([57093fa](https://github.com/cloudflare/cloudflare-go/commit/57093fa34c2f894447aca0d37556606ff8c7e2b0))
* refactor(terraform): restructure origin_tls_client_auth to peer subresources ([39948a3](https://github.com/cloudflare/cloudflare-go/commit/39948a3a11e649dc8ec12f0e7975139e232a348d))


### Chores

* **api:** update composite API spec ([740a2bf](https://github.com/cloudflare/cloudflare-go/commit/740a2bf8d5470e4ab64ead5e01ccad31d73c2b57))
* **changelog:** update with v6.6.0 release notes ([16ae7fd](https://github.com/cloudflare/cloudflare-go/commit/16ae7fd5a181613e433d3cd61f672f043e3bc42a))
* **internal:** codegen related update ([8e10a2c](https://github.com/cloudflare/cloudflare-go/commit/8e10a2c5ddc1fcf20d01e6abf55708b5ed881a8f))

## 6.6.0 (2025-01-15)

Full Changelog: [v6.5.0...v6.6.0](https://github.com/cloudflare/cloudflare-go/compare/v6.5.0...v6.6.0)
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ from applications written in Go.

It is generated with [Stainless](https://www.stainless.com/).

## MCP Server

Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl19)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%7D)

> Note: You may need to set environment variables in your MCP client.

## Installation

<!-- x-release-please-start-version -->
Expand All @@ -24,7 +33,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/cloudflare/cloudflare-go/v4@v6.6.0'
go get -u 'github.com/cloudflare/cloudflare-go/v4@v6.7.0'
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -259,24 +268,21 @@ which can be used to wrap any `io.Reader` with the appropriate file name and con
```go
// A file from the file system
file, err := os.Open("/path/to/file")
api_gateway.UserSchemaNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
File: cloudflare.F[io.Reader](file),
Kind: cloudflare.F(api_gateway.UserSchemaNewParamsKindOpenAPIV3),
kv.NamespaceValueUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Value: cloudflare.F[io.Reader](file),
}

// A file from a string
api_gateway.UserSchemaNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
File: cloudflare.F[io.Reader](strings.NewReader("my file contents")),
Kind: cloudflare.F(api_gateway.UserSchemaNewParamsKindOpenAPIV3),
kv.NamespaceValueUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Value: cloudflare.F[io.Reader](strings.NewReader("my file contents")),
}

// With a custom filename and contentType
api_gateway.UserSchemaNewParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
File: cloudflare.FileParam(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
Kind: cloudflare.F(api_gateway.UserSchemaNewParamsKindOpenAPIV3),
kv.NamespaceValueUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Value: cloudflare.FileParam(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}
```

Expand Down
12 changes: 10 additions & 2 deletions ai/ai.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func (r *AIService) Run(ctx context.Context, modelName string, params AIRunParam
// An array of classification results for the input text
//
// Union satisfied by [AIRunResponseTextClassification], [shared.UnionString],
// [AIRunResponseAudio], [AIRunResponseTextEmbeddings],
// [AIRunResponseAudio], [shared.UnionString], [AIRunResponseTextEmbeddings],
// [AIRunResponseAutomaticSpeechRecognition], [AIRunResponseImageClassification],
// [AIRunResponseObjectDetection], [AIRunResponseObject],
// [AIRunResponseObjectDetection], [AIRunResponseObject], [shared.UnionString],
// [AIRunResponseTranslation], [AIRunResponseSummarization],
// [AIRunResponseImageToText], [AIRunResponseImageTextToText] or
// [AIRunResponseMultimodalEmbeddings].
Expand All @@ -105,6 +105,10 @@ func init() {
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AIRunResponseAudio{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AIRunResponseTextEmbeddings{}),
Expand All @@ -125,6 +129,10 @@ func init() {
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AIRunResponseObject{}),
},
apijson.UnionVariant{
TypeFilter: gjson.String,
Type: reflect.TypeOf(shared.UnionString("")),
},
apijson.UnionVariant{
TypeFilter: gjson.JSON,
Type: reflect.TypeOf(AIRunResponseTranslation{}),
Expand Down
Loading
Loading