This JSON can then be used with the Node.js client to execute a stateless action:
execute-stateless-action.ts
Copy
Ask AI
import { AiActions, StatelessAction } from "@zapier/ai-actions";const aiActionsClient = new AiActions({ auth: { apiKey: "sk-YOUR_API_KEY", },});const action: StatelessAction = { // JSON from the StatelessActionCreator};action.instructions = "Set the instructions you want to use when running the action";const result = await aiActionsClient.executeStatelessAction(action, { // set this to `false` to actually run the action // otherwise, you can check the parameters that AI Actions will guess preview_only: true,});console.log(result);