That part of the code looks like this
$zimg='https://www.domain.com/zrobot/zimg/'.$cat_id.'/'.$zfilename.'.webp';
echo '<br>img: <a href="'.$zimg.'">'.$zimg.'</a>';
$image_data=file_get_contents($zimg);
$image_data_base64 = base64_encode($image_data);
$zzz_image['name']=$zfilename.'.webp';
$zzz_image['contents']=$image_data_base64;
$data2 = array(
"status" => "published",
"category" => $cat_id,
"author" => $author,
"fields" => $fields2,
"tags" => $article_format['tags'],
"image" => $zzz_image,
"hidden" => 1,
);