Skip to content

Changelog

New updates and improvements at Cloudflare. Subscribe to RSS

hero image

AI Gateway Introduces New Worker Binding Methods

Jan 30, 2025, 02:00 PM

We have released new Workers bindings API methods, allowing you to connect Workers applications to AI Gateway directly. These methods simplify how Workers calls AI services behind your AI Gateway configurations, removing the need to use the REST API and manually authenticate.

To add an AI binding to your Worker, include the following in your Wrangler configuration file:

Add an AI binding to your Worker.

With the new AI Gateway binding methods, you can now:

  • Send feedback and update metadata with patchLog.
  • Retrieve detailed log information using getLog.
  • Execute universal requests to any AI Gateway provider with run.

For example, to send feedback and update metadata using patchLog:

Send feedback and update metadata using patchLog: