Blog
Releases

Puck AI 0.5: onFinish API and switch to Puck stable

Chris VillaChris Villa
Jan 14, 2026

Puck AI 0.5 adds a new onFinish API to track usage, and migrates to Puck 0.21 stable. See the AI overview for more information on Puck AI.

In this post, we’ll go over everything new in Puck AI 0.5 and how you can start using it:

You can also find in-depth documentation in our AI docs.

What’s new in Puck AI 0.5

New Cloud API: onFinish

All APIs in the @puckeditor/cloud-client package now support the onFinish() callback, which will receive usage information about the request.

// For handler
const handler = puckHandler({
  ai: {
    onFinish: ({ totalCost, tokenUsage }) => {
      console.log(`Used ${totalCost} credit`);
    },
  },
});
 
// For generate
const page = await generate({
  // ...
  onFinish: ({ totalCost, tokenUsage }) => {
    console.log(`Used ${totalCost} credit`);
  },
});

Migration to Puck 0.21

Puck AI packages now depend on Puck 0.21. You must also upgrade Puck when upgrading the AI packages, and vice versa.

npm install @puckeditor/core@0.21.0

Please note, Puck 0.21 was renamed to @puckeditor/core.

Full changelog

Features

  • add onFinish API to track usage
  • migrate to Puck 0.21 stable

Bug Fixes

  • ensure pageData is optional as expected in generate API
  • generate slots inside array fields correctly
  • prevent chat placeholder from overflowing
  • restrict chat input height to handle long strings

How to upgrade

Upgrading Puck

Run the following command to install the latest version of Puck AI packages:

npm install @puckeditor/cloud-client@latest @puckeditor/plugin-ai@latest

Try the Puck AI beta

Puck AI is now in open beta. Sign up