Cloudflare DevelopersCD
Cloudflare Developers6d ago
2 replies
Rodrigo

Hello everyone! I'm trying to deploy a

Hello everyone! I'm trying to deploy a worker with a new change adding AI Gateway Unified billing + AI-SDK. I'm using the following approach and it's working fine locally:

export const aiGateway = createAiGateway({
    binding: env.AI.gateway(env.AI_GATEWAY),
});


But when deploying via Github Actions i'm getting the following error:

  Binding  Resource                  
  env.AI   AI                        
  env.AI_GATEWAY ("redacted")                                        
  ✘ [ERROR] A request to the Cloudflare API (/accounts/***/workers/scripts/redacted/versions) failed.
    Uncaught TypeError: Cannot read properties of undefined (reading 'gateway')
      at null.<anonymous> (assets/worker-entry.js:71272:21)
     [code: 10021]


I would love some guidance. Thanks!
Was this page helpful?