Skip to content

Conversation

@roerohan
Copy link
Contributor

@roerohan roerohan commented Jan 12, 2026

Add Cloudflare AI Gateway support to OpenCode integration.

Users can now route AI provider requests through Cloudflare AI Gateway by adding a cloudflareAIGateway provider configuration:

config: {
  provider: {
    anthropic: { options: { apiKey: env.ANTHROPIC_KEY } },
    cloudflareAIGateway: {
      options: {
        accountId: env.CF_ACCOUNT_ID,
        gatewayId: env.CF_GATEWAY_ID,
        apiToken: env.CF_API_TOKEN,
      }
    }
  }
}

The SDK extracts these values and passes them as environment variables (CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_API_TOKEN) to the OpenCode server running in the container (as per this doc).

@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

🦋 Changeset detected

Latest commit: c97132e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/sandbox Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@roerohan roerohan force-pushed the feat-cf-aig branch 2 times, most recently from 2d8ac8b to 761d9ff Compare January 12, 2026 17:38
@ghostwriternr ghostwriternr merged commit efdd0d7 into cloudflare:main Jan 13, 2026
4 of 5 checks passed
@github-actions github-actions bot mentioned this pull request Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants